Debian Codegraph @

FaCT++.Java/src/test/java/conformancetests/NewFeaturesTestCase.java

raw symbols SCIP
1 package conformancetests;
2
3 /* This file is part of the JFact DL reasoner
4 Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester
5 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
6 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
7 You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/
8 import org.junit.Ignore;
9 import org.junit.Test;
10
11 import testbase.TestBase;
12
13 @SuppressWarnings("javadoc")
14 @Ignore
15 public class NewFeaturesTestCase extends TestBase {
16
17 @Test
18 public void testInconsistent_Disjoint_Dataproperties() {
19 String premise = "Prefix(:=<http://example.org/>)\n"
20 + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"
21 + "Ontology(\n"
22 + " Declaration(NamedIndividual(:a))\nDeclaration(DataProperty(:dp1))\nDeclaration(DataProperty(:dp2))\nDeclaration(Class(:A))\n"
23 + " DisjointDataProperties(:dp1 :dp2) \n"
24 + " DataPropertyAssertion(:dp1 :a \"10\"^^xsd:integer)\n"
25 + " SubClassOf(:A DataSomeValuesFrom(:dp2 DatatypeRestriction(xsd:integer xsd:minInclusive \"10\"^^xsd:integer xsd:maxInclusive \"10\"^^xsd:integer)\n )\n )\n"
26 + " ClassAssertion(:A :a)\n" + ')';
27 String conclusion = "";
28 String id = "Inconsistent_Disjoint_Dataproperties";
29 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
30 String d = "The data properties dp1 and dp2 are disjoint, but the individual a must have 10 as dp1 filler and 10 as dp2 filler (since 10 is the only integer satisfying >= 10 and <= 10), which causes the inconsistency.";
31 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
32 r.setReasonerFactory(factory());
33 r.run();
34 }
35
36 @Test
37 public void testMinus_Infinity_is_not_in_owl_real() {
38 String premise = "Prefix(:=<http://example.org/>)\n"
39 + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"
40 + "Prefix(owl:=<http://www.w3.org/2002/07/owl#>)\n"
41 + "Ontology(\n"
42 + " Declaration(NamedIndividual(:a))\n"
43 + " Declaration(DataProperty(:dp))\n"
44 + " Declaration(Class(:A))\n"
45 + " SubClassOf(:A DataAllValuesFrom(:dp owl:real)) \n"
46 + " SubClassOf(:A \n"
47 + " DataSomeValuesFrom(:dp DataOneOf(\"-INF\"^^xsd:float \"-0\"^^xsd:integer))\n"
48 + " )\n"
49 + " ClassAssertion(:A :a) \n"
50 + " NegativeDataPropertyAssertion(:dp :a \"0\"^^xsd:unsignedInt)\n"
51 + ')';
52 String conclusion = "";
53 String id = "Minus_Infinity_is_not_in_owl_real";
54 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
55 String d = "The individual a must have either negative Infinity or 0 (-0 as integer is 0) as dp fillers and all dp successors must be from owl:real, which excludes negative infinity. Since 0 is excluded by the negative property assertion, the ontology is inconsistent.";
56 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
57 r.setReasonerFactory(factory());
58 r.run();
59 }
60
61 @Test
62 public void testNew_Feature_DataQCR_001() {
63 String premise = "<?xml version=\"1.0\"?>\n"
64 + "<rdf:RDF\n"
65 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
66 + '\n' + "<owl:Ontology/>\n" + '\n'
67 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n" + '\n'
68 + "<rdf:Description rdf:about=\"Meg\">\n"
69 + " <hasName>Meg Griffin</hasName>\n"
70 + " <hasName>Megan Griffin</hasName>\n"
71 + "</rdf:Description>\n" + "</rdf:RDF>";
72 String conclusion = "<?xml version=\"1.0\"?>\n"
73 + "<rdf:RDF\n"
74 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
75 + '\n'
76 + "<owl:Ontology/>\n"
77 + '\n'
78 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n"
79 + '\n'
80 + "<rdf:Description rdf:about=\"Meg\">\n"
81 + " <rdf:type>\n"
82 + " <owl:Restriction>\n"
83 + " <owl:onProperty rdf:resource=\"hasName\" />\n"
84 + " <owl:minQualifiedCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">2</owl:minQualifiedCardinality>\n"
85 + " <owl:onDataRange rdf:resource=\"http://www.w3.org/2001/XMLSchema#string\" /></owl:Restriction></rdf:type>\n"
86 + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";
87 String id = "New_Feature_DataQCR_001";
88 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
89 String d = "Demonstrates a qualified minimum cardinality data property restriction based on example in the Structural Specification and Functional-Style Syntax document.";
90 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
91 r.setReasonerFactory(factory());
92 r.run();
93 }
94
95 @Test
96 public void testNew_Feature_DisjointDataProperties_001() {
97 String premise = "<?xml version=\"1.0\"?>\n"
98 + "<rdf:RDF\n"
99 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
100 + '\n'
101 + "<owl:Ontology/>\n"
102 + '\n'
103 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n"
104 + "<owl:DatatypeProperty rdf:about=\"hasAddress\" />\n"
105 + '\n'
106 + "<rdf:Description rdf:about=\"hasName\">\n"
107 + " <owl:propertyDisjointWith rdf:resource=\"hasAddress\" /></rdf:Description>\n"
108 + '\n' + "<rdf:Description rdf:about=\"Peter\">\n"
109 + " <hasName>Peter Griffin</hasName>\n"
110 + " <hasAddress>Peter Griffin</hasAddress>\n"
111 + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";
112 String conclusion = "";
113 String id = "New_Feature_DisjointDataProperties_001";
114 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
115 String d = "Demonstrates use of a disjoint data properties axiom to create a trivial inconsistency based on the example in the Structural Specification and Functional-Style Syntax document.";
116 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
117 r.setReasonerFactory(factory());
118 r.run();
119 }
120
121 @Test
122 public void testNew_Feature_DisjointDataProperties_002() {
123 String premise = "<?xml version=\"1.0\"?>\n"
124 + "<rdf:RDF\n"
125 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
126 + '\n'
127 + "<owl:Ontology/>\n"
128 + '\n'
129 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n"
130 + "<owl:DatatypeProperty rdf:about=\"hasAddress\" />\n"
131 + "<owl:DatatypeProperty rdf:about=\"hasZip\" />\n"
132 + '\n'
133 + "<owl:AllDisjointProperties>\n"
134 + " <owl:members rdf:parseType=\"Collection\">\n"
135 + " <rdf:Description rdf:about=\"hasName\" />\n"
136 + " <rdf:Description rdf:about=\"hasAddress\" />\n"
137 + " <rdf:Description rdf:about=\"hasZip\" />\n"
138 + " </owl:members></owl:AllDisjointProperties>\n"
139 + '\n'
140 + "<rdf:Description rdf:about=\"Peter\">\n"
141 + " <hasName>Peter Griffin</hasName>\n"
142 + "</rdf:Description>\n"
143 + '\n'
144 + "<rdf:Description rdf:about=\"Peter_Griffin\">\n"
145 + " <hasAddress>Peter Griffin</hasAddress>\n"
146 + "</rdf:Description>\n"
147 + '\n'
148 + "<rdf:Description rdf:about=\"Petre\">\n"
149 + " <hasZip>Peter Griffin</hasZip>\n"
150 + "</rdf:Description>\n"
151 + "</rdf:RDF>";
152 String conclusion = "<?xml version=\"1.0\"?>\n"
153 + "<rdf:RDF\n"
154 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
155 + '\n'
156 + "<owl:Ontology/>\n"
157 + '\n'
158 + "<owl:AllDifferent>\n"
159 + " <owl:distinctMembers rdf:parseType=\"Collection\">\n"
160 + " <rdf:Description rdf:about=\"Peter\" />\n"
161 + " <rdf:Description rdf:about=\"Peter_Griffin\" />\n"
162 + " <rdf:Description rdf:about=\"Petre\" /></owl:distinctMembers></owl:AllDifferent>\n"
163 + '\n' + "</rdf:RDF>";
164 String id = "New_Feature_DisjointDataProperties_002";
165 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
166 String d = "Demonstrates use of a ternary disjoint data properties axiom to infer different individuals. Adapted from test New-Feature-DisjointDataProperties-001.";
167 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
168 r.setReasonerFactory(factory());
169 r.run();
170 }
171
172 @Test
173 public void testNew_Feature_Keys_001() {
174 String premise = "<?xml version=\"1.0\"?>\n"
175 + "<rdf:RDF\n"
176 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
177 + '\n'
178 + "<owl:Ontology/>\n"
179 + '\n'
180 + "<owl:DatatypeProperty rdf:about=\"hasSSN\" />\n"
181 + '\n'
182 + "<rdf:Description rdf:about=\"http://www.w3.org/2002/07/owl#Thing\">\n"
183 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
184 + " <rdf:Description rdf:about=\"hasSSN\" />\n"
185 + " </owl:hasKey></rdf:Description>\n" + '\n'
186 + "<rdf:Description rdf:about=\"Peter\">\n"
187 + " <hasSSN>123-45-6789</hasSSN>\n" + "</rdf:Description>\n"
188 + '\n' + "<rdf:Description rdf:about=\"Peter_Griffin\">\n"
189 + " <hasSSN>123-45-6789</hasSSN>\n" + "</rdf:Description>\n"
190 + "</rdf:RDF>";
191 String conclusion = "<?xml version=\"1.0\"?>\n"
192 + "<rdf:RDF\n"
193 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
194 + '\n'
195 + "<owl:Ontology/>\n"
196 + '\n'
197 + "<rdf:Description rdf:about=\"Peter\">\n"
198 + " <owl:sameAs rdf:resource=\"Peter_Griffin\" /></rdf:Description>\n"
199 + '\n' + "</rdf:RDF>";
200 String id = "New_Feature_Keys_001";
201 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
202 String d = "Demonstrates use of a key axiom to merge individuals based on an example in the Structural Specification and Functional-Style Syntax document.";
203 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
204 r.setReasonerFactory(factory());
205 r.run();
206 }
207
208 @Test
209 public void testNew_Feature_Keys_002() {
210 String premise = "<?xml version=\"1.0\"?>\n"
211 + "<rdf:RDF\n"
212 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
213 + '\n'
214 + "<owl:Ontology/>\n"
215 + '\n'
216 + "<owl:DatatypeProperty rdf:about=\"hasSSN\" />\n"
217 + '\n'
218 + "<rdf:Description rdf:about=\"http://www.w3.org/2002/07/owl#Thing\">\n"
219 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
220 + " <rdf:Description rdf:about=\"hasSSN\" />\n"
221 + " </owl:hasKey></rdf:Description>\n"
222 + '\n'
223 + "<rdf:Description rdf:about=\"Peter\">\n"
224 + " <hasSSN>123-45-6789</hasSSN>\n"
225 + "</rdf:Description>\n"
226 + '\n'
227 + "<rdf:Description rdf:about=\"Peter_Griffin\">\n"
228 + " <hasSSN>123-45-6789</hasSSN>\n"
229 + "</rdf:Description>\n"
230 + '\n'
231 + "<rdf:Description rdf:about=\"Peter\">\n"
232 + " <owl:differentFrom rdf:resource=\"Peter_Griffin\" /></rdf:Description>\n"
233 + '\n' + "</rdf:RDF>";
234 String conclusion = "";
235 String id = "New_Feature_Keys_002";
236 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
237 String d = "Demonstrates use of a key axiom to cause a trivial inconsistency based on an example in the Structural Specification and Functional-Style Syntax document.";
238 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
239 r.setReasonerFactory(factory());
240 r.run();
241 }
242
243 @Test
244 public void testNew_Feature_Keys_003() {
245 String premise = "<?xml version=\"1.0\"?>\n"
246 + "<rdf:RDF\n"
247 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
248 + '\n'
249 + "<owl:Ontology/>\n"
250 + '\n'
251 + "<owl:Class rdf:about=\"GriffinFamilyMember\" />\n"
252 + '\n'
253 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n"
254 + '\n'
255 + "<rdf:Description rdf:about=\"GriffinFamilyMember\">\n"
256 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
257 + " <rdf:Description rdf:about=\"hasName\" />\n"
258 + " </owl:hasKey></rdf:Description>\n"
259 + '\n'
260 + "<rdf:Description rdf:about=\"Peter\">\n"
261 + " <hasName>Peter</hasName>\n"
262 + " <rdf:type rdf:resource=\"GriffinFamilyMember\" /></rdf:Description>\n"
263 + '\n'
264 + "<rdf:Description rdf:about=\"Peter_Griffin\">\n"
265 + " <hasName>Peter</hasName>\n"
266 + " <rdf:type rdf:resource=\"GriffinFamilyMember\" /></rdf:Description>\n"
267 + '\n'
268 + "<rdf:Description rdf:about=\"StPeter\">\n"
269 + " <hasName>Peter</hasName>\n"
270 + "</rdf:Description>\n"
271 + "</rdf:RDF>";
272 String conclusion = "<?xml version=\"1.0\"?>\n"
273 + "<rdf:RDF\n"
274 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
275 + '\n'
276 + "<owl:Ontology/>\n"
277 + '\n'
278 + "<rdf:Description rdf:about=\"Peter\">\n"
279 + " <owl:sameAs rdf:resource=\"Peter_Griffin\" /></rdf:Description>\n"
280 + '\n' + "</rdf:RDF>";
281 String id = "New_Feature_Keys_003";
282 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
283 String d = "Demonstrates use of a \"localized\" key axiom to merge individuals based on an example in the Structural Specification and Functional-Style Syntax document.";
284 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
285 r.setReasonerFactory(factory());
286 r.run();
287 }
288
289 @Test
290 public void testNew_Feature_Keys_004() {
291 String premise = "<?xml version=\"1.0\"?>\n"
292 + "<rdf:RDF\n"
293 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
294 + '\n'
295 + "<owl:Ontology/>\n"
296 + '\n'
297 + "<owl:Class rdf:about=\"GriffinFamilyMember\" />\n"
298 + '\n'
299 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n"
300 + '\n'
301 + "<rdf:Description rdf:about=\"GriffinFamilyMember\">\n"
302 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
303 + " <rdf:Description rdf:about=\"hasName\" />\n"
304 + " </owl:hasKey></rdf:Description>\n"
305 + '\n'
306 + "<rdf:Description rdf:about=\"Peter\">\n"
307 + " <hasName>Peter</hasName>\n"
308 + " <rdf:type rdf:resource=\"GriffinFamilyMember\" /></rdf:Description>\n"
309 + '\n'
310 + "<rdf:Description rdf:about=\"Peter_Griffin\">\n"
311 + " <hasName>Peter</hasName>\n"
312 + " <rdf:type rdf:resource=\"GriffinFamilyMember\" /></rdf:Description>\n"
313 + '\n'
314 + "<rdf:Description rdf:about=\"StPeter\">\n"
315 + " <hasName>Peter</hasName>\n"
316 + "</rdf:Description>\n"
317 + "</rdf:RDF>";
318 String conclusion = "<?xml version=\"1.0\"?>\n"
319 + "<rdf:RDF\n"
320 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
321 + '\n' + "<owl:Ontology/>\n" + '\n'
322 + "<rdf:Description rdf:about=\"Peter\">\n"
323 + " <owl:sameAs rdf:resource=\"StPeter\" />\n"
324 + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";
325 String id = "New_Feature_Keys_004";
326 TestClasses tc = TestClasses.valueOf("NEGATIVE_IMPL");
327 String d = "Demonstrates that use of a \"localized\" key axiom only merges individuals that are instances of the given class expression. Based on an example in the Structural Specification and Functional-Style Syntax document.";
328 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
329 r.setReasonerFactory(factory());
330 r.run();
331 }
332
333 @Test
334 public void testNew_Feature_Keys_005() {
335 String premise = "<?xml version=\"1.0\"?>\n"
336 + "<rdf:RDF\n"
337 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
338 + '\n'
339 + "<owl:Ontology/>\n"
340 + '\n'
341 + "<owl:Class rdf:about=\"GriffinFamilyMember\" />\n"
342 + '\n'
343 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n"
344 + '\n'
345 + "<rdf:Description rdf:about=\"GriffinFamilyMember\">\n"
346 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
347 + " <rdf:Description rdf:about=\"hasName\" />\n"
348 + " </owl:hasKey></rdf:Description>\n"
349 + '\n'
350 + "<rdf:Description rdf:about=\"Peter\">\n"
351 + " <hasName>Peter</hasName>\n"
352 + " <hasName>Kichwa-Tembo</hasName>\n"
353 + " <rdf:type rdf:resource=\"GriffinFamilyMember\" /></rdf:Description>\n"
354 + '\n' + "</rdf:RDF>";
355 String conclusion = "";
356 String id = "New_Feature_Keys_005";
357 TestClasses tc = TestClasses.valueOf("CONSISTENCY");
358 String d = "Demonstrates that a key axiom does not make all properties used in it functional. Based on an example in the Structural Specification and Functional-Style Syntax document.";
359 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
360 r.setReasonerFactory(factory());
361 r.run();
362 }
363
364 @Test
365 public void testNew_Feature_Keys_006() {
366 String premise = "<?xml version=\"1.0\"?>\n"
367 + "<rdf:RDF\n"
368 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
369 + '\n'
370 + "<owl:Ontology/>\n"
371 + '\n'
372 + "<owl:Class rdf:about=\"GriffinFamilyMember\" />\n"
373 + '\n'
374 + "<owl:DatatypeProperty rdf:about=\"hasName\" />\n"
375 + '\n'
376 + "<rdf:Description rdf:about=\"GriffinFamilyMember\">\n"
377 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
378 + " <rdf:Description rdf:about=\"hasName\" /></owl:hasKey></rdf:Description>\n"
379 + '\n'
380 + "<rdf:Description rdf:about=\"Peter\">\n"
381 + " <hasName>Peter</hasName>\n"
382 + " <hasName>Kichwa-Tembo</hasName>\n"
383 + " <rdf:type rdf:resource=\"GriffinFamilyMember\" /></rdf:Description>\n"
384 + '\n'
385 + "<rdf:Description rdf:about=\"hasName\">\n"
386 + " <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#FunctionalProperty\" /></rdf:Description>\n"
387 + '\n' + "</rdf:RDF>";
388 String conclusion = "";
389 String id = "New_Feature_Keys_006";
390 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
391 String d = "Demonstrates that a key axiom does not make all properties used in it functional, but these properties may be made functional with other axioms. Based on an example in the Structural Specification and Functional-Style Syntax document.";
392 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
393 r.setReasonerFactory(factory());
394 r.run();
395 }
396
397 @Test
398 public void testNew_Feature_Keys_007() {
399 String premise = "<?xml version=\"1.0\"?>\n"
400 + "<rdf:RDF\n"
401 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
402 + '\n'
403 + "<owl:Ontology/>\n"
404 + '\n'
405 + "<owl:Class rdf:about=\"Person\" />\n"
406 + '\n'
407 + "<owl:Class rdf:about=\"Man\" />\n"
408 + '\n'
409 + "<owl:DatatypeProperty rdf:about=\"hasSSN\" />\n"
410 + '\n'
411 + "<owl:ObjectProperty rdf:about=\"marriedTo\" />\n"
412 + '\n'
413 + "<rdf:Description rdf:about=\"Person\">\n"
414 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
415 + " <rdf:Description rdf:about=\"hasSSN\" /></owl:hasKey></rdf:Description>\n"
416 + '\n'
417 + "<rdf:Description rdf:about=\"Peter\">\n"
418 + " <hasSSN>123-45-6789</hasSSN>\n"
419 + " <rdf:type rdf:resource=\"Person\" /></rdf:Description>\n"
420 + '\n'
421 + "<rdf:Description rdf:about=\"Lois\">\n"
422 + " <rdf:type>\n"
423 + " <owl:Restriction>\n"
424 + " <owl:onProperty rdf:resource=\"marriedTo\" />\n"
425 + " <owl:someValuesFrom>\n"
426 + " <owl:Class>\n"
427 + " <owl:intersectionOf rdf:parseType=\"Collection\">\n"
428 + " <rdf:Description rdf:about=\"Man\" />\n"
429 + " <owl:Restriction>\n"
430 + " <owl:onProperty rdf:resource=\"hasSSN\" />\n"
431 + " <owl:hasValue>123-45-6789</owl:hasValue></owl:Restriction></owl:intersectionOf></owl:Class></owl:someValuesFrom></owl:Restriction></rdf:type>\n"
432 + "</rdf:Description>\n" + "</rdf:RDF>";
433 String conclusion = "<?xml version=\"1.0\"?>\n"
434 + "<rdf:RDF\n"
435 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
436 + '\n' + "<owl:Ontology/>\n" + '\n'
437 + "<owl:Class rdf:about=\"Man\" />\n" + '\n'
438 + "<Man rdf:about=\"Peter\" />\n" + '\n' + "</rdf:RDF>";
439 String id = "New_Feature_Keys_007";
440 TestClasses tc = TestClasses.valueOf("NEGATIVE_IMPL");
441 String d = "Demonstrates that a key axiom only applies to named individuals. Based on an example in the Structural Specification and Functional-Style Syntax document.";
442 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
443 r.setReasonerFactory(factory());
444 r.run();
445 }
446
447 @Test
448 @Changed
449 public void testNew_Feature_ObjectPropertyChain_BJP_003() {
450 String premise = "<?xml version=\"1.0\"?>\n"
451 + "<rdf:RDF\n"
452 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdfs= \"http://www.w3.org/2000/01/rdf-schema#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
453 + '\n'
454 + "<owl:Ontology/>\n"
455 + '\n'
456 + "<owl:ObjectProperty rdf:about=\"http://www.example.org/p\"/>\n"
457 // XXX this is a bug, needs to be fixed
458 + "<owl:Thing rdf:about=\"http://www.example.org/a\"/>\n"
459 + "<owl:Thing rdf:about=\"http://www.example.org/c\"/>\n"
460 + " <rdf:Description rdf:about=\"p\">\n"
461 + " <owl:propertyChainAxiom rdf:parseType=\"Collection\">\n"
462 + " <owl:ObjectProperty rdf:about=\"p\"/>\n"
463 + " <owl:ObjectProperty rdf:about=\"q\"/></owl:propertyChainAxiom></rdf:Description>\n"
464 + " \n" + " <rdf:Description rdf:about=\"a\">\n"
465 + " <p rdf:resource=\"b\"/>\n"
466 + " </rdf:Description>\n" + " \n"
467 + " <rdf:Description rdf:about=\"b\">\n"
468 + " <q rdf:resource=\"c\"/>\n"
469 + " </rdf:Description>\n" + " \n" + "</rdf:RDF>";
470 // XXX this should parse equal to the second example but does not
471 String conclusion = "<?xml version=\"1.0\"?>\n"
472 + "<rdf:RDF\n"
473 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
474 + " <owl:Ontology/>\n"
475 + "<owl:ObjectProperty rdf:about=\"http://www.example.org/p\"/>\n"
476 + " <owl:NamedIndividual rdf:about=\"a\">\n"
477 + " <p rdf:resource=\"c\"/>\n"
478 + " </owl:NamedIndividual>\n" + "</rdf:RDF>";
479 conclusion = "<?xml version=\"1.0\"?>\n"
480 + "<rdf:RDF xmlns=\"http://www.w3.org/2002/07/owl#\"\n"
481 + "xml:base=\"http://www.w3.org/2002/07/owl\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:test=\"http://www.example.org/\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
482 + "<ObjectProperty rdf:about=\"http://www.example.org/p\"/>\n"
483 + "<NamedIndividual rdf:about=\"http://www.example.org/a\">\n"
484 + "<test:p rdf:resource=\"http://www.example.org/c\"/></NamedIndividual>\n"
485 + "</rdf:RDF>";
486 String id = "New_Feature_ObjectPropertyChain_BJP_003";
487 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
488 String d = "A simple test of role chains and role hierarchy.";
489 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
490 r.setReasonerFactory(factory());
491 r.run();
492 }
493
494 @Test
495 public void testNew_Feature_Rational_001() {
496 String premise = "<?xml version=\"1.0\"?>\n"
497 + "<rdf:RDF\n"
498 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
499 + '\n'
500 + "<owl:Ontology/>\n"
501 + '\n'
502 + "<owl:DatatypeProperty rdf:about=\"dp\" />\n"
503 + '\n'
504 + "<rdf:Description rdf:about=\"a\">\n"
505 + " <rdf:type>\n"
506 + " <owl:Restriction>\n"
507 + " <owl:onProperty rdf:resource=\"dp\" />\n"
508 + " <owl:allValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#rational\" /></owl:Restriction></rdf:type></rdf:Description>\n"
509 + '\n'
510 + "<rdf:Description rdf:about=\"a\">\n"
511 + " <rdf:type>\n"
512 + " <owl:Restriction>\n"
513 + " <owl:onProperty rdf:resource=\"dp\" />\n"
514 + " <owl:minCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">2</owl:minCardinality></owl:Restriction></rdf:type>\n"
515 + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";
516 String conclusion = "";
517 String id = "New_Feature_Rational_001";
518 TestClasses tc = TestClasses.valueOf("CONSISTENCY");
519 String d = "A consistent ontology using owl:rational";
520 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
521 r.setReasonerFactory(factory());
522 r.run();
523 }
524
525 @Test
526 public void testNew_Feature_Rational_002() {
527 String premise = "Prefix( : = <http://example.org/> )\n"
528 + "Prefix( owl: = <http://www.w3.org/2002/07/owl#> )\n"
529 + "Prefix( xsd: = <http://www.w3.org/2001/XMLSchema#> )\n"
530 + '\n'
531 + "Ontology(\n"
532 + " Declaration( DataProperty( :dp ) )\n"
533 + " ClassAssertion( DataAllValuesFrom( :dp DataOneOf( \"0.5\"^^xsd:decimal \"1/2\"^^owl:rational ) ) :a )\n"
534 + " ClassAssertion( DataMinCardinality( 2 :dp ) :a )\n" + ')';
535 String conclusion = "";
536 String id = "New_Feature_Rational_002";
537 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
538 String d = "An inconsistent ontology using owl:rational";
539 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
540 r.setReasonerFactory(factory());
541 r.run();
542 }
543
544 @Test
545 public void testNew_Feature_Rational_003() {
546 String premise = "<?xml version=\"1.0\"?>\n"
547 + "<rdf:RDF\n"
548 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs= \"http://www.w3.org/2000/01/rdf-schema#\">\n"
549 + '\n'
550 + "<owl:Ontology/>\n"
551 + '\n'
552 + "<owl:DatatypeProperty rdf:about=\"dp\" />\n"
553 + '\n'
554 + "<rdf:Description rdf:about=\"a\">\n"
555 + " <rdf:type>\n"
556 + " <owl:Restriction>\n"
557 + " <owl:onProperty rdf:resource=\"dp\" />\n"
558 + " <owl:allValuesFrom>\n"
559 + " <rdfs:Datatype>\n"
560 + " <owl:oneOf>\n"
561 + " <rdf:Description>\n"
562 + " <rdf:first rdf:datatype=\"http://www.w3.org/2001/XMLSchema#decimal\">0.3333333333333333</rdf:first>\n"
563 + " <rdf:rest>\n"
564 + " <rdf:Description>\n"
565 + " <rdf:first rdf:datatype=\"http://www.w3.org/2002/07/owl#rational\">1/3</rdf:first>\n"
566 + " <rdf:rest rdf:resource=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"/></rdf:Description></rdf:rest></rdf:Description></owl:oneOf></rdfs:Datatype></owl:allValuesFrom></owl:Restriction></rdf:type></rdf:Description>\n"
567 + '\n'
568 + "<rdf:Description rdf:about=\"a\">\n"
569 + " <rdf:type>\n"
570 + " <owl:Restriction>\n"
571 + " <owl:onProperty rdf:resource=\"dp\" />\n"
572 + " <owl:minCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">2</owl:minCardinality></owl:Restriction></rdf:type>\n"
573 + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";
574 String conclusion = "";
575 String id = "New_Feature_Rational_003";
576 TestClasses tc = TestClasses.valueOf("CONSISTENCY");
577 String d = "A consistent ontology demonstrating owl:rational is different from xsd:decimal. The decimal literal requires 16 digits, the minimum required for conformance.";
578 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
579 r.setReasonerFactory(factory());
580 r.run();
581 }
582
583 @Test
584 public void testNew_Feature_ReflexiveProperty_001() {
585 String premise = "<?xml version=\"1.0\"?>\n"
586 + "<rdf:RDF\n"
587 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
588 + '\n' + "<owl:Ontology/>\n" + '\n'
589 + "<owl:ObjectProperty rdf:about=\"knows\" />\n"
590 + "<owl:NamedIndividual rdf:about=\"Peter\" />\n" + '\n'
591 + "<owl:ReflexiveProperty rdf:about=\"knows\" />\n" + '\n'
592 + "</rdf:RDF>";
593 String conclusion = "<?xml version=\"1.0\"?>\n"
594 + "<rdf:RDF\n"
595 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
596 + '\n' + "<owl:Ontology/>\n" + '\n'
597 + "<owl:ObjectProperty rdf:about=\"knows\" />\n" + '\n'
598 + "<rdf:Description rdf:about=\"Peter\">\n"
599 + " <knows rdf:resource=\"Peter\" />\n"
600 + "</rdf:Description>\n" + "</rdf:RDF>";
601 String id = "New_Feature_ReflexiveProperty_001";
602 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
603 String d = "Uses a reflexive object property axiom to infer a property value based on the example in the Structural Specification and Functional-Style Syntax document.";
604 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
605 r.setReasonerFactory(factory());
606 r.run();
607 }
608
609 @Test
610 public void testNew_Feature_SelfRestriction_001() {
611 String premise = "<?xml version=\"1.0\"?>\n"
612 + "<rdf:RDF\n"
613 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
614 + '\n'
615 + "<owl:Ontology/>\n"
616 + '\n'
617 + "<owl:ObjectProperty rdf:about=\"likes\" />\n"
618 + '\n'
619 + "<rdf:Description rdf:about=\"Peter\">\n"
620 + " <rdf:type>\n"
621 + " <owl:Restriction>\n"
622 + " <owl:onProperty rdf:resource=\"likes\" />\n"
623 + " <owl:hasSelf rdf:datatype=\"http://www.w3.org/2001/XMLSchema#boolean\">true</owl:hasSelf></owl:Restriction></rdf:type>\n"
624 + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";
625 String conclusion = "<?xml version=\"1.0\"?>\n"
626 + "<rdf:RDF\n"
627 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
628 + '\n' + "<owl:Ontology/>\n" + '\n'
629 + "<owl:ObjectProperty rdf:about=\"likes\" />\n" + '\n'
630 + "<rdf:Description rdf:about=\"Peter\">\n"
631 + " <likes rdf:resource=\"Peter\" />\n"
632 + "</rdf:Description>\n" + "</rdf:RDF>";
633 String id = "New_Feature_SelfRestriction_001";
634 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
635 String d = "Demonstrates use of a self-restriction to infer a property value based on example in the Structural Specification and Functional-Style Syntax document.";
636 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
637 r.setReasonerFactory(factory());
638 r.run();
639 }
640
641 @Test
642 public void testNew_Feature_SelfRestriction_002() {
643 String premise = "<?xml version=\"1.0\"?>\n"
644 + "<rdf:RDF\n"
645 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
646 + '\n' + "<owl:Ontology/>\n" + '\n'
647 + "<owl:ObjectProperty rdf:about=\"likes\" />\n" + '\n'
648 + "<rdf:Description rdf:about=\"Peter\">\n"
649 + " <likes rdf:resource=\"Peter\" />\n"
650 + "</rdf:Description>\n" + "</rdf:RDF>";
651 String conclusion = "<?xml version=\"1.0\"?>\n"
652 + "<rdf:RDF\n"
653 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
654 + '\n'
655 + "<owl:Ontology/>\n"
656 + '\n'
657 + "<owl:ObjectProperty rdf:about=\"likes\" />\n"
658 + '\n'
659 + "<rdf:Description rdf:about=\"Peter\">\n"
660 + " <rdf:type>\n"
661 + " <owl:Restriction>\n"
662 + " <owl:onProperty rdf:resource=\"likes\" />\n"
663 + " <owl:hasSelf rdf:datatype=\"http://www.w3.org/2001/XMLSchema#boolean\">true</owl:hasSelf></owl:Restriction></rdf:type>\n"
664 + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";
665 String id = "New_Feature_SelfRestriction_002";
666 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
667 String d = "Demonstrates use of an object property assertion to infer membership in a self restriction based on example in the Structural Specification and Functional-Style Syntax document.";
668 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
669 r.setReasonerFactory(factory());
670 r.run();
671 }
672
673 @Test
674 public void testNew_Feature_TopObjectProperty_001() {
675 String premise = "<?xml version=\"1.0\"?>\n"
676 + "<rdf:RDF\n"
677 + " xml:base = \"http://example.org/\" xmlns = \"http://example.org/\" xmlns:owl = \"http://www.w3.org/2002/07/owl#\" xmlns:rdf = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
678 + '\n'
679 + "<owl:Ontology/>\n"
680 + '\n'
681 + "<rdf:Description rdf:about=\"i\">\n"
682 + " <rdf:type>\n"
683 + " <owl:Class>\n"
684 + " <owl:complementOf>\n"
685 + " <owl:Restriction>\n"
686 + " <owl:onProperty rdf:resource=\"http://www.w3.org/2002/07/owl#topObjectProperty\" />\n"
687 + " <owl:someValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\" /></owl:Restriction></owl:complementOf></owl:Class>\n"
688 + " </rdf:type></rdf:Description>\n" + '\n' + "</rdf:RDF>";
689 String conclusion = "";
690 String id = "New_Feature_TopObjectProperty_001";
691 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
692 String d = "Demonstrates use of the top object property to create an inconsistency.";
693 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
694 r.setReasonerFactory(factory());
695 r.run();
696 }
697
698 @Test
699 public void testconsistent_dataproperty_disjointness() {
700 String premise = "Prefix(:=<http://example.org/>)\n"
701 + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"
702 + "Ontology(\n" + " Declaration(NamedIndividual(:a))\n"
703 + " Declaration(DataProperty(:dp1))\n"
704 + " Declaration(DataProperty(:dp2))\n"
705 + " Declaration(Class(:A))\n"
706 + " DisjointDataProperties(:dp1 :dp2) \n"
707 + " DataPropertyAssertion(:dp1 :a \"10\"^^xsd:integer)\n"
708 + " SubClassOf(:A DataSomeValuesFrom(:dp2 \n"
709 + " DatatypeRestriction(xsd:integer \n"
710 + " xsd:minInclusive \"18\"^^xsd:integer \n"
711 + " xsd:maxInclusive \"18\"^^xsd:integer)\n" + " )\n"
712 + " )\n" + " ClassAssertion(:A :a)\n" + ')';
713 String conclusion = "";
714 String id = "consistent_dataproperty_disjointness";
715 TestClasses tc = TestClasses.valueOf("CONSISTENCY");
716 String d = "The datatype properties dp1 and dp2 are disjoint, but the individual a can have 10 as a filler for dp1 and 18 as filler for dp2, which satisfies the disjointness.";
717 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
718 r.setReasonerFactory(factory());
719 r.run();
720 }
721
722 @Test
723 @Ignore()
724 @Changed(reason = "not OWL 2 DL - data properties cannt be inverse functional properties")
725 public
726 void testrdfbased_sem_char_inversefunc_data() {
727 String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:ex=\"http://www.example.org#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"
728 + " <owl:InverseFunctionalProperty rdf:about=\"http://www.example.org#p\">\n"
729 + " <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/></owl:InverseFunctionalProperty>\n"
730 + " <rdf:Description rdf:about=\"http://www.example.org#x1\">\n"
731 + " <ex:p>data</ex:p>\n"
732 + " </rdf:Description>\n"
733 + " <rdf:Description rdf:about=\"http://www.example.org#x2\">\n"
734 + " <ex:p>data</ex:p>\n" + " </rdf:Description></rdf:RDF>";
735 String conclusion = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:ex=\"http://www.example.org#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"
736 + " <rdf:Description rdf:about=\"http://www.example.org#x1\">\n"
737 + " <owl:sameAs rdf:resource=\"http://www.example.org#x2\"/></rdf:Description></rdf:RDF>";
738 String id = "rdfbased_sem_char_inversefunc_data";
739 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
740 String d = "For two triples with the same inverse functional data property as their predicates and with the same data object, the subjects are the same. This test shows that the OWL 2 RDF-Based Semantics allows for IFDPs.";
741 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
742 r.setReasonerFactory(factory());
743 r.run();
744 }
745
746 @Test
747 @Changed
748 public void testrdfbased_sem_key_def() {
749 String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:ex=\"http://www.example.org#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"
750 + " <owl:Class rdf:about=\"http://www.example.org#c\"/>\n"
751 + " <owl:ObjectProperty rdf:about=\"http://www.example.org#p1\"/>\n"
752 + " <owl:DatatypeProperty rdf:about=\"http://www.example.org#p2\"/>\n"
753 + " <ex:c rdf:about=\"http://www.example.org#x\">\n"
754 + " <ex:p1 rdf:resource=\"http://www.example.org#z\"/>\n"
755 + " <ex:p2>data</ex:p2></ex:c>\n"
756 + " <ex:c rdf:about=\"http://www.example.org#y\">\n"
757 + " <ex:p1 rdf:resource=\"http://www.example.org#z\"/>\n"
758 + " <ex:p2>data</ex:p2></ex:c>\n"
759 + " <rdf:Description rdf:about=\"http://www.example.org#c\">\n"
760 + " <owl:hasKey rdf:parseType=\"Collection\">\n"
761 + " <rdf:Description rdf:about=\"http://www.example.org#p1\"/>\n"
762 + " <rdf:Description rdf:about=\"http://www.example.org#p2\"/></owl:hasKey></rdf:Description>\n"
763 + "</rdf:RDF>";
764 String conclusion = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:ex=\"http://www.example.org#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"
765 + " <rdf:Description rdf:about=\"http://www.example.org#x\">\n"
766 + " <owl:sameAs rdf:resource=\"http://www.example.org#y\"/></rdf:Description></rdf:RDF>";
767 String id = "rdfbased_sem_key_def";
768 TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");
769 String d = "For two triples matching the conditions of a key axiom the subjects are identified.";
770 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
771 r.setReasonerFactory(factory());
772 r.run();
773 }
774
775 @Test
776 @Changed
777 public void testrdfbased_sem_npa_ind_fw() {
778 String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:ex=\"http://www.example.org#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"
779 + " <owl:ObjectProperty rdf:about=\"http://www.example.org#p\"/>\n"
780 + " <rdf:Description rdf:about=\"http://www.example.org#z\">\n"
781 + " <owl:sourceIndividual>\n"
782 + " <rdf:Description rdf:about=\"http://www.example.org#s\">\n"
783 + " <ex:p rdf:resource=\"http://www.example.org#o\"/></rdf:Description></owl:sourceIndividual>\n"
784 + " <owl:assertionProperty rdf:resource=\"http://www.example.org#p\"/>\n"
785 + " <owl:targetIndividual rdf:resource=\"http://www.example.org#o\"/></rdf:Description></rdf:RDF>";
786 String conclusion = "";
787 String id = "rdfbased_sem_npa_ind_fw";
788 TestClasses tc = TestClasses.valueOf("INCONSISTENCY");
789 String d = "A negative property assertion NPA(s p o) must not occur together with the corresponding positive property assertion s p o.";
790 JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);
791 r.setReasonerFactory(factory());
792 r.run();
793 }
794 }