aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/buzz/OWLAxiomSpec.scala302
-rw-r--r--src/test/scala/buzz/OWLClassSpec.scala259
2 files changed, 561 insertions, 0 deletions
diff --git a/src/test/scala/buzz/OWLAxiomSpec.scala b/src/test/scala/buzz/OWLAxiomSpec.scala
new file mode 100644
index 0000000..b6a44f4
--- /dev/null
+++ b/src/test/scala/buzz/OWLAxiomSpec.scala
@@ -0,0 +1,302 @@
1package rsacomb
2
3import java.util.ArrayList
4import org.scalatest.{FlatSpec, Matchers, LoneElement}
5
6import uk.ac.manchester.cs.owl.owlapi.{OWLSubClassOfAxiomImpl}
7import uk.ac.manchester.cs.owl.owlapi.{OWLClassImpl, OWLObjectSomeValuesFromImpl, OWLObjectIntersectionOfImpl, OWLObjectOneOfImpl, OWLObjectAllValuesFromImpl, OWLObjectMaxCardinalityImpl, OWLNamedIndividualImpl}
8import uk.ac.manchester.cs.owl.owlapi.{OWLObjectPropertyImpl}
9import org.semanticweb.owlapi.model.{OWLAxiom,IRI}
10
11import tech.oxfordsemantic.jrdfox.logic.{Rule,Bind,BuiltinFunctionCall}
12import tech.oxfordsemantic.jrdfox.logic.{Atom, Predicate, Term, Variable, Individual}
13
14object OWLAxiomSpec {
15
16 // IRI
17 val iri_Professor = IRI.create("univ:Professor")
18 val iri_Female = IRI.create("std:Female")
19 val iri_Student = IRI.create("univ:Student")
20 val iri_PartTimeStudent = IRI.create("univ:PartTimeStudent")
21 val iri_Worker = IRI.create("univ:Worker")
22 val iri_alice = IRI.create("univ:alice")
23 val iri_supervises = IRI.create("univ:supervises")
24 val iri_hasSupervisor = IRI.create("univ:hasSupervisor")
25 val iri_sameAs = IRI.create("owl:sameAs")
26
27 // RDFox Terms
28 val term_x = Variable.create("x")
29 val term_y = Variable.create("y")
30 val term_z = Variable.create("z")
31 val term_c1 = Individual.create("internal:c_1")
32 val term_c2 = Individual.create("internal:c_2")
33 val term_alice = Individual.create("univ:alice")
34
35 // RDFox Predicates
36 val pred_sameAs = Predicate.create("owl:sameAs")
37 val pred_Professor = Predicate.create(iri_Professor.getIRIString)
38 val pred_hasSupervisor = Predicate.create(iri_hasSupervisor.getIRIString)
39
40 // OWL Classes
41 // Name Class corresponding to
42 //
43 // Professor
44 //
45 val class_Professor = new OWLClassImpl(iri_Professor)
46 val class_Female = new OWLClassImpl(iri_Female)
47 val class_Student = new OWLClassImpl(iri_Student)
48 val class_PartTimeStudent = new OWLClassImpl(iri_PartTimeStudent)
49 val class_Worker = new OWLClassImpl(iri_Worker)
50 val class_OWLClass = class_Professor
51 // Class Conjunction corresponding to
52 //
53 // Student ∧ Worker
54 //
55 val class_OWLObjectIntersectionOf =
56 new OWLObjectIntersectionOfImpl(
57 class_Student, class_Worker
58 )
59 // Singleton Class corresponding to
60 //
61 // { alice }
62 //
63 val class_OWLObjectOneOf =
64 new OWLObjectOneOfImpl(
65 new OWLNamedIndividualImpl(iri_alice)
66 )
67 // Object Existential Restiction corresponding to
68 //
69 // ∃ hasSupervisor.Professor
70 //
71 val class_OWLObjectSomeValuesFrom =
72 new OWLObjectSomeValuesFromImpl(
73 new OWLObjectPropertyImpl(iri_hasSupervisor),
74 class_Professor
75 )
76 // Object Max Cardinality Restriction corresponding to
77 //
78 // ≤ 1 hasSupervisor . Professor
79 val class_OWLObjectMaxCardinality =
80 new OWLObjectMaxCardinalityImpl(
81 new OWLObjectPropertyImpl(iri_hasSupervisor),
82 1,
83 class_Professor
84 )
85
86 // OWL Axioms
87 // Axiom SubClassOf corresponding to
88 //
89 // Student ∧ Worker -> PartTimeStudent
90 //
91 val axiom_OWLSubClassOf1 =
92 new OWLSubClassOfAxiomImpl(
93 class_OWLObjectIntersectionOf,
94 class_PartTimeStudent,
95 new ArrayList()
96 )
97
98 // Axiom SubClassOf corresponding to
99 //
100 // Student -> ∃ hasSupervisor.Professor
101 //
102 val axiom_OWLSubClassOf2 =
103 new OWLSubClassOfAxiomImpl(
104 class_Student,
105 class_OWLObjectSomeValuesFrom,
106 new ArrayList()
107 )
108
109 // Axiom SubClassOf corresponding to
110 //
111 // ∃ hasSupervisor.Professor -> Student
112 //
113 val axiom_OWLSubClassOf3 =
114 new OWLSubClassOfAxiomImpl(
115 class_OWLObjectSomeValuesFrom,
116 class_Student,
117 new ArrayList()
118 )
119
120 // Axiom SubClassOf corresponding to
121 //
122 // Student -> { alice }
123 //
124 val axiom_OWLSubClassOf4 =
125 new OWLSubClassOfAxiomImpl(
126 class_Student,
127 class_OWLObjectOneOf,
128 new ArrayList()
129 )
130
131 // Axiom SubClassOf corresponding to
132 //
133 // Student -> ≤1 hasSupervisor.Professor
134 //
135 val axiom_OWLSubClassOf5 =
136 new OWLSubClassOfAxiomImpl(
137 class_Student,
138 class_OWLObjectMaxCardinality,
139 new ArrayList()
140 )
141
142 def convertAxiom(
143 axiom: OWLAxiom,
144 term: Term,
145 skolem: SkolemStrategy = SkolemStrategy.None
146 ) : List[Rule] = {
147 axiom.accept(RDFoxAxiomConverter(term,skolem))
148 }
149
150} // object OWLAxiomSpec
151
152class OWLAxiomSpec
153 extends FlatSpec with Matchers with LoneElement
154{
155 // Import required data
156 import OWLAxiomSpec._
157
158 // OWLSubClassOfAxiom #1
159 axiom_OWLSubClassOf1.toString should "be converted into a singleton List[Rule]" in {
160 val result = convertAxiom(axiom_OWLSubClassOf1,term_x)
161 result.loneElement shouldBe a [Rule]
162 }
163
164 it should "contain a conjuction of atoms (Student[?x],Worker[?x]) in the body of the rule" in {
165 val result = convertAxiom(axiom_OWLSubClassOf1,term_x)
166 val body = List(
167 Atom.create(Predicate.create(iri_Student.getIRIString),term_x),
168 Atom.create(Predicate.create(iri_Worker.getIRIString),term_x)
169 )
170 result.loneElement.getBody should contain theSameElementsAs body
171 }
172
173 it should "contain a single atom (PartTimeStudent[?x]) in the head of the rule" in {
174 val result = convertAxiom(axiom_OWLSubClassOf1,term_x)
175 val head = Atom.create(Predicate.create(iri_PartTimeStudent.getIRIString),term_x)
176 result.loneElement.getHead.loneElement should be (head)
177 }
178
179 // OWLSubClassOfAxiom #2 (w/ constant skolemization)
180 (axiom_OWLSubClassOf2.toString + "\n(w/ constant skolemization)") should
181 "be converted into a singleton List[Rule]" in
182 {
183 val skolem = SkolemStrategy.Constant(axiom_OWLSubClassOf2.toString)
184 val result = convertAxiom(axiom_OWLSubClassOf2,term_x,skolem)
185 result.loneElement shouldBe a [Rule]
186 }
187
188 it should "contain a single atom (Student[?x]) in the body of the rule" in {
189 val skolem = SkolemStrategy.Constant(axiom_OWLSubClassOf2.toString)
190 val result = convertAxiom(axiom_OWLSubClassOf2,term_x,skolem)
191 val body = Atom.create(Predicate.create(iri_Student.getIRIString),term_x)
192 result.loneElement.getBody.loneElement should equal (body)
193 }
194
195 it should "contain a conjuction of atoms (hasSupervisor[?x,?c],Professor[?c]) in the head of the rule" in {
196 val skolem = SkolemStrategy.Constant(axiom_OWLSubClassOf2.toString)
197 val result = convertAxiom(axiom_OWLSubClassOf2,term_x,skolem)
198 val term_c = Individual.create(skolem.const)
199 val head = List(
200 Atom.create(Predicate.create(iri_hasSupervisor.getIRIString),term_x,term_c),
201 Atom.create(Predicate.create(iri_Professor.getIRIString),term_c)
202 )
203 result.loneElement.getHead should contain theSameElementsAs (head)
204 }
205
206 // OWLSubClassOfAxiom #2 (w/ skolemization)
207 (axiom_OWLSubClassOf2.toString + "\n(w/ skolemization)") should
208 "be converted into a singleton List[Rule]" in
209 {
210 val skolem = SkolemStrategy.Standard(axiom_OWLSubClassOf2.toString)
211 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
212 result.loneElement shouldBe a [Rule]
213 }
214
215 it should "contain an atom (Student[?x]) in the body of the rule" in {
216 val skolem = SkolemStrategy.Standard(axiom_OWLSubClassOf2.toString)
217 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
218 val body = Atom.create(Predicate.create(iri_Student.getIRIString),term_x)
219 result.loneElement.getBody should contain (body)
220 }
221
222 it should "contain a built-in function call (BIND(?y,SKOLEM(?f,?x))) in the body of the rule" in {
223 val skolem = SkolemStrategy.Standard(axiom_OWLSubClassOf2.toString)
224 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
225 val call = Bind.create(BuiltinFunctionCall.create("SKOLEM",term_x),term_y)
226 result.loneElement.getBody should contain (call)
227 }
228
229 it should "contain a conjuction of atom (hasSupervisor[?x,?y],Professor[?y]) in the head of the rule" in {
230 val skolem = SkolemStrategy.Standard(axiom_OWLSubClassOf2.toString)
231 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
232 val head = List(
233 Atom.create(Predicate.create(iri_hasSupervisor.getIRIString),term_x,term_y),
234 Atom.create(Predicate.create(iri_Professor.getIRIString),term_y)
235 )
236 result.loneElement.getHead should contain theSameElementsAs head
237 }
238
239 // OWLSubClassOfAxiom #3
240 axiom_OWLSubClassOf3.toString should "be converted into a singleton List[Rule]" in {
241 val result = convertAxiom(axiom_OWLSubClassOf3,term_x)
242 result.loneElement shouldBe a [Rule]
243 }
244
245 it should "contain a conjunction of atoms (hasSupervisor[?x,?y],Professor[?y]) in the body of the rule" in {
246 val result = convertAxiom(axiom_OWLSubClassOf3,term_x)
247 val body = List(
248 Atom.create(Predicate.create(iri_hasSupervisor.getIRIString),term_x,term_y),
249 Atom.create(Predicate.create(iri_Professor.getIRIString),term_y)
250 )
251 result.loneElement.getBody should contain theSameElementsAs body
252 }
253
254 it should "contain a single atom (Student[?x]) in the head of the rule" in {
255 val result = convertAxiom(axiom_OWLSubClassOf3, term_x)
256 val head = Atom.create(Predicate.create(iri_Student.getIRIString),term_x)
257 result.loneElement.getHead.loneElement should be (head)
258 }
259
260 // OWLSubClassOfAxiom #4
261 axiom_OWLSubClassOf4.toString should "be converted into a singleton List[Rule]" in {
262 val result = convertAxiom(axiom_OWLSubClassOf4,term_x)
263 result.loneElement shouldBe a [Rule]
264 }
265
266 it should "contain a single atoms (Student[?x]) in the body of the rule" in {
267 val result = convertAxiom(axiom_OWLSubClassOf4,term_x)
268 val body = Atom.create(Predicate.create(iri_Student.getIRIString),term_x)
269 result.loneElement.getBody.loneElement should be (body)
270 }
271
272 it should "contain a single atom (sameAs[?x,alice])) in the head of the rule" in {
273 val result = convertAxiom(axiom_OWLSubClassOf4, term_x)
274 val head = Atom.create(Predicate.create(iri_sameAs.getIRIString),term_x,term_alice)
275 result.loneElement.getHead.loneElement should be (head)
276 }
277
278 // OWLSubClassOfAxiom #5
279 axiom_OWLSubClassOf5.toString should "be converted into a singleton List[Rule]" in {
280 val result = convertAxiom(axiom_OWLSubClassOf5,term_x)
281 result.loneElement shouldBe a [Rule]
282 }
283
284 it should "contain a conjunction of atoms (...) in the body of the rule" in {
285 val result = convertAxiom(axiom_OWLSubClassOf5,term_x)
286 val body = List(
287 Atom.create(Predicate.create(iri_Student.getIRIString),term_x),
288 Atom.create(Predicate.create(iri_hasSupervisor.getIRIString),term_x,term_y),
289 Atom.create(Predicate.create(iri_Professor.getIRIString),term_y),
290 Atom.create(Predicate.create(iri_hasSupervisor.getIRIString),term_x,term_z),
291 Atom.create(Predicate.create(iri_Professor.getIRIString),term_z)
292 )
293 result.loneElement.getBody should contain theSameElementsAs body
294 }
295
296 it should "contain a single atom (sameAs[?x,?z])) in the head of the rule" in {
297 val result = convertAxiom(axiom_OWLSubClassOf5, term_x)
298 val head = Atom.create(Predicate.create(iri_sameAs.getIRIString),term_y,term_z)
299 result.loneElement.getHead.loneElement should be (head)
300 }
301
302} // class OWLAxiomSpec
diff --git a/src/test/scala/buzz/OWLClassSpec.scala b/src/test/scala/buzz/OWLClassSpec.scala
new file mode 100644
index 0000000..df10e19
--- /dev/null
+++ b/src/test/scala/buzz/OWLClassSpec.scala
@@ -0,0 +1,259 @@
1package rsacomb
2
3import org.scalatest.{FlatSpec, Matchers, LoneElement}
4
5import uk.ac.manchester.cs.owl.owlapi.{OWLClassImpl, OWLObjectSomeValuesFromImpl, OWLObjectIntersectionOfImpl, OWLObjectOneOfImpl, OWLObjectAllValuesFromImpl, OWLObjectMaxCardinalityImpl, OWLNamedIndividualImpl}
6import uk.ac.manchester.cs.owl.owlapi.{OWLObjectPropertyImpl}
7import org.semanticweb.owlapi.model.IRI
8
9import tech.oxfordsemantic.jrdfox.logic.{Bind,BuiltinFunctionCall}
10import tech.oxfordsemantic.jrdfox.logic.{Atom, Predicate, Term, Variable, Individual}
11
12import rsacomb.RDFoxRuleShards
13
14object OWLClassSpec {
15
16 // IRI
17 val iri_Professor = IRI.create("univ:Professor")
18 val iri_Female = IRI.create("std:Female")
19 val iri_Student = IRI.create("univ:Student")
20 val iri_Worker = IRI.create("univ:Worker")
21 val iri_alice = IRI.create("univ:alice")
22 val iri_supervises = IRI.create("univ:supervises")
23 val iri_hasSupervisor = IRI.create("univ:hasSupervisor")
24
25 // RDFox Terms
26 val term_x = Variable.create("x")
27 val term_y = Variable.create("y")
28 val term_c1 = Individual.create("internal:c_1")
29 val term_c2 = Individual.create("internal:c_2")
30 val term_alice = Individual.create("univ:alice")
31
32 // RDFox Predicates
33 val pred_sameAs = Predicate.create("owl:sameAs")
34 val pred_Professor = Predicate.create(iri_Professor.getIRIString)
35 val pred_hasSupervisor = Predicate.create(iri_hasSupervisor.getIRIString)
36
37 // OWL Classes
38 // Name Class corresponding to
39 //
40 // Professor
41 //
42 val class_Professor = new OWLClassImpl(iri_Professor)
43 val class_Female = new OWLClassImpl(iri_Female)
44 val class_Student = new OWLClassImpl(iri_Student)
45 val class_Worker = new OWLClassImpl(iri_Worker)
46 val class_OWLClass = class_Professor
47
48 // Class Conjunction corresponding to
49 //
50 // Female ∧ Student ∧ Worker
51 //
52 val class_OWLObjectIntersectionOf =
53 new OWLObjectIntersectionOfImpl(
54 class_Female, class_Student, class_Worker
55 )
56 // Singleton Class corresponding to
57 //
58 // { alice }
59 //
60 val class_OWLObjectOneOf =
61 new OWLObjectOneOfImpl(
62 new OWLNamedIndividualImpl(iri_alice)
63 )
64 // Object Existential Restiction corresponding to
65 //
66 // ∃ hasSupervisor.Professor
67 //
68 val class_OWLObjectSomeValuesFrom =
69 new OWLObjectSomeValuesFromImpl(
70 new OWLObjectPropertyImpl(iri_hasSupervisor),
71 class_Professor
72 )
73 // Object Max Cardinality Restriction corresponding to
74 //
75 // ≤1 hasSupervisor.Professor
76 val class_OWLObjectMaxCardinality =
77 new OWLObjectMaxCardinalityImpl(
78 new OWLObjectPropertyImpl(iri_hasSupervisor),
79 1,
80 class_Professor
81 )
82} // object OWLClassSpec
83
84class OWLClassSpec
85 extends FlatSpec with Matchers with LoneElement
86{
87 // Import required data
88 import OWLClassSpec._
89
90 // OWLClass
91 class_OWLClass.toString should "be converted into a RDFoxRuleShards" in {
92 val visitor = RDFoxClassExprConverter(term_x)
93 val result = class_OWLClass.accept(visitor)
94 result shouldBe a [RDFoxRuleShards]
95 }
96
97 it should "have a single Atom in its result list" in {
98 val visitor = RDFoxClassExprConverter(term_x)
99 val result = class_OWLClass.accept(visitor)
100 result.res.loneElement shouldBe an [Atom]
101 }
102
103 it should "have an empty extension list" in {
104 val visitor = RDFoxClassExprConverter(term_x)
105 val result = class_OWLClass.accept(visitor)
106 result.ext shouldBe empty
107 }
108
109 // OWLObjectIntersectionOf
110 class_OWLObjectIntersectionOf.toString should "be converted into a RDFoxRuleShards" in {
111 val visitor = RDFoxClassExprConverter(term_x)
112 val result = class_OWLObjectIntersectionOf.accept(visitor)
113 result shouldBe a [RDFoxRuleShards]
114 }
115
116 it should "be converted in the union of its converted conjuncts" in {
117 val visitor = RDFoxClassExprConverter(term_x)
118 val result1= class_OWLObjectIntersectionOf.accept(visitor)
119 val result2 = RDFoxClassExprConverter.merge(List(
120 class_Female.accept(visitor),
121 class_Student.accept(visitor),
122 class_Worker.accept(visitor)
123 ))
124 result1.res should contain theSameElementsAs result2.res
125 result1.ext should contain theSameElementsAs result2.ext
126 }
127
128 // OWLObjectOneOf
129 class_OWLObjectOneOf.toString should "be converted into a RDFoxRuleShards" in {
130 val visitor = RDFoxClassExprConverter(term_x)
131 val result = class_OWLObjectOneOf.accept(visitor)
132 result shouldBe a [RDFoxRuleShards]
133 }
134
135 it should "be converted into a single <owl:sameAs> Atom" in {
136 val visitor = RDFoxClassExprConverter(term_x)
137 val result = class_OWLObjectOneOf.accept(visitor)
138 result.res.loneElement should (be (a [Atom]) and have ('predicate (pred_sameAs)))
139 }
140
141 it should "have an empty extension list" in {
142 val visitor = RDFoxClassExprConverter(term_x)
143 val result = class_OWLObjectOneOf.accept(visitor)
144 result.ext shouldBe empty
145 }
146
147 // OWLObjectSomeValuesFrom
148 (class_OWLObjectSomeValuesFrom.toString ++ " w/o skolemization") should
149 "be converted into a RDFoxRuleShards" in {
150 val visitor = RDFoxClassExprConverter(term_x,SkolemStrategy.None)
151 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
152 result shouldBe a [RDFoxRuleShards]
153 }
154
155 it should "have exactly one unary Atom in its result list" in {
156 val visitor = RDFoxClassExprConverter(term_x,SkolemStrategy.None)
157 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
158 exactly (1, result.res) should (be (an [Atom]) and have ('numberOfArguments (1)))
159 }
160
161 it should "have exactly one binary Atom in its result list" in {
162 val visitor = RDFoxClassExprConverter(term_x,SkolemStrategy.None)
163 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
164 exactly (1, result.res) should (be (an [Atom]) and have ('numberOfArguments (2)))
165 }
166
167 it should "have an empty extension list" in {
168 val visitor = RDFoxClassExprConverter(term_x,SkolemStrategy.None)
169 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
170 result.ext shouldBe empty
171 }
172
173 (class_OWLObjectSomeValuesFrom.toString ++ " w/ skolemization") should
174 "be converted into a RDFoxRuleShards" in {
175 val skolem = SkolemStrategy.Standard(class_OWLObjectSomeValuesFrom.toString)
176 val visitor = RDFoxClassExprConverter(term_x,skolem)
177 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
178 result shouldBe a [RDFoxRuleShards]
179 }
180
181 it should "have exactly one unary Atom in its result list" in {
182 val skolem = SkolemStrategy.Standard(class_OWLObjectSomeValuesFrom.toString)
183 val visitor = RDFoxClassExprConverter(term_x,skolem)
184 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
185 exactly (1, result.res) should (be (an [Atom]) and have ('numberOfArguments (1)))
186 }
187
188 it should "have exactly one binary Atom in its result list" in {
189 val skolem = SkolemStrategy.Standard(class_OWLObjectSomeValuesFrom.toString)
190 val visitor = RDFoxClassExprConverter(term_x,skolem)
191 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
192 exactly (1, result.res) should (be (an [Atom]) and have ('numberOfArguments (2)))
193 }
194
195 it should "should have a single SKOLEM call in the extension list" in {
196 val skolem = SkolemStrategy.Standard(class_OWLObjectSomeValuesFrom.toString)
197 val visitor = RDFoxClassExprConverter(term_x,skolem)
198 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
199 result.ext.loneElement shouldBe a [Bind]
200 val builtin = result.ext.head.asInstanceOf[Bind].getBuiltinExpression
201 builtin should (be (a [BuiltinFunctionCall]) and have ('functionName ("SKOLEM")))
202 }
203
204 (class_OWLObjectSomeValuesFrom.toString ++ " w/ constant skolemization") should
205 "be converted into a RDFoxRuleShards" in {
206 val skolem = SkolemStrategy.Constant(class_OWLObjectSomeValuesFrom.toString)
207 val visitor = RDFoxClassExprConverter(term_x,skolem)
208 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
209 result shouldBe a [RDFoxRuleShards]
210 }
211
212 it should "have exactly one unary Atom in its result list" in {
213 val skolem = SkolemStrategy.Constant(class_OWLObjectSomeValuesFrom.toString)
214 val visitor = RDFoxClassExprConverter(term_x,skolem)
215 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
216 exactly (1, result.res) should (be (an [Atom]) and have ('numberOfArguments (1)))
217 }
218
219 it should "have exactly one binary Atom in its result list" in {
220 val skolem = SkolemStrategy.Constant(class_OWLObjectSomeValuesFrom.toString)
221 val visitor = RDFoxClassExprConverter(term_x,skolem)
222 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
223 exactly (1, result.res) should (be (an [Atom]) and have ('numberOfArguments (2)))
224 }
225
226 it should "have an empty extension list" in {
227 val skolem = SkolemStrategy.Constant(class_OWLObjectSomeValuesFrom.toString)
228 val visitor = RDFoxClassExprConverter(term_x,skolem)
229 val result = class_OWLObjectSomeValuesFrom.accept(visitor)
230 result.ext shouldBe empty
231 }
232
233 // OWLObjectMaxCardinalityImpl
234 class_OWLObjectMaxCardinality.toString should
235 "be converted into a RDFoxRuleShards" in {
236 val visitor = RDFoxClassExprConverter(term_x)
237 val result = class_OWLObjectMaxCardinality.accept(visitor)
238 result shouldBe a [RDFoxRuleShards]
239 }
240
241 it should "have a single <owl:sameAs> Atom in the result list" in {
242 val visitor = RDFoxClassExprConverter(term_x)
243 val result = class_OWLObjectMaxCardinality.accept(visitor)
244 result.res.loneElement should (be (an [Atom]) and have ('predicate (pred_sameAs)))
245 }
246
247 it should "have two unary Atoms in its extension list" in {
248 val visitor = RDFoxClassExprConverter(term_x)
249 val result = class_OWLObjectMaxCardinality.accept(visitor)
250 exactly (2, result.ext) should (be (an [Atom]) and have ('numberOfArguments (1)))
251 }
252
253 it should "have two binary Atoms in its extension list" in {
254 val visitor = RDFoxClassExprConverter(term_x)
255 val result = class_OWLObjectMaxCardinality.accept(visitor)
256 exactly (2, result.ext) should (be (an [Atom]) and have ('numberOfArguments (2)))
257 }
258
259} // class OWLClassSpec