package conformancetests; import org.junit.Ignore; /* This file is part of the JFact DL reasoner Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 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. 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. 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*/ import org.junit.Test; import testbase.TestBase; @SuppressWarnings("javadoc") public class OWL2TestCase extends TestBase { @Test public void testowl2_rl_anonymous_individual() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = ""; String id = "owl2_rl_anonymous_individual"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "OWL 2 RL allows anonymous individual."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_invalid_leftside_allvaluesfrom() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = ""; String id = "owl2_rl_invalid_leftside_allvaluesfrom"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "OWL 2 RL does not allow left side allValuesFrom in a subClassOf axiom."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_invalid_leftside_maxcard() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " 2\n" + " "; String conclusion = ""; String id = "owl2_rl_invalid_leftside_maxcard"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Invalid OWL 2 RL due to maxCardinality usage."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_invalid_oneof() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; String conclusion = ""; String id = "owl2_rl_invalid_oneof"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "OWL 2 RL does not permit owl:oneOf to define a named class (it can be used as a subclass expression)."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_invalid_owlreal() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = ""; String id = "owl2_rl_invalid_owlreal"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Invalid OWL 2 RL because owl:real is used."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_invalid_rightside_somevaluesfrom() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = ""; String id = "owl2_rl_invalid_rightside_somevaluesfrom"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "This is not a valid OWL 2 RL because someValuesFrom shows up on the right hand side of a SubClassOf axiom."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_invalid_rightside_unionof() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = ""; String id = "owl2_rl_invalid_rightside_unionof"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Incorrect OWL 2 RL syntax. unionOf shows up at the right hand side of a SubClassOf axiom."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_invalid_unionof() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; String conclusion = ""; String id = "owl2_rl_invalid_unionof"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "OWL 2 RL does not allow owl:unionOf to define a named class (it can be used as a subclass expression)."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_rules_fp_differentFrom() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = "\n" + " \n" + " \n" + " \n" + " "; String id = "owl2_rl_rules_fp_differentFrom"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "This test checks the interaction between an OWL functional property and differentFrom assertions."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_rules_ifp_differentFrom() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = "\n" + " \n" + " \n" + " \n" + " \n" + ""; String id = "owl2_rl_rules_ifp_differentFrom"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "This test checks the interaction between inverse functional property and differentFrom assertions."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_valid_mincard() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " 1\n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = ""; String id = "owl2_rl_valid_mincard"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "OWL 2 RL does not allow min cardinality"; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_valid_oneof() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; String conclusion = ""; String id = "owl2_rl_valid_oneof"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "A valid usage of oneOf in OWL 2 RL"; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testowl2_rl_valid_rightside_allvaluesfrom() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = ""; String id = "owl2_rl_valid_rightside_allvaluesfrom"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Valid RL usage of allValuesFrom."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_AnnotationAnnotations_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + " An example ontology\n" + '\n' + "\n" + " \n" + " \n" + " An example ontology\n" + " Mike Smith\n" + "\n" + '\n' + "\n" + "\n" + '\n' + ""; String conclusion = ""; String id = "New_Feature_AnnotationAnnotations_001"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Demonstrates annotation of an annotation. Adapted from an example in the Mapping to RDF Graphs document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_AsymmetricProperty_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + "\n" + '\n' + "\n" + " \n" + "\n" + '\n' + ""; String conclusion = ""; String id = "New_Feature_AsymmetricProperty_001"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "Demonstrates use of an asymmetric object property axiom to cause a trivial inconsistency based on the example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_AxiomAnnotations_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + '\n' + "\n" + " \n" + " \n" + " \n" + " Children are people.\n" + '\n' + ""; String conclusion = ""; String id = "New_Feature_AxiomAnnotations_001"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Demonstrates axiom annotation based on an example in the Mapping to RDF Graphs document. The axiom being annotated here generates a main triple when mapped to RDF."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_BottomDataProperty_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + " \n" + "\n" + '\n' + ""; String conclusion = ""; String id = "New_Feature_BottomDataProperty_001"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "Demonstrates use of the bottom data property to create an inconsistency."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_BottomObjectProperty_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + " \n" + "\n" + '\n' + ""; String conclusion = ""; String id = "New_Feature_BottomObjectProperty_001"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "Demonstrates use of the bottom object property to create an inconsistency."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_DisjointObjectProperties_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + '\n' + "\n" + " \n" + "\n" + '\n' + "\n" + " \n" + "\n" + '\n' + ""; String conclusion = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + '\n' + ""; String id = "New_Feature_DisjointObjectProperties_001"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "Demonstrates use of a disjoint object properties axiom to infer that two individuals are different based on the example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_DisjointObjectProperties_002() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + " \n" + '\n' + "\n" + " \n" + "\n" + '\n' + "\n" + " \n" + "\n" + '\n' + "\n" + " \n" + "\n" + '\n' + ""; String conclusion = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + " \n" + '\n' + ""; String id = "New_Feature_DisjointObjectProperties_002"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "A modification of test New-Feature-DisjointObjectProperties-001 to demonstrate a ternary disjoint object properties axiom."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_DisjointUnion_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + '\n' + "\n" + "\n" + " \n" + " \n" + " \n" + "\n" + '\n' + ""; String conclusion = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + '\n' + "\n" + '\n' + ""; String id = "New_Feature_DisjointUnion_001"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "Demonstrates a disjoint union axiom based on the example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_IrreflexiveProperty_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + "\n" + '\n' + ""; String conclusion = ""; String id = "New_Feature_IrreflexiveProperty_001"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "Demonstrates use of an irreflexive object property axiom to cause a trivial inconsistency based on the example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_NegativeDataPropertyAssertion_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " 5\n" + '\n' + "\n" + " 5\n" + '\n' + ""; String conclusion = ""; String id = "New_Feature_NegativeDataPropertyAssertion_001"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "Demonstrates use of a negative data property assertion to create a trivial inconsistency based on an example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_NegativeObjectPropertyAssertion_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + '\n' + "\n" + " \n" + "\n" + ""; String conclusion = ""; String id = "New_Feature_NegativeObjectPropertyAssertion_001"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "Demonstrates use of a negative object property assertion to create a trivial inconsistency based on an example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test @Changed public void testNew_Feature_ObjectPropertyChain_001() { String premise = "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + " \n" + " \n" + " \n" + "\n" + " \n" + "\n" + "\n" + " \n" + "\n" + ""; String conclusion = "\n" + "\n" + "\n" + "\n" + ""; String id = "New_Feature_ObjectPropertyChain_001"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "Demonstrates an object property chain in a subproperty axiom based on the example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_ObjectPropertyChain_BJP_004() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; String conclusion = "\n" + '\n' + " \n" + " \n" + " \n" + ""; String id = "New_Feature_ObjectPropertyChain_BJP_004"; TestClasses tc = TestClasses.valueOf("NEGATIVE_IMPL"); String d = "A test of an interaction between a role chain +hierarchy and transitivity axioms."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_ObjectQCR_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + " \n" + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + '\n' + ""; String conclusion = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + " 2\n" + " \n" + "\n" + '\n' + ""; String id = "New_Feature_ObjectQCR_001"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "Demonstrates a qualified minimum cardinality object property restriction based on example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testNew_Feature_ObjectQCR_002() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + " \n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + " 1\n" + " \n" + "\n" + '\n' + "\n" + " \n" + '\n' + ""; String conclusion = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + "\n" + '\n' + ""; String id = "New_Feature_ObjectQCR_002"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "Demonstrates a qualified maximum cardinality object property restriction adapted from example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testFS2RDF_different_individuals_2_ar() { String premise = "\n" + " \n" + " \n" + " "; String conclusion = ""; String id = "FS2RDF_different_individuals_2_ar"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Functional syntax to RDFXML translation of ontology consisting of a 2 argument DifferentIndividuals"; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testFS2RDF_different_individuals_3_ar() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; String conclusion = ""; String id = "FS2RDF_different_individuals_3_ar"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Functional syntax to RDFXML translation of ontology consisting of a 3 argument DifferentIndividuals"; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testFS2RDF_no_builtin_prefixes_ar() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; String conclusion = ""; String id = "FS2RDF_no_builtin_prefixes_ar"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Functional syntax to RDFXML checking that there aren't builtin prefixes for xsd, rdf, rdfs, owl"; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testFS2RDF_same_individual_2_ar() { String premise = "\n" + " \n" + " \n" + " "; String conclusion = ""; String id = "FS2RDF_same_individual_2_ar"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Functional syntax to RDFXML translation of ontology consisting of a 2 argument SameIndividual"; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testbnode2somevaluesfrom() { String premise = "\n" + " \n" + " \n" + " \n" + " \n" + " "; String conclusion = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " "; String id = "bnode2somevaluesfrom"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "Shows that a BNode is an existential variable."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testchain2trans1() { String premise = "\n" + '\n' + " \n" + " \n" + '\n' + " \n" + " \n" + " \n" + " \n" + ""; String conclusion = "\n" + "\n" + " \n" + " \n" + ""; String id = "chain2trans1"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "A role chain can be a synonym for transitivity."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testConsistent_dateTime() { String premise = "Prefix(:=)\n" + "Prefix(xsd:=)\n" + "Ontology(\n" + " Declaration(NamedIndividual(:a))\n" + " Declaration(DataProperty(:dp))\n" + " Declaration(Class(:A))\n" + " SubClassOf(:A \n" + " DataSomeValuesFrom(:dp DatatypeRestriction(\n" + " xsd:dateTime \n" + " xsd:minInclusive \"2008-10-08T20:44:11.656+01:00\"^^xsd:dateTime)\n" + " )\n" + " ) \n" + " SubClassOf(:A \n" + " DataAllValuesFrom(:dp DatatypeRestriction(\n" + " xsd:dateTime \n" + " xsd:maxInclusive \"2008-10-08T20:44:11.656+01:00\"^^xsd:dateTime)\n" + " )\n" + " )\n" + " ClassAssertion(:A :a)\n" + ')'; String conclusion = ""; String id = "Consistent_dateTime"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "The datatype restrictions leave exactly one dateTime value as dp filler for the individual a, so the ontology is consistent."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testconsistent_integer_filler() { String premise = "Prefix(:=)\n" + "Prefix(xsd:=)\n" + "Ontology(\n" + " Declaration(NamedIndividual(:a))\n" + " Declaration(DataProperty(:dp))\n" + " Declaration(Class(:A))\n" + " SubClassOf(:A DataHasValue(:dp \"18\"^^xsd:integer)) \n" + " ClassAssertion(:A :a) \n" + " ClassAssertion(DataAllValuesFrom(:dp xsd:integer) :a)\n" + ')'; String conclusion = ""; String id = "consistent_integer_filler"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "The individual a is in the extension of the class A, which implies that it has a hasAge filler of 18 as integer, which is consistent with the all values from integer assertion for a."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test @Ignore("FaCT++ datatype problems") public void testDatatype_DataComplementOf_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + '\n' + "\n" + "

-1

\n" + "

A string

\n" + '\n' + ""; String conclusion = ""; String id = "Datatype_DataComplementOf_001"; TestClasses tc = TestClasses.valueOf("CONSISTENCY"); String d = "Demonstrates that the complement of a datatype contains literals from other datatypes."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testDifferent_types_in_Datatype_Restrictions_and_Complement() { String premise = "Prefix(:=)\n" + "Prefix(xsd:=)\n" + "Ontology(\n" + " Declaration(NamedIndividual(:a))\n" + " Declaration(DataProperty(:dp))\n" + " Declaration(Class(:A))\n" + " SubClassOf(:A DataAllValuesFrom(:dp \n" + " DataOneOf(\"3\"^^xsd:integer \"4\"^^xsd:int))\n" + " ) \n" + " SubClassOf(:A DataAllValuesFrom(:dp \n" + " DataOneOf(\"2\"^^xsd:short \"3\"^^xsd:integer))\n" + " )\n" + " ClassAssertion(:A :a)\n" + " ClassAssertion(DataSomeValuesFrom(:dp\n" + " DataComplementOf(DataOneOf(\"3\"^^xsd:integer))) :a\n" + " )\n" + ')'; String conclusion = ""; String id = "Different_types_in_Datatype_Restrictions_and_Complement"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "The individual a must have dp fillers that are in the sets {3, 4} and {2, 3} (different types are used, but shorts and ints are integers), but at the same time 3 is not allowed as a dp filler for a, which causes the inconsistency."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testinconsistent_integer_filler() { String premise = "Prefix(:=)\n" + "Prefix(xsd:=)\n" + "Ontology(\n" + " Declaration(NamedIndividual(:a))\n" + " Declaration(DataProperty(:hasAge))\n" + " Declaration(Class(:Eighteen))\n" + " SubClassOf(DataHasValue(:hasAge \"18\"^^xsd:integer) :Eighteen) \n" + " ClassAssertion(DataHasValue(:hasAge \"18\"^^xsd:integer) :a) \n" + " ClassAssertion(ObjectComplementOf(:Eighteen) :a)\n" + ')'; String conclusion = ""; String id = "inconsistent_integer_filler"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "The individual has an asserted hasAge filler of 18 as integer. At the same time it is an instance of the negation of the class Eighteen, which implies that all hasAge fillers for a are not 18."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testDisjointClasses_001() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + '\n' + "\n" + ""; String conclusion = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + "\n" + '\n' + ""; String id = "DisjointClasses_001"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "Demonstrates a binary disjoint classes axiom based on example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testDisjointClasses_002() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + '\n' + "\n" + "\n" + '\n' + ""; String conclusion = ""; String id = "DisjointClasses_002"; TestClasses tc = TestClasses.valueOf("INCONSISTENCY"); String d = "Demonstrates a binary disjoint classes axiom and class assertions causing an inconsistency based on example in the Structural Specification and Functional-Style Syntax document."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } @Test public void testDisjointClasses_003() { String premise = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + '\n' + "\n" + '\n' + ""; String conclusion = "\n" + "\n" + '\n' + "\n" + '\n' + "\n" + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + "\n" + '\n' + "\n" + " \n" + " \n" + " \n" + "\n" + '\n' + ""; String id = "DisjointClasses_003"; TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL"); String d = "A modification of test DisjointClasses-001 to demonstrate a ternary disjoint classes axiom."; JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d); r.setReasonerFactory(factory()); r.run(); } }