How to use id method of junit.runner.Version class

Best junit code snippet using junit.runner.Version.id

Source:OWL2TestCase.java Github

copy

Full Screen

...9import testbase.TestBase;10@SuppressWarnings("javadoc")11public class OWL2TestCase extends TestBase {12    @Test13    public void testowl2_rl_anonymous_individual() {14        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:j.0=\"http://owl2.test/rules#\">\n"15                + "  <owl:Ontology />\n"16                + "  <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/>\n"17                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#I\"/>\n"18                + "  <owl:NamedIndividual>\n"19                + "    <j.0:op rdf:resource=\"http://owl2.test/rules#I\"/></owl:NamedIndividual></rdf:RDF>";20        String conclusion = "";21        String id = "owl2_rl_anonymous_individual";22        TestClasses tc = TestClasses.valueOf("CONSISTENCY");23        String d = "OWL 2 RL allows anonymous individual.";24        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);25        r.setReasonerFactory(factory());26        r.run();27    }28    @Test29    public void testowl2_rl_invalid_leftside_allvaluesfrom() {30        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"31                + "  <owl:Ontology />\n"32                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\"/>\n"33                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/>\n"34                + "  <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/>\n"35                + "  <owl:Restriction>\n"36                + "    <owl:allValuesFrom rdf:resource=\"http://owl2.test/rules#C1\"/>\n"37                + "    <owl:onProperty rdf:resource=\"http://owl2.test/rules#op\"/>\n"38                + "    <rdfs:subClassOf rdf:resource=\"http://owl2.test/rules#C\"/></owl:Restriction></rdf:RDF>";39        String conclusion = "";40        String id = "owl2_rl_invalid_leftside_allvaluesfrom";41        TestClasses tc = TestClasses.valueOf("CONSISTENCY");42        String d = "OWL 2 RL does not allow left side allValuesFrom in a subClassOf axiom.";43        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);44        r.setReasonerFactory(factory());45        r.run();46    }47    @Test48    public void testowl2_rl_invalid_leftside_maxcard() {49        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"50                + "  <owl:Ontology />\n"51                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\"/>\n"52                + "  <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/>\n"53                + "  <owl:Restriction>\n"54                + "    <rdfs:subClassOf rdf:resource=\"http://owl2.test/rules#C\"/>\n"55                + "    <owl:maxCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">2</owl:maxCardinality>\n"56                + "    <owl:onProperty rdf:resource=\"http://owl2.test/rules#op\"/></owl:Restriction></rdf:RDF>";57        String conclusion = "";58        String id = "owl2_rl_invalid_leftside_maxcard";59        TestClasses tc = TestClasses.valueOf("CONSISTENCY");60        String d = "Invalid OWL 2 RL due to maxCardinality usage.";61        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);62        r.setReasonerFactory(factory());63        r.run();64    }65    @Test66    public void testowl2_rl_invalid_oneof() {67        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#\">\n"68                + "  <owl:Ontology />\n"69                + "  <owl:Class rdf:about=\"http://owl2.test/rules#Cb\">\n"70                + "    <owl:oneOf rdf:parseType=\"Collection\">\n"71                + "      <owl:Thing rdf:about=\"http://owl2.test/rules#X\"/>\n"72                + "      <owl:Thing rdf:about=\"http://owl2.test/rules#Y\"/></owl:oneOf></owl:Class>\n"73                + "</rdf:RDF>";74        String conclusion = "";75        String id = "owl2_rl_invalid_oneof";76        TestClasses tc = TestClasses.valueOf("CONSISTENCY");77        String d = "OWL 2 RL does not permit owl:oneOf to define a named class (it can be used as a subclass expression).";78        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);79        r.setReasonerFactory(factory());80        r.run();81    }82    @Test83    public void testowl2_rl_invalid_owlreal() {84        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"85                + "  <owl:Ontology />\n"86                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C_Sub\">\n"87                + "    <rdfs:subClassOf>\n"88                + "      <owl:Restriction>\n"89                + "        <owl:allValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#real\"/>\n"90                + "        <owl:onProperty>\n"91                + "          <owl:DatatypeProperty rdf:about=\"http://owl2.test/rules#p\"/></owl:onProperty></owl:Restriction></rdfs:subClassOf>\n"92                + "  </owl:Class></rdf:RDF>";93        String conclusion = "";94        String id = "owl2_rl_invalid_owlreal";95        TestClasses tc = TestClasses.valueOf("CONSISTENCY");96        String d = "Invalid OWL 2 RL because owl:real is used.";97        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);98        r.setReasonerFactory(factory());99        r.run();100    }101    @Test102    public void testowl2_rl_invalid_rightside_somevaluesfrom() {103        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"104                + "  <owl:Ontology />\n"105                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C_Sub\">\n"106                + "    <rdfs:subClassOf>\n"107                + "      <owl:Restriction>\n"108                + "        <owl:someValuesFrom>\n"109                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/></owl:someValuesFrom>\n"110                + "        <owl:onProperty>\n"111                + "          <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#p\"/></owl:onProperty></owl:Restriction></rdfs:subClassOf>\n"112                + "  </owl:Class></rdf:RDF>";113        String conclusion = "";114        String id = "owl2_rl_invalid_rightside_somevaluesfrom";115        TestClasses tc = TestClasses.valueOf("CONSISTENCY");116        String d = "This is not a valid OWL 2 RL because someValuesFrom shows up on the right hand side of a SubClassOf axiom.";117        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);118        r.setReasonerFactory(factory());119        r.run();120    }121    @Test122    public void testowl2_rl_invalid_rightside_unionof() {123        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"124                + "  <owl:Ontology />\n"125                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C_Sub\">\n"126                + "    <rdfs:subClassOf>\n"127                + "      <owl:Class>\n"128                + "        <owl:unionOf rdf:parseType=\"Collection\">\n"129                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/>\n"130                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C2\"/></owl:unionOf></owl:Class></rdfs:subClassOf>\n"131                + "  </owl:Class></rdf:RDF>";132        String conclusion = "";133        String id = "owl2_rl_invalid_rightside_unionof";134        TestClasses tc = TestClasses.valueOf("CONSISTENCY");135        String d = "Incorrect OWL 2 RL syntax. unionOf shows up at the right hand side of a SubClassOf axiom.";136        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);137        r.setReasonerFactory(factory());138        r.run();139    }140    @Test141    public void testowl2_rl_invalid_unionof() {142        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#\">\n"143                + "  <owl:Ontology />\n"144                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\">\n"145                + "    <owl:unionOf rdf:parseType=\"Collection\">\n"146                + "      <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/>\n"147                + "      <owl:Class rdf:about=\"http://owl2.test/rules#C2\"/></owl:unionOf></owl:Class>\n"148                + "</rdf:RDF>";149        String conclusion = "";150        String id = "owl2_rl_invalid_unionof";151        TestClasses tc = TestClasses.valueOf("CONSISTENCY");152        String d = "OWL 2 RL does not allow owl:unionOf to define a named class (it can be used as a subclass expression).";153        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);154        r.setReasonerFactory(factory());155        r.run();156    }157    @Test158    public void testowl2_rl_rules_fp_differentFrom() {159        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:j.0=\"http://owl2.test/rules/\">\n"160                + "  <owl:Ontology />\n"161                + "  <owl:FunctionalProperty rdf:about=\"http://owl2.test/rules/fp\">\n"162                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/></owl:FunctionalProperty>\n"163                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y2\">\n"164                + "    <j.0:fp>\n"165                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X2\"/></j.0:fp></owl:NamedIndividual>\n"166                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X1\">\n"167                + "    <owl:differentFrom rdf:resource=\"http://owl2.test/rules/X2\"/></owl:NamedIndividual>\n"168                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y1\">\n"169                + "    <j.0:fp rdf:resource=\"http://owl2.test/rules/X1\"/></owl:NamedIndividual></rdf:RDF>";170        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#\">\n"171                + "  <owl:Ontology />\n"172                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y2\"/>\n"173                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y1\">\n"174                + "    <owl:differentFrom rdf:resource=\"http://owl2.test/rules/Y2\"/></owl:NamedIndividual></rdf:RDF>";175        String id = "owl2_rl_rules_fp_differentFrom";176        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");177        String d = "This test checks the interaction between an OWL functional property and differentFrom assertions.";178        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);179        r.setReasonerFactory(factory());180        r.run();181    }182    @Test183    public void testowl2_rl_rules_ifp_differentFrom() {184        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:j.0=\"http://owl2.test/rules/\">\n"185                + "  <owl:Ontology />\n"186                + "  <owl:InverseFunctionalProperty rdf:about=\"http://owl2.test/rules/ifp\">\n"187                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/></owl:InverseFunctionalProperty>\n"188                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y2\">\n"189                + "    <j.0:ifp>\n"190                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X2\"/></j.0:ifp></owl:NamedIndividual>\n"191                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X1\"/>\n"192                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y1\">\n"193                + "    <owl:differentFrom rdf:resource=\"http://owl2.test/rules/Y2\"/>\n"194                + "    <j.0:ifp rdf:resource=\"http://owl2.test/rules/X1\"/></owl:NamedIndividual></rdf:RDF>";195        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#\">\n"196                + "  <owl:Ontology />\n"197                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X1\">\n"198                + "    <owl:differentFrom>\n"199                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X2\"/></owl:differentFrom></owl:NamedIndividual>\n"200                + "</rdf:RDF>";201        String id = "owl2_rl_rules_ifp_differentFrom";202        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");203        String d = "This test checks the interaction between inverse functional property and differentFrom assertions.";204        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);205        r.setReasonerFactory(factory());206        r.run();207    }208    @Test209    public void testowl2_rl_valid_mincard() {210        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:j.0=\"http://owl2.test/rules#\">\n"211                + "  <owl:Ontology rdf:about=\"http://org.semanticweb.ontologies/Ontology1232054810511161000\"/>\n"212                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\">\n"213                + "    <rdfs:subClassOf>\n"214                + "      <owl:Restriction>\n"215                + "        <owl:minCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">1</owl:minCardinality>\n"216                + "        <owl:onProperty>\n"217                + "          <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#OP\"/></owl:onProperty></owl:Restriction></rdfs:subClassOf></owl:Class>\n"218                + "  <owl:Class rdf:about=\"http://www.w3.org/2002/07/owl#Thing\"/>\n"219                + "  <j.0:C rdf:about=\"http://owl2.test/rules#c\">\n"220                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/></j.0:C></rdf:RDF>";221        String conclusion = "";222        String id = "owl2_rl_valid_mincard";223        TestClasses tc = TestClasses.valueOf("CONSISTENCY");224        String d = "OWL 2 RL does not allow min cardinality";225        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);226        r.setReasonerFactory(factory());227        r.run();228    }229    @Test230    public void testowl2_rl_valid_oneof() {231        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"232                + "  <owl:Ontology />\n"233                + "  <owl:Class rdf:about=\"http://owl2.test/rules#Cb\"/>\n"234                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#X\"/>\n"235                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#Y\"/>\n"236                + "  <rdf:Description>\n"237                + "    <rdfs:subClassOf rdf:resource=\"http://owl2.test/rules#Cb\"/>\n"238                + "    <owl:oneOf rdf:parseType=\"Collection\">\n"239                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#X\"/>\n"240                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#Y\"/></owl:oneOf></rdf:Description>\n"241                + "</rdf:RDF>";242        String conclusion = "";243        String id = "owl2_rl_valid_oneof";244        TestClasses tc = TestClasses.valueOf("CONSISTENCY");245        String d = "A valid usage of oneOf in OWL 2 RL";246        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);247        r.setReasonerFactory(factory());248        r.run();249    }250    @Test251    public void testowl2_rl_valid_rightside_allvaluesfrom() {252        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"253                + "  <owl:Ontology />\n"254                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\">\n"255                + "    <rdfs:subClassOf>\n"256                + "      <owl:Restriction>\n"257                + "        <owl:onProperty>\n"258                + "          <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/></owl:onProperty>\n"259                + "        <owl:allValuesFrom>\n"260                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/></owl:allValuesFrom></owl:Restriction></rdfs:subClassOf>\n"261                + "  </owl:Class></rdf:RDF>";262        String conclusion = "";263        String id = "owl2_rl_valid_rightside_allvaluesfrom";264        TestClasses tc = TestClasses.valueOf("CONSISTENCY");265        String d = "Valid RL usage of allValuesFrom.";266        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);267        r.setReasonerFactory(factory());268        r.run();269    }270    @Test271    public void testNew_Feature_AnnotationAnnotations_001() {272        String premise = "<?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#\" xmlns:rdfs= \"http://www.w3.org/2000/01/rdf-schema#\">\n"275                + '\n'276                + "<owl:Ontology rdf:about=\"http://example.org/\"/>\n"277                + '\n'278                + "<rdf:Description rdf:about=\"http://example.org/\">\n"279                + "  <rdfs:label>An example ontology</rdfs:label></rdf:Description>\n"280                + '\n'281                + "<owl:Annotation>\n"282                + "  <owl:annotatedSource rdf:resource=\"http://example.org/\" />\n"283                + "  <owl:annotatedProperty rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\" />\n"284                + "  <owl:annotatedTarget>An example ontology</owl:annotatedTarget>\n"285                + "  <author>Mike Smith</author>\n" + "</owl:Annotation>\n"286                + '\n' + "<owl:AnnotationProperty rdf:about=\"author\" />\n"287                + "<owl:NamedIndividual rdf:about=\"i\" />\n" + '\n'288                + "</rdf:RDF>";289        String conclusion = "";290        String id = "New_Feature_AnnotationAnnotations_001";291        TestClasses tc = TestClasses.valueOf("CONSISTENCY");292        String d = "Demonstrates annotation of an annotation.  Adapted from an example in the Mapping to RDF Graphs document.";293        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);294        r.setReasonerFactory(factory());295        r.run();296    }297    @Test298    public void testNew_Feature_AsymmetricProperty_001() {299        String premise = "<?xml version=\"1.0\"?>\n"300                + "<rdf:RDF\n"301                + "  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"302                + '\n' + "<owl:Ontology/>\n" + '\n'303                + "<owl:ObjectProperty rdf:about=\"parentOf\" />\n"304                + "<owl:AsymmetricProperty rdf:about=\"parentOf\" />\n" + '\n'305                + "<rdf:Description rdf:about=\"Peter\">\n"306                + "  <parentOf rdf:resource=\"Stewie\" />\n"307                + "</rdf:Description>\n" + '\n'308                + "<rdf:Description rdf:about=\"Stewie\">\n"309                + "  <parentOf rdf:resource=\"Peter\" />\n"310                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";311        String conclusion = "";312        String id = "New_Feature_AsymmetricProperty_001";313        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");314        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.";315        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);316        r.setReasonerFactory(factory());317        r.run();318    }319    @Test320    public void testNew_Feature_AxiomAnnotations_001() {321        String premise = "<?xml version=\"1.0\"?>\n"322                + "<rdf:RDF\n"323                + "  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"324                + '\n'325                + "<owl:Ontology/>\n"326                + '\n'327                + "<owl:Class rdf:about=\"Child\" />\n"328                + "<owl:Class rdf:about=\"Person\" />\n"329                + '\n'330                + "<rdf:Description rdf:about=\"Child\">\n"331                + "  <rdfs:subClassOf rdf:resource=\"Person\" /></rdf:Description>\n"332                + '\n'333                + "<owl:Axiom>\n"334                + "  <owl:annotatedSource rdf:resource=\"Child\" />\n"335                + "  <owl:annotatedProperty rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#subClassOf\" />\n"336                + "  <owl:annotatedTarget rdf:resource=\"Person\" />\n"337                + "  <rdfs:comment>Children are people.</rdfs:comment></owl:Axiom>\n"338                + '\n' + "</rdf:RDF>";339        String conclusion = "";340        String id = "New_Feature_AxiomAnnotations_001";341        TestClasses tc = TestClasses.valueOf("CONSISTENCY");342        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.";343        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);344        r.setReasonerFactory(factory());345        r.run();346    }347    @Test348    public void testNew_Feature_BottomDataProperty_001() {349        String premise = "<?xml version=\"1.0\"?>\n"350                + "<rdf:RDF\n"351                + "  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"352                + '\n'353                + "<owl:Ontology/>\n"354                + '\n'355                + "<rdf:Description rdf:about=\"i\">\n"356                + "  <rdf:type>\n"357                + "    <owl:Restriction>\n"358                + "      <owl:onProperty rdf:resource=\"http://www.w3.org/2002/07/owl#bottomDataProperty\" />\n"359                + "      <owl:someValuesFrom rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\" /></owl:Restriction></rdf:type>\n"360                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";361        String conclusion = "";362        String id = "New_Feature_BottomDataProperty_001";363        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");364        String d = "Demonstrates use of the bottom data property to create an inconsistency.";365        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);366        r.setReasonerFactory(factory());367        r.run();368    }369    @Test370    public void testNew_Feature_BottomObjectProperty_001() {371        String premise = "<?xml version=\"1.0\"?>\n"372                + "<rdf:RDF\n"373                + "  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"374                + '\n'375                + "<owl:Ontology/>\n"376                + '\n'377                + "<rdf:Description rdf:about=\"i\">\n"378                + "  <rdf:type>\n"379                + "    <owl:Restriction>\n"380                + "      <owl:onProperty rdf:resource=\"http://www.w3.org/2002/07/owl#bottomObjectProperty\" />\n"381                + "      <owl:someValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\" /></owl:Restriction></rdf:type>\n"382                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";383        String conclusion = "";384        String id = "New_Feature_BottomObjectProperty_001";385        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");386        String d = "Demonstrates use of the bottom object property to create an inconsistency.";387        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);388        r.setReasonerFactory(factory());389        r.run();390    }391    @Test392    public void testNew_Feature_DisjointObjectProperties_001() {393        String premise = "<?xml version=\"1.0\"?>\n"394                + "<rdf:RDF\n"395                + "  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"396                + '\n'397                + "<owl:Ontology/>\n"398                + '\n'399                + "<owl:ObjectProperty rdf:about=\"hasFather\" />\n"400                + "<owl:ObjectProperty rdf:about=\"hasMother\" />\n"401                + '\n'402                + "<rdf:Description rdf:about=\"hasFather\">\n"403                + "  <owl:propertyDisjointWith rdf:resource=\"hasMother\" /></rdf:Description>\n"404                + '\n' + "<rdf:Description rdf:about=\"Stewie\">\n"405                + "  <hasFather rdf:resource=\"Peter\" />\n"406                + "</rdf:Description>\n" + '\n'407                + "<rdf:Description rdf:about=\"Stewie\">\n"408                + "  <hasMother rdf:resource=\"Lois\" />\n"409                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";410        String conclusion = "<?xml version=\"1.0\"?>\n"411                + "<rdf:RDF\n"412                + "  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"413                + '\n'414                + "<owl:Ontology/>\n"415                + '\n'416                + "<rdf:Description rdf:about=\"Peter\">\n"417                + "  <owl:differentFrom rdf:resource=\"Lois\" /></rdf:Description>\n"418                + '\n' + "</rdf:RDF>";419        String id = "New_Feature_DisjointObjectProperties_001";420        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");421        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.";422        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);423        r.setReasonerFactory(factory());424        r.run();425    }426    @Test427    public void testNew_Feature_DisjointObjectProperties_002() {428        String premise = "<?xml version=\"1.0\"?>\n"429                + "<rdf:RDF\n"430                + "  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"431                + '\n'432                + "<owl:Ontology/>\n"433                + '\n'434                + "<owl:ObjectProperty rdf:about=\"hasFather\" />\n"435                + "<owl:ObjectProperty rdf:about=\"hasMother\" />\n"436                + "<owl:ObjectProperty rdf:about=\"hasChild\" />\n"437                + '\n'438                + "<owl:AllDisjointProperties>\n"439                + "  <owl:members rdf:parseType=\"Collection\">\n"440                + "    <rdf:Description rdf:about=\"hasFather\" />\n"441                + "    <rdf:Description rdf:about=\"hasMother\" />\n"442                + "    <rdf:Description rdf:about=\"hasChild\" /></owl:members></owl:AllDisjointProperties>\n"443                + '\n'444                + "<rdf:Description rdf:about=\"Stewie\">\n"445                + "  <hasFather rdf:resource=\"Peter\" />\n"446                + "</rdf:Description>\n"447                + '\n'448                + "<rdf:Description rdf:about=\"Stewie\">\n"449                + "  <hasMother rdf:resource=\"Lois\" />\n"450                + "</rdf:Description>\n"451                + '\n'452                + "<rdf:Description rdf:about=\"Stewie\">\n"453                + "  <hasChild rdf:resource=\"StewieJr\" />\n"454                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";455        String conclusion = "<?xml version=\"1.0\"?>\n"456                + "<rdf:RDF\n"457                + "  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"458                + '\n'459                + "<owl:Ontology/>\n"460                + '\n'461                + "<owl:AllDifferent>\n"462                + "  <owl:distinctMembers rdf:parseType=\"Collection\">\n"463                + "    <rdf:Description rdf:about=\"Peter\" />\n"464                + "    <rdf:Description rdf:about=\"Lois\" />\n"465                + "    <rdf:Description rdf:about=\"StewieJr\" /></owl:distinctMembers></owl:AllDifferent>\n"466                + '\n' + "</rdf:RDF>";467        String id = "New_Feature_DisjointObjectProperties_002";468        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");469        String d = "A modification of test New-Feature-DisjointObjectProperties-001 to demonstrate a ternary disjoint object properties axiom.";470        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);471        r.setReasonerFactory(factory());472        r.run();473    }474    @Test475    public void testNew_Feature_DisjointUnion_001() {476        String premise = "<?xml version=\"1.0\"?>\n"477                + "<rdf:RDF\n"478                + "  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"479                + '\n'480                + "<owl:Ontology/>\n"481                + '\n'482                + "<owl:Class rdf:about=\"Child\" />\n"483                + "<owl:Class rdf:about=\"Boy\" />\n"484                + "<owl:Class rdf:about=\"Girl\" />\n"485                + '\n'486                + "<rdf:Description rdf:about=\"Child\">\n"487                + "  <owl:disjointUnionOf rdf:parseType=\"Collection\">\n"488                + "    <rdf:Description rdf:about=\"Boy\" />\n"489                + "    <rdf:Description rdf:about=\"Girl\" /></owl:disjointUnionOf></rdf:Description>\n"490                + '\n'491                + "<Child rdf:about=\"Stewie\" />\n"492                + "<rdf:Description rdf:about=\"Stewie\">\n"493                + "  <rdf:type>\n"494                + "    <owl:Class>\n"495                + "      <owl:complementOf rdf:resource=\"Girl\" /></owl:Class></rdf:type>\n"496                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";497        String conclusion = "<?xml version=\"1.0\"?>\n"498                + "<rdf:RDF\n"499                + "  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"500                + '\n' + "<owl:Ontology/>\n" + '\n'501                + "<owl:Class rdf:about=\"Boy\" />\n" + '\n'502                + "<Boy rdf:about=\"Stewie\" />\n" + '\n' + "</rdf:RDF>";503        String id = "New_Feature_DisjointUnion_001";504        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");505        String d = "Demonstrates a disjoint union axiom based on the example in the Structural Specification and Functional-Style Syntax document.";506        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);507        r.setReasonerFactory(factory());508        r.run();509    }510    @Test511    public void testNew_Feature_IrreflexiveProperty_001() {512        String premise = "<?xml version=\"1.0\"?>\n"513                + "<rdf:RDF\n"514                + "  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"515                + '\n' + "<owl:Ontology/>\n" + '\n'516                + "<owl:ObjectProperty rdf:about=\"marriedTo\" />\n"517                + "<owl:IrreflexiveProperty rdf:about=\"marriedTo\" />\n"518                + '\n' + "<rdf:Description rdf:about=\"Peter\">\n"519                + "  <marriedTo rdf:resource=\"Peter\" />\n"520                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";521        String conclusion = "";522        String id = "New_Feature_IrreflexiveProperty_001";523        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");524        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.";525        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);526        r.setReasonerFactory(factory());527        r.run();528    }529    @Test530    public void testNew_Feature_NegativeDataPropertyAssertion_001() {531        String premise = "<?xml version=\"1.0\"?>\n"532                + "<rdf:RDF\n"533                + "  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"534                + '\n'535                + "<owl:Ontology/>\n"536                + '\n'537                + "<owl:DatatypeProperty rdf:about=\"hasAge\" />\n"538                + '\n'539                + "<owl:NegativePropertyAssertion>\n"540                + "  <owl:sourceIndividual rdf:resource=\"Meg\" />\n"541                + "  <owl:assertionProperty rdf:resource=\"hasAge\" />\n"542                + "  <owl:targetValue rdf:datatype=\"http://www.w3.org/2001/XMLSchema#integer\">5</owl:targetValue></owl:NegativePropertyAssertion>\n"543                + '\n'544                + "<rdf:Description rdf:about=\"Meg\">\n"545                + "  <hasAge rdf:datatype=\"http://www.w3.org/2001/XMLSchema#integer\">5</hasAge></rdf:Description>\n"546                + '\n' + "</rdf:RDF>";547        String conclusion = "";548        String id = "New_Feature_NegativeDataPropertyAssertion_001";549        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");550        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.";551        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);552        r.setReasonerFactory(factory());553        r.run();554    }555    @Test556    public void testNew_Feature_NegativeObjectPropertyAssertion_001() {557        String premise = "<?xml version=\"1.0\"?>\n"558                + "<rdf:RDF\n"559                + "  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"560                + '\n'561                + "<owl:Ontology/>\n"562                + '\n'563                + "<owl:ObjectProperty rdf:about=\"hasSon\" />\n"564                + '\n'565                + "<owl:NegativePropertyAssertion>\n"566                + "  <owl:sourceIndividual rdf:resource=\"Peter\" />\n"567                + "  <owl:assertionProperty rdf:resource=\"hasSon\" />\n"568                + "  <owl:targetIndividual rdf:resource=\"Meg\" /></owl:NegativePropertyAssertion>\n"569                + '\n' + "<rdf:Description rdf:about=\"Peter\">\n"570                + "  <hasSon rdf:resource=\"Meg\" />\n"571                + "</rdf:Description>\n" + "</rdf:RDF>";572        String conclusion = "";573        String id = "New_Feature_NegativeObjectPropertyAssertion_001";574        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");575        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.";576        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);577        r.setReasonerFactory(factory());578        r.run();579    }580    @Test581    @Changed582    public void testNew_Feature_ObjectPropertyChain_001() {583        String premise = "<?xml version=\"1.0\"?>\n"584                + "<rdf:RDF\n"585                + "  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"586                + "<owl:Ontology/><owl:ObjectProperty rdf:about=\"hasMother\" />\n"587                + "<owl:ObjectProperty rdf:about=\"hasSister\" />\n"588                + "<owl:ObjectProperty rdf:about=\"hasAunt\" />\n"589                + "<rdf:Description rdf:about=\"hasAunt\">\n"590                + "  <owl:propertyChainAxiom rdf:parseType=\"Collection\">\n"591                + "    <rdf:Description rdf:about=\"hasMother\" />\n"592                + "    <rdf:Description rdf:about=\"hasSister\" /></owl:propertyChainAxiom></rdf:Description>\n"593                + "<rdf:Description rdf:about=\"Stewie\">\n"594                + "  <hasMother rdf:resource=\"Lois\" />\n"595                + "</rdf:Description>\n"596                + "<rdf:Description rdf:about=\"Lois\">\n"597                + "  <hasSister rdf:resource=\"Carol\" />\n"598                + "</rdf:Description>\n" + "</rdf:RDF>";599        String conclusion = "<?xml version=\"1.0\"?>\n"600                + "<rdf:RDF\n"601                + "  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"602                + "<owl:Ontology/>\n"603                + "<owl:ObjectProperty rdf:about=\"hasAunt\" />\n"604                + "<rdf:Description rdf:about=\"Stewie\"><hasAunt rdf:resource=\"Carol\" /></rdf:Description></rdf:RDF>";605        String id = "New_Feature_ObjectPropertyChain_001";606        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");607        String d = "Demonstrates an object property chain in a subproperty axiom based on the example in the Structural Specification and Functional-Style Syntax document.";608        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);609        r.setReasonerFactory(factory());610        r.run();611    }612    @Test613    public void testNew_Feature_ObjectPropertyChain_BJP_004() {614        String premise = "<?xml version=\"1.0\"?>\n"615                + "<rdf:RDF\n"616                + "    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"617                + '\n'618                + "<owl:Ontology/>\n"619                + '\n'620                + "    <rdf:Description rdf:about=\"p\">\n"621                + "        <owl:propertyChainAxiom rdf:parseType=\"Collection\">\n"622                + "            <owl:ObjectProperty rdf:about=\"p\"/>\n"623                + "            <owl:ObjectProperty rdf:about=\"q\"/></owl:propertyChainAxiom></rdf:Description>\n"624                + "    \n" + "    <rdf:Description rdf:about=\"a\">\n"625                + "        <q rdf:resource=\"b\"/>\n"626                + "    </rdf:Description>\n" + "    \n"627                + "    <rdf:Description rdf:about=\"b\">\n"628                + "        <q rdf:resource=\"c\"/>\n"629                + "    </rdf:Description>\n" + "   \n" + "</rdf:RDF>";630        String conclusion = "<rdf:RDF\n"631                + "    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"632                + '\n' + "   <owl:Ontology/>\n"633                + "   <owl:ObjectProperty rdf:about=\"p\"/>\n"634                + "   <owl:TransitiveProperty rdf:about=\"p\"/>\n"635                + "</rdf:RDF>";636        String id = "New_Feature_ObjectPropertyChain_BJP_004";637        TestClasses tc = TestClasses.valueOf("NEGATIVE_IMPL");638        String d = "A test of an interaction between a role chain +hierarchy and transitivity axioms.";639        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);640        r.setReasonerFactory(factory());641        r.run();642    }643    @Test644    public void testNew_Feature_ObjectQCR_001() {645        String premise = "<?xml version=\"1.0\"?>\n"646                + "<rdf:RDF\n"647                + "  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"648                + '\n'649                + "<owl:Ontology/>\n"650                + '\n'651                + "<owl:ObjectProperty rdf:about=\"fatherOf\" />\n"652                + "<owl:Class rdf:about=\"Man\" />\n"653                + '\n'654                + "<rdf:Description rdf:about=\"Peter\">\n"655                + "  <fatherOf rdf:resource=\"Stewie\" />\n"656                + "  <fatherOf rdf:resource=\"Chris\" />\n"657                + "</rdf:Description>\n"658                + '\n'659                + "<Man rdf:about=\"Stewie\" />\n"660                + "<Man rdf:about=\"Chris\" />\n"661                + '\n'662                + "<rdf:Description rdf:about=\"Stewie\">\n"663                + "  <owl:differentFrom rdf:resource=\"Chris\" /></rdf:Description>\n"664                + '\n' + "</rdf:RDF>";665        String conclusion = "<?xml version=\"1.0\"?>\n"666                + "<rdf:RDF\n"667                + "  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"668                + '\n'669                + "<owl:Ontology/>\n"670                + '\n'671                + "<owl:ObjectProperty rdf:about=\"fatherOf\" />\n"672                + "<owl:Class rdf:about=\"Man\" />\n"673                + '\n'674                + "<rdf:Description rdf:about=\"Peter\">\n"675                + "  <rdf:type>\n"676                + "    <owl:Restriction>\n"677                + "      <owl:onProperty rdf:resource=\"fatherOf\" />\n"678                + "      <owl:minQualifiedCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">2</owl:minQualifiedCardinality>\n"679                + "      <owl:onClass rdf:resource=\"Man\" /></owl:Restriction></rdf:type>\n"680                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";681        String id = "New_Feature_ObjectQCR_001";682        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");683        String d = "Demonstrates a qualified minimum cardinality object property restriction based on example in the Structural Specification and Functional-Style Syntax document.";684        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);685        r.setReasonerFactory(factory());686        r.run();687    }688    @Test689    public void testNew_Feature_ObjectQCR_002() {690        String premise = "<?xml version=\"1.0\"?>\n"691                + "<rdf:RDF\n"692                + "  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"693                + '\n'694                + "<owl:Ontology/>\n"695                + '\n'696                + "<owl:ObjectProperty rdf:about=\"fatherOf\" />\n"697                + "<owl:Class rdf:about=\"Woman\" />\n"698                + '\n'699                + "<rdf:Description rdf:about=\"Peter\">\n"700                + "  <fatherOf rdf:resource=\"Stewie\" />\n"701                + "  <fatherOf rdf:resource=\"Meg\" /></rdf:Description>\n"702                + '\n'703                + "<Woman rdf:about=\"Meg\" />\n"704                + '\n'705                + "<rdf:Description rdf:about=\"Peter\">\n"706                + "  <rdf:type>\n"707                + "    <owl:Restriction>\n"708                + "      <owl:onProperty rdf:resource=\"fatherOf\" />\n"709                + "      <owl:maxQualifiedCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">1</owl:maxQualifiedCardinality>\n"710                + "      <owl:onClass rdf:resource=\"Woman\" /></owl:Restriction></rdf:type>\n"711                + "</rdf:Description>\n"712                + '\n'713                + "<rdf:Description rdf:about=\"Stewie\">\n"714                + "  <owl:differentFrom rdf:resource=\"Meg\" /></rdf:Description>\n"715                + '\n' + "</rdf:RDF>";716        String conclusion = "<?xml version=\"1.0\"?>\n"717                + "<rdf:RDF\n"718                + "  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"719                + '\n'720                + "<owl:Ontology/>\n"721                + '\n'722                + "<owl:Class rdf:about=\"Woman\" />\n"723                + '\n'724                + "<rdf:Description rdf:about=\"Stewie\">\n"725                + "  <rdf:type>\n"726                + "    <owl:Class>\n"727                + "      <owl:complementOf rdf:resource=\"Woman\" /></owl:Class></rdf:type>\n"728                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";729        String id = "New_Feature_ObjectQCR_002";730        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");731        String d = "Demonstrates a qualified maximum cardinality object property restriction adapted from example in the Structural Specification and Functional-Style Syntax document.";732        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);733        r.setReasonerFactory(factory());734        r.run();735    }736    @Test737    public void testFS2RDF_different_individuals_2_ar() {738        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"739                + "  <owl:Ontology/>\n"740                + "  <rdf:Description rdf:about=\"http://example.org/a\">\n"741                + "    <owl:differentFrom rdf:resource=\"http://example.org/b\"/></rdf:Description></rdf:RDF>";742        String conclusion = "";743        String id = "FS2RDF_different_individuals_2_ar";744        TestClasses tc = TestClasses.valueOf("CONSISTENCY");745        String d = "Functional syntax to RDFXML translation of ontology consisting of a 2 argument DifferentIndividuals";746        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);747        r.setReasonerFactory(factory());748        r.run();749    }750    @Test751    public void testFS2RDF_different_individuals_3_ar() {752        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"753                + "  <owl:Ontology/>\n"754                + "  <owl:AllDifferent>\n"755                + "    <owl:distinctMembers rdf:parseType=\"Collection\">\n"756                + "      <rdf:Description rdf:about=\"http://example.org/a\"/>\n"757                + "      <rdf:Description rdf:about=\"http://example.org/b\"/>\n"758                + "      <rdf:Description rdf:about=\"http://example.org/c\"/></owl:distinctMembers></owl:AllDifferent>\n"759                + "</rdf:RDF>";760        String conclusion = "";761        String id = "FS2RDF_different_individuals_3_ar";762        TestClasses tc = TestClasses.valueOf("CONSISTENCY");763        String d = "Functional syntax to RDFXML translation of ontology consisting of a 3 argument DifferentIndividuals";764        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);765        r.setReasonerFactory(factory());766        r.run();767    }768    @Test769    public void testFS2RDF_no_builtin_prefixes_ar() {770        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"771                + "  <owl:Ontology/>\n"772                + "  <rdf:Description rdf:about=\"http://example.org/d\">\n"773                + "    <owl:sameAs rdf:resource=\"http://example.org/e\"/></rdf:Description>\n"774                + "  <rdf:Description rdf:about=\"http://example.org/a\">\n"775                + "    <owl:sameAs>\n"776                + "      <rdf:Description rdf:about=\"http://example.org/b\">\n"777                + "        <owl:sameAs>\n"778                + "          <rdf:Description rdf:about=\"http://example.org/c\">\n"779                + "            <owl:sameAs rdf:resource=\"http://example.org/d\"/></rdf:Description></owl:sameAs></rdf:Description></owl:sameAs></rdf:Description>\n"780                + "</rdf:RDF>";781        String conclusion = "";782        String id = "FS2RDF_no_builtin_prefixes_ar";783        TestClasses tc = TestClasses.valueOf("CONSISTENCY");784        String d = "Functional syntax to RDFXML checking that there aren't builtin prefixes for xsd, rdf, rdfs, owl";785        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);786        r.setReasonerFactory(factory());787        r.run();788    }789    @Test790    public void testFS2RDF_same_individual_2_ar() {791        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"792                + "  <owl:Ontology/>\n"793                + "  <rdf:Description rdf:about=\"http://example.org/a\">\n"794                + "    <owl:sameAs rdf:resource=\"http://example.org/b\"/></rdf:Description></rdf:RDF>";795        String conclusion = "";796        String id = "FS2RDF_same_individual_2_ar";797        TestClasses tc = TestClasses.valueOf("CONSISTENCY");798        String d = "Functional syntax to RDFXML translation of ontology consisting of a 2 argument SameIndividual";799        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);800        r.setReasonerFactory(factory());801        r.run();802    }803    @Test804    public void testbnode2somevaluesfrom() {805        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:ex=\"http://example.org/\"\n"806                + "  xml:base=\"http://example.org/\">\n"807                + "  <owl:Ontology/>\n"808                + "  <owl:ObjectProperty rdf:about=\"p\"/>\n"809                + "   \n"810                + "  <owl:Thing rdf:about=\"a\">\n"811                + "    <ex:p><rdf:Description rdf:nodeID=\"x\"/></ex:p> </owl:Thing></rdf:RDF>";812        String conclusion = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"   xmlns:ex=\"http://example.org/\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\n"813                + "          xml:base=\"http://example.org/\">\n"814                + "  <owl:Ontology/>\n"815                + "  <owl:ObjectProperty rdf:about=\"p\"/>\n"816                + "  <owl:Thing rdf:about=\"a\">\n"817                + "        <rdf:type>\n"818                + "            <owl:Restriction>\n"819                + "                <owl:onProperty rdf:resource=\"p\"/>\n"820                + "                <owl:someValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/></owl:Restriction></rdf:type></owl:Thing></rdf:RDF>";821        String id = "bnode2somevaluesfrom";822        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");823        String d = "Shows that a BNode is an existential variable.";824        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);825        r.setReasonerFactory(factory());826        r.run();827    }828    @Test829    public void testchain2trans1() {830        String premise = "<rdf:RDF \n"831                + "     xml:base=\"http://example.org/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"832                + '\n'833                + "    <owl:Ontology rdf:about=\"http://owl.semanticweb.org/page/Special:GetOntology/Chain2trans?m=p\"/>\n"834                + "    <owl:ObjectProperty rdf:about=\"#p\"/>\n"835                + '\n'836                + "    <rdf:Description rdf:about=\"#p\">\n"837                + "        <owl:propertyChainAxiom rdf:parseType=\"Collection\">\n"838                + "            <rdf:Description rdf:about=\"#p\"/>\n"839                + "            <rdf:Description rdf:about=\"#p\"/></owl:propertyChainAxiom></rdf:Description>\n"840                + "</rdf:RDF>";841        String conclusion = "<?xml version=\"1.0\"?>\n"842                + "<rdf:RDF \n"843                + "     xml:base=\"http://example.org/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"844                + "    <owl:Ontology rdf:about=\"http://owl.semanticweb.org/page/Special:GetOntology/Chain2trans?m=c\"/>\n"845                + "    <owl:TransitiveProperty rdf:about=\"#p\"/>\n"846                + "</rdf:RDF>";847        String id = "chain2trans1";848        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");849        String d = "A role chain can be a synonym for transitivity.";850        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);851        r.setReasonerFactory(factory());852        r.run();853    }854    @Test855    public void testConsistent_dateTime() {856        String premise = "Prefix(:=<http://example.org/>)\n"857                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"858                + "Ontology(\n"859                + "  Declaration(NamedIndividual(:a))\n"860                + "  Declaration(DataProperty(:dp))\n"861                + "  Declaration(Class(:A))\n"862                + "  SubClassOf(:A \n"863                + "    DataSomeValuesFrom(:dp DatatypeRestriction(\n"864                + "      xsd:dateTime \n"865                + "      xsd:minInclusive \"2008-10-08T20:44:11.656+01:00\"^^xsd:dateTime)\n"866                + "    )\n"867                + "  ) \n"868                + "  SubClassOf(:A \n"869                + "    DataAllValuesFrom(:dp DatatypeRestriction(\n"870                + "      xsd:dateTime \n"871                + "      xsd:maxInclusive \"2008-10-08T20:44:11.656+01:00\"^^xsd:dateTime)\n"872                + "    )\n" + "  )\n" + "  ClassAssertion(:A :a)\n" + ')';873        String conclusion = "";874        String id = "Consistent_dateTime";875        TestClasses tc = TestClasses.valueOf("CONSISTENCY");876        String d = "The datatype restrictions leave exactly one dateTime value as dp filler for the individual a, so the ontology is consistent.";877        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);878        r.setReasonerFactory(factory());879        r.run();880    }881    @Test882    public void testconsistent_integer_filler() {883        String premise = "Prefix(:=<http://example.org/>)\n"884                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"885                + "Ontology(\n" + "  Declaration(NamedIndividual(:a))\n"886                + "  Declaration(DataProperty(:dp))\n"887                + "  Declaration(Class(:A))\n"888                + "  SubClassOf(:A DataHasValue(:dp \"18\"^^xsd:integer)) \n"889                + "  ClassAssertion(:A :a) \n"890                + "  ClassAssertion(DataAllValuesFrom(:dp xsd:integer) :a)\n"891                + ')';892        String conclusion = "";893        String id = "consistent_integer_filler";894        TestClasses tc = TestClasses.valueOf("CONSISTENCY");895        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.";896        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);897        r.setReasonerFactory(factory());898        r.run();899    }900    @Test901    @Ignore("FaCT++ datatype problems")902    public void testDatatype_DataComplementOf_001() {903        String premise = "<?xml version=\"1.0\"?>\n"904                + "<rdf:RDF\n"905                + "  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"906                + '\n'907                + "<owl:Ontology/>\n"908                + '\n'909                + "<owl:DatatypeProperty rdf:about=\"p\" />\n"910                + '\n'911                + "<rdf:Description rdf:about=\"p\">\n"912                + "  <rdfs:range>\n"913                + "    <rdfs:Datatype>\n"914                + "      <owl:datatypeComplementOf rdf:resource=\"http://www.w3.org/2001/XMLSchema#positiveInteger\" /></rdfs:Datatype></rdfs:range></rdf:Description>\n"915                + '\n'916                + "<rdf:Description rdf:about=\"i\">\n"917                + "  <p rdf:datatype=\"http://www.w3.org/2001/XMLSchema#negativeInteger\">-1</p>\n"918                + "  <p rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">A string</p></rdf:Description>\n"919                + '\n' + "</rdf:RDF>";920        String conclusion = "";921        String id = "Datatype_DataComplementOf_001";922        TestClasses tc = TestClasses.valueOf("CONSISTENCY");923        String d = "Demonstrates that the complement of a datatype contains literals from other datatypes.";924        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);925        r.setReasonerFactory(factory());926        r.run();927    }928    @Test929    public void testDifferent_types_in_Datatype_Restrictions_and_Complement() {930        String premise = "Prefix(:=<http://example.org/>)\n"931                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"932                + "Ontology(\n" + "  Declaration(NamedIndividual(:a))\n"933                + "  Declaration(DataProperty(:dp))\n"934                + "  Declaration(Class(:A))\n"935                + "  SubClassOf(:A DataAllValuesFrom(:dp \n"936                + "    DataOneOf(\"3\"^^xsd:integer \"4\"^^xsd:int))\n"937                + "  ) \n" + "  SubClassOf(:A DataAllValuesFrom(:dp \n"938                + "    DataOneOf(\"2\"^^xsd:short \"3\"^^xsd:integer))\n"939                + "  )\n" + "  ClassAssertion(:A :a)\n"940                + "  ClassAssertion(DataSomeValuesFrom(:dp\n"941                + "    DataComplementOf(DataOneOf(\"3\"^^xsd:integer))) :a\n"942                + "  )\n" + ')';943        String conclusion = "";944        String id = "Different_types_in_Datatype_Restrictions_and_Complement";945        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");946        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.";947        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);948        r.setReasonerFactory(factory());949        r.run();950    }951    @Test952    public void testinconsistent_integer_filler() {953        String premise = "Prefix(:=<http://example.org/>)\n"954                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"955                + "Ontology(\n"956                + "  Declaration(NamedIndividual(:a))\n"957                + "  Declaration(DataProperty(:hasAge))\n"958                + "  Declaration(Class(:Eighteen))\n"959                + "  SubClassOf(DataHasValue(:hasAge \"18\"^^xsd:integer) :Eighteen) \n"960                + "  ClassAssertion(DataHasValue(:hasAge \"18\"^^xsd:integer) :a) \n"961                + "  ClassAssertion(ObjectComplementOf(:Eighteen) :a)\n" + ')';962        String conclusion = "";963        String id = "inconsistent_integer_filler";964        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");965        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.";966        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);967        r.setReasonerFactory(factory());968        r.run();969    }970    @Test971    public void testDisjointClasses_001() {972        String premise = "<?xml version=\"1.0\"?>\n"973                + "<rdf:RDF\n"974                + "  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"975                + '\n'976                + "<owl:Ontology/>\n"977                + '\n'978                + "<owl:Class rdf:about=\"Boy\" />\n"979                + "<owl:Class rdf:about=\"Girl\" />\n"980                + '\n'981                + "<rdf:Description rdf:about=\"Boy\">\n"982                + "  <owl:disjointWith rdf:resource=\"Girl\" /></rdf:Description>\n"983                + '\n' + "<Boy rdf:about=\"Stewie\" />\n" + "</rdf:RDF>";984        String conclusion = "<?xml version=\"1.0\"?>\n"985                + "<rdf:RDF\n"986                + "  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"987                + '\n'988                + "<owl:Ontology/>\n"989                + '\n'990                + "<owl:Class rdf:about=\"Girl\" />\n"991                + '\n'992                + "<rdf:Description rdf:about=\"Stewie\">\n"993                + "  <rdf:type>\n"994                + "    <owl:Class>\n"995                + "      <owl:complementOf rdf:resource=\"Girl\" /></owl:Class></rdf:type>\n"996                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";997        String id = "DisjointClasses_001";998        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");999        String d = "Demonstrates a binary disjoint classes axiom based on example in the Structural Specification and Functional-Style Syntax document.";1000        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);1001        r.setReasonerFactory(factory());1002        r.run();1003    }1004    @Test1005    public void testDisjointClasses_002() {1006        String premise = "<?xml version=\"1.0\"?>\n"1007                + "<rdf:RDF\n"1008                + "  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"1009                + '\n'1010                + "<owl:Ontology/>\n"1011                + '\n'1012                + "<owl:Class rdf:about=\"Boy\" />\n"1013                + "<owl:Class rdf:about=\"Girl\" />\n"1014                + '\n'1015                + "<rdf:Description rdf:about=\"Boy\">\n"1016                + "  <owl:disjointWith rdf:resource=\"Girl\" /></rdf:Description>\n"1017                + '\n' + "<Boy rdf:about=\"Stewie\" />\n"1018                + "<Girl rdf:about=\"Stewie\" />\n" + '\n' + "</rdf:RDF>";1019        String conclusion = "";1020        String id = "DisjointClasses_002";1021        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");1022        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.";1023        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);1024        r.setReasonerFactory(factory());1025        r.run();1026    }1027    @Test1028    public void testDisjointClasses_003() {1029        String premise = "<?xml version=\"1.0\"?>\n"1030                + "<rdf:RDF\n"1031                + "  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"1032                + '\n' + "<owl:Ontology/>\n" + '\n'1033                + "<owl:Class rdf:about=\"Boy\" />\n"1034                + "<owl:Class rdf:about=\"Girl\" />\n"1035                + "<owl:Class rdf:about=\"Dog\" />\n" + '\n'1036                + "<owl:AllDisjointClasses>\n"1037                + "  <owl:members rdf:parseType=\"Collection\">\n"1038                + "    <rdf:Description rdf:about=\"Boy\" />\n"1039                + "    <rdf:Description rdf:about=\"Girl\" />\n"1040                + "    <rdf:Description rdf:about=\"Dog\" />\n"1041                + "  </owl:members></owl:AllDisjointClasses>\n" + '\n'1042                + "<Boy rdf:about=\"Stewie\" />\n" + '\n' + "</rdf:RDF>";1043        String conclusion = "<?xml version=\"1.0\"?>\n"1044                + "<rdf:RDF\n"1045                + "  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"1046                + '\n'1047                + "<owl:Ontology/>\n"1048                + '\n'1049                + "<owl:Class rdf:about=\"Girl\" />\n"1050                + "<owl:Class rdf:about=\"Dog\" />\n"1051                + '\n'1052                + "<rdf:Description rdf:about=\"Stewie\">\n"1053                + "  <rdf:type>\n"1054                + "    <owl:Class>\n"1055                + "      <owl:complementOf rdf:resource=\"Girl\" /></owl:Class></rdf:type>\n"1056                + "</rdf:Description>\n"1057                + '\n'1058                + "<rdf:Description rdf:about=\"Stewie\">\n"1059                + "  <rdf:type>\n"1060                + "    <owl:Class>\n"1061                + "      <owl:complementOf rdf:resource=\"Dog\" /></owl:Class></rdf:type>\n"1062                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";1063        String id = "DisjointClasses_003";1064        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");1065        String d = "A modification of test DisjointClasses-001 to demonstrate a ternary disjoint classes axiom.";1066        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);1067        r.setReasonerFactory(factory());1068        r.run();1069    }1070}...

Full Screen

Full Screen

Source:OWL2.java Github

copy

Full Screen

...8import testbase.TestBase;9@SuppressWarnings("javadoc")10public class OWL2 extends TestBase {11    @Test12    public void testowl2_rl_anonymous_individual() {13        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:j.0=\"http://owl2.test/rules#\">\n"14                + "  <owl:Ontology />\n"15                + "  <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/>\n"16                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#I\"/>\n"17                + "  <owl:NamedIndividual>\n"18                + "    <j.0:op rdf:resource=\"http://owl2.test/rules#I\"/></owl:NamedIndividual></rdf:RDF>";19        String conclusion = "";20        String id = "owl2_rl_anonymous_individual";21        TestClasses tc = TestClasses.valueOf("CONSISTENCY");22        String d = "OWL 2 RL allows anonymous individual.";23        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);24        r.setReasonerFactory(factory());25        r.run();26    }27    @Test28    public void testowl2_rl_invalid_leftside_allvaluesfrom() {29        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"30                + "  <owl:Ontology />\n"31                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\"/>\n"32                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/>\n"33                + "  <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/>\n"34                + "  <owl:Restriction>\n"35                + "    <owl:allValuesFrom rdf:resource=\"http://owl2.test/rules#C1\"/>\n"36                + "    <owl:onProperty rdf:resource=\"http://owl2.test/rules#op\"/>\n"37                + "    <rdfs:subClassOf rdf:resource=\"http://owl2.test/rules#C\"/></owl:Restriction></rdf:RDF>";38        String conclusion = "";39        String id = "owl2_rl_invalid_leftside_allvaluesfrom";40        TestClasses tc = TestClasses.valueOf("CONSISTENCY");41        String d = "OWL 2 RL does not allow left side allValuesFrom in a subClassOf axiom.";42        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);43        r.setReasonerFactory(factory());44        r.run();45    }46    @Test47    public void testowl2_rl_invalid_leftside_maxcard() {48        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"49                + "  <owl:Ontology />\n"50                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\"/>\n"51                + "  <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/>\n"52                + "  <owl:Restriction>\n"53                + "    <rdfs:subClassOf rdf:resource=\"http://owl2.test/rules#C\"/>\n"54                + "    <owl:maxCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">2</owl:maxCardinality>\n"55                + "    <owl:onProperty rdf:resource=\"http://owl2.test/rules#op\"/></owl:Restriction></rdf:RDF>";56        String conclusion = "";57        String id = "owl2_rl_invalid_leftside_maxcard";58        TestClasses tc = TestClasses.valueOf("CONSISTENCY");59        String d = "Invalid OWL 2 RL due to maxCardinality usage.";60        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);61        r.setReasonerFactory(factory());62        r.run();63    }64    @Test65    public void testowl2_rl_invalid_oneof() {66        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#\">\n"67                + "  <owl:Ontology />\n"68                + "  <owl:Class rdf:about=\"http://owl2.test/rules#Cb\">\n"69                + "    <owl:oneOf rdf:parseType=\"Collection\">\n"70                + "      <owl:Thing rdf:about=\"http://owl2.test/rules#X\"/>\n"71                + "      <owl:Thing rdf:about=\"http://owl2.test/rules#Y\"/></owl:oneOf></owl:Class>\n"72                + "</rdf:RDF>";73        String conclusion = "";74        String id = "owl2_rl_invalid_oneof";75        TestClasses tc = TestClasses.valueOf("CONSISTENCY");76        String d = "OWL 2 RL does not permit owl:oneOf to define a named class (it can be used as a subclass expression).";77        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);78        r.setReasonerFactory(factory());79        r.run();80    }81    @Test82    public void testowl2_rl_invalid_owlreal() {83        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"84                + "  <owl:Ontology />\n"85                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C_Sub\">\n"86                + "    <rdfs:subClassOf>\n"87                + "      <owl:Restriction>\n"88                + "        <owl:allValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#real\"/>\n"89                + "        <owl:onProperty>\n"90                + "          <owl:DatatypeProperty rdf:about=\"http://owl2.test/rules#p\"/></owl:onProperty></owl:Restriction></rdfs:subClassOf>\n"91                + "  </owl:Class></rdf:RDF>";92        String conclusion = "";93        String id = "owl2_rl_invalid_owlreal";94        TestClasses tc = TestClasses.valueOf("CONSISTENCY");95        String d = "Invalid OWL 2 RL because owl:real is used.";96        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);97        r.setReasonerFactory(factory());98        r.run();99    }100    @Test101    public void testowl2_rl_invalid_rightside_somevaluesfrom() {102        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"103                + "  <owl:Ontology />\n"104                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C_Sub\">\n"105                + "    <rdfs:subClassOf>\n"106                + "      <owl:Restriction>\n"107                + "        <owl:someValuesFrom>\n"108                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/></owl:someValuesFrom>\n"109                + "        <owl:onProperty>\n"110                + "          <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#p\"/></owl:onProperty></owl:Restriction></rdfs:subClassOf>\n"111                + "  </owl:Class></rdf:RDF>";112        String conclusion = "";113        String id = "owl2_rl_invalid_rightside_somevaluesfrom";114        TestClasses tc = TestClasses.valueOf("CONSISTENCY");115        String d = "This is not a valid OWL 2 RL because someValuesFrom shows up on the right hand side of a SubClassOf axiom.";116        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);117        r.setReasonerFactory(factory());118        r.run();119    }120    @Test121    public void testowl2_rl_invalid_rightside_unionof() {122        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\n"123                + "  <owl:Ontology />\n"124                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C_Sub\">\n"125                + "    <rdfs:subClassOf>\n"126                + "      <owl:Class>\n"127                + "        <owl:unionOf rdf:parseType=\"Collection\">\n"128                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/>\n"129                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C2\"/></owl:unionOf></owl:Class></rdfs:subClassOf>\n"130                + "  </owl:Class></rdf:RDF>";131        String conclusion = "";132        String id = "owl2_rl_invalid_rightside_unionof";133        TestClasses tc = TestClasses.valueOf("CONSISTENCY");134        String d = "Incorrect OWL 2 RL syntax. unionOf shows up at the right hand side of a SubClassOf axiom.";135        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);136        r.setReasonerFactory(factory());137        r.run();138    }139    @Test140    public void testowl2_rl_invalid_unionof() {141        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#\">\n"142                + "  <owl:Ontology />\n"143                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\">\n"144                + "    <owl:unionOf rdf:parseType=\"Collection\">\n"145                + "      <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/>\n"146                + "      <owl:Class rdf:about=\"http://owl2.test/rules#C2\"/></owl:unionOf></owl:Class>\n"147                + "</rdf:RDF>";148        String conclusion = "";149        String id = "owl2_rl_invalid_unionof";150        TestClasses tc = TestClasses.valueOf("CONSISTENCY");151        String d = "OWL 2 RL does not allow owl:unionOf to define a named class (it can be used as a subclass expression).";152        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);153        r.setReasonerFactory(factory());154        r.run();155    }156    @Test157    public void testowl2_rl_rules_fp_differentFrom() {158        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:j.0=\"http://owl2.test/rules/\">\n"159                + "  <owl:Ontology />\n"160                + "  <owl:FunctionalProperty rdf:about=\"http://owl2.test/rules/fp\">\n"161                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/></owl:FunctionalProperty>\n"162                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y2\">\n"163                + "    <j.0:fp>\n"164                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X2\"/></j.0:fp></owl:NamedIndividual>\n"165                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X1\">\n"166                + "    <owl:differentFrom rdf:resource=\"http://owl2.test/rules/X2\"/></owl:NamedIndividual>\n"167                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y1\">\n"168                + "    <j.0:fp rdf:resource=\"http://owl2.test/rules/X1\"/></owl:NamedIndividual></rdf:RDF>";169        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#\">\n"170                + "  <owl:Ontology />\n"171                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y2\"/>\n"172                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y1\">\n"173                + "    <owl:differentFrom rdf:resource=\"http://owl2.test/rules/Y2\"/></owl:NamedIndividual></rdf:RDF>";174        String id = "owl2_rl_rules_fp_differentFrom";175        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");176        String d = "This test checks the interaction between an OWL functional property and differentFrom assertions.";177        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);178        r.setReasonerFactory(factory());179        r.run();180    }181    @Test182    public void testowl2_rl_rules_ifp_differentFrom() {183        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:j.0=\"http://owl2.test/rules/\">\n"184                + "  <owl:Ontology />\n"185                + "  <owl:InverseFunctionalProperty rdf:about=\"http://owl2.test/rules/ifp\">\n"186                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#ObjectProperty\"/></owl:InverseFunctionalProperty>\n"187                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y2\">\n"188                + "    <j.0:ifp>\n"189                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X2\"/></j.0:ifp></owl:NamedIndividual>\n"190                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X1\"/>\n"191                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/Y1\">\n"192                + "    <owl:differentFrom rdf:resource=\"http://owl2.test/rules/Y2\"/>\n"193                + "    <j.0:ifp rdf:resource=\"http://owl2.test/rules/X1\"/></owl:NamedIndividual></rdf:RDF>";194        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#\">\n"195                + "  <owl:Ontology />\n"196                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X1\">\n"197                + "    <owl:differentFrom>\n"198                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules/X2\"/></owl:differentFrom></owl:NamedIndividual>\n"199                + "</rdf:RDF>";200        String id = "owl2_rl_rules_ifp_differentFrom";201        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");202        String d = "This test checks the interaction between inverse functional property and differentFrom assertions.";203        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);204        r.setReasonerFactory(factory());205        r.run();206    }207    @Test208    public void testowl2_rl_valid_mincard() {209        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:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:j.0=\"http://owl2.test/rules#\">\n"210                + "  <owl:Ontology rdf:about=\"http://org.semanticweb.ontologies/Ontology1232054810511161000\"/>\n"211                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\">\n"212                + "    <rdfs:subClassOf>\n"213                + "      <owl:Restriction>\n"214                + "        <owl:minCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">1</owl:minCardinality>\n"215                + "        <owl:onProperty>\n"216                + "          <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#OP\"/></owl:onProperty></owl:Restriction></rdfs:subClassOf></owl:Class>\n"217                + "  <owl:Class rdf:about=\"http://www.w3.org/2002/07/owl#Thing\"/>\n"218                + "  <j.0:C rdf:about=\"http://owl2.test/rules#c\">\n"219                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/></j.0:C></rdf:RDF>";220        String conclusion = "";221        String id = "owl2_rl_valid_mincard";222        TestClasses tc = TestClasses.valueOf("CONSISTENCY");223        String d = "OWL 2 RL does not allow min cardinality";224        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);225        r.setReasonerFactory(factory());226        r.run();227    }228    @Test229    public void testowl2_rl_valid_oneof() {230        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"231                + "  <owl:Ontology />\n"232                + "  <owl:Class rdf:about=\"http://owl2.test/rules#Cb\"/>\n"233                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#X\"/>\n"234                + "  <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#Y\"/>\n"235                + "  <rdf:Description>\n"236                + "    <rdfs:subClassOf rdf:resource=\"http://owl2.test/rules#Cb\"/>\n"237                + "    <owl:oneOf rdf:parseType=\"Collection\">\n"238                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#X\"/>\n"239                + "      <owl:NamedIndividual rdf:about=\"http://owl2.test/rules#Y\"/></owl:oneOf></rdf:Description>\n"240                + "</rdf:RDF>";241        String conclusion = "";242        String id = "owl2_rl_valid_oneof";243        TestClasses tc = TestClasses.valueOf("CONSISTENCY");244        String d = "A valid usage of oneOf in OWL 2 RL";245        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);246        r.setReasonerFactory(factory());247        r.run();248    }249    @Test250    public void testowl2_rl_valid_rightside_allvaluesfrom() {251        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"252                + "  <owl:Ontology />\n"253                + "  <owl:Class rdf:about=\"http://owl2.test/rules#C\">\n"254                + "    <rdfs:subClassOf>\n"255                + "      <owl:Restriction>\n"256                + "        <owl:onProperty>\n"257                + "          <owl:ObjectProperty rdf:about=\"http://owl2.test/rules#op\"/></owl:onProperty>\n"258                + "        <owl:allValuesFrom>\n"259                + "          <owl:Class rdf:about=\"http://owl2.test/rules#C1\"/></owl:allValuesFrom></owl:Restriction></rdfs:subClassOf>\n"260                + "  </owl:Class></rdf:RDF>";261        String conclusion = "";262        String id = "owl2_rl_valid_rightside_allvaluesfrom";263        TestClasses tc = TestClasses.valueOf("CONSISTENCY");264        String d = "Valid RL usage of allValuesFrom.";265        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);266        r.setReasonerFactory(factory());267        r.run();268    }269    @Test270    public void testNew_Feature_AnnotationAnnotations_001() {271        String premise = "<?xml version=\"1.0\"?>\n"272                + "<rdf:RDF\n"273                + "  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"274                + '\n'275                + "<owl:Ontology rdf:about=\"http://example.org/\"/>\n"276                + '\n'277                + "<rdf:Description rdf:about=\"http://example.org/\">\n"278                + "  <rdfs:label>An example ontology</rdfs:label></rdf:Description>\n"279                + '\n'280                + "<owl:Annotation>\n"281                + "  <owl:annotatedSource rdf:resource=\"http://example.org/\" />\n"282                + "  <owl:annotatedProperty rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#label\" />\n"283                + "  <owl:annotatedTarget>An example ontology</owl:annotatedTarget>\n"284                + "  <author>Mike Smith</author>\n" + "</owl:Annotation>\n"285                + '\n' + "<owl:AnnotationProperty rdf:about=\"author\" />\n"286                + "<owl:NamedIndividual rdf:about=\"i\" />\n" + '\n'287                + "</rdf:RDF>";288        String conclusion = "";289        String id = "New_Feature_AnnotationAnnotations_001";290        TestClasses tc = TestClasses.valueOf("CONSISTENCY");291        String d = "Demonstrates annotation of an annotation.  Adapted from an example in the Mapping to RDF Graphs document.";292        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);293        r.setReasonerFactory(factory());294        r.run();295    }296    @Test297    public void testNew_Feature_AsymmetricProperty_001() {298        String premise = "<?xml version=\"1.0\"?>\n"299                + "<rdf:RDF\n"300                + "  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"301                + '\n' + "<owl:Ontology/>\n" + '\n'302                + "<owl:ObjectProperty rdf:about=\"parentOf\" />\n"303                + "<owl:AsymmetricProperty rdf:about=\"parentOf\" />\n" + '\n'304                + "<rdf:Description rdf:about=\"Peter\">\n"305                + "  <parentOf rdf:resource=\"Stewie\" />\n"306                + "</rdf:Description>\n" + '\n'307                + "<rdf:Description rdf:about=\"Stewie\">\n"308                + "  <parentOf rdf:resource=\"Peter\" />\n"309                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";310        String conclusion = "";311        String id = "New_Feature_AsymmetricProperty_001";312        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");313        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.";314        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);315        r.setReasonerFactory(factory());316        r.run();317    }318    @Test319    public void testNew_Feature_AxiomAnnotations_001() {320        String premise = "<?xml version=\"1.0\"?>\n"321                + "<rdf:RDF\n"322                + "  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"323                + '\n'324                + "<owl:Ontology/>\n"325                + '\n'326                + "<owl:Class rdf:about=\"Child\" />\n"327                + "<owl:Class rdf:about=\"Person\" />\n"328                + '\n'329                + "<rdf:Description rdf:about=\"Child\">\n"330                + "  <rdfs:subClassOf rdf:resource=\"Person\" /></rdf:Description>\n"331                + '\n'332                + "<owl:Axiom>\n"333                + "  <owl:annotatedSource rdf:resource=\"Child\" />\n"334                + "  <owl:annotatedProperty rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#subClassOf\" />\n"335                + "  <owl:annotatedTarget rdf:resource=\"Person\" />\n"336                + "  <rdfs:comment>Children are people.</rdfs:comment></owl:Axiom>\n"337                + '\n' + "</rdf:RDF>";338        String conclusion = "";339        String id = "New_Feature_AxiomAnnotations_001";340        TestClasses tc = TestClasses.valueOf("CONSISTENCY");341        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.";342        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);343        r.setReasonerFactory(factory());344        r.run();345    }346    @Test347    public void testNew_Feature_BottomDataProperty_001() {348        String premise = "<?xml version=\"1.0\"?>\n"349                + "<rdf:RDF\n"350                + "  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"351                + '\n'352                + "<owl:Ontology/>\n"353                + '\n'354                + "<rdf:Description rdf:about=\"i\">\n"355                + "  <rdf:type>\n"356                + "    <owl:Restriction>\n"357                + "      <owl:onProperty rdf:resource=\"http://www.w3.org/2002/07/owl#bottomDataProperty\" />\n"358                + "      <owl:someValuesFrom rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\" /></owl:Restriction></rdf:type>\n"359                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";360        String conclusion = "";361        String id = "New_Feature_BottomDataProperty_001";362        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");363        String d = "Demonstrates use of the bottom data property to create an inconsistency.";364        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);365        r.setReasonerFactory(factory());366        r.run();367    }368    @Test369    public void testNew_Feature_BottomObjectProperty_001() {370        String premise = "<?xml version=\"1.0\"?>\n"371                + "<rdf:RDF\n"372                + "  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"373                + '\n'374                + "<owl:Ontology/>\n"375                + '\n'376                + "<rdf:Description rdf:about=\"i\">\n"377                + "  <rdf:type>\n"378                + "    <owl:Restriction>\n"379                + "      <owl:onProperty rdf:resource=\"http://www.w3.org/2002/07/owl#bottomObjectProperty\" />\n"380                + "      <owl:someValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\" /></owl:Restriction></rdf:type>\n"381                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";382        String conclusion = "";383        String id = "New_Feature_BottomObjectProperty_001";384        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");385        String d = "Demonstrates use of the bottom object property to create an inconsistency.";386        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);387        r.setReasonerFactory(factory());388        r.run();389    }390    @Test391    public void testNew_Feature_DisjointObjectProperties_001() {392        String premise = "<?xml version=\"1.0\"?>\n"393                + "<rdf:RDF\n"394                + "  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"395                + '\n'396                + "<owl:Ontology/>\n"397                + '\n'398                + "<owl:ObjectProperty rdf:about=\"hasFather\" />\n"399                + "<owl:ObjectProperty rdf:about=\"hasMother\" />\n"400                + '\n'401                + "<rdf:Description rdf:about=\"hasFather\">\n"402                + "  <owl:propertyDisjointWith rdf:resource=\"hasMother\" /></rdf:Description>\n"403                + '\n' + "<rdf:Description rdf:about=\"Stewie\">\n"404                + "  <hasFather rdf:resource=\"Peter\" />\n"405                + "</rdf:Description>\n" + '\n'406                + "<rdf:Description rdf:about=\"Stewie\">\n"407                + "  <hasMother rdf:resource=\"Lois\" />\n"408                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";409        String conclusion = "<?xml version=\"1.0\"?>\n"410                + "<rdf:RDF\n"411                + "  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"412                + '\n'413                + "<owl:Ontology/>\n"414                + '\n'415                + "<rdf:Description rdf:about=\"Peter\">\n"416                + "  <owl:differentFrom rdf:resource=\"Lois\" /></rdf:Description>\n"417                + '\n' + "</rdf:RDF>";418        String id = "New_Feature_DisjointObjectProperties_001";419        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");420        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.";421        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);422        r.setReasonerFactory(factory());423        r.run();424    }425    @Test426    public void testNew_Feature_DisjointObjectProperties_002() {427        String premise = "<?xml version=\"1.0\"?>\n"428                + "<rdf:RDF\n"429                + "  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"430                + '\n'431                + "<owl:Ontology/>\n"432                + '\n'433                + "<owl:ObjectProperty rdf:about=\"hasFather\" />\n"434                + "<owl:ObjectProperty rdf:about=\"hasMother\" />\n"435                + "<owl:ObjectProperty rdf:about=\"hasChild\" />\n"436                + '\n'437                + "<owl:AllDisjointProperties>\n"438                + "  <owl:members rdf:parseType=\"Collection\">\n"439                + "    <rdf:Description rdf:about=\"hasFather\" />\n"440                + "    <rdf:Description rdf:about=\"hasMother\" />\n"441                + "    <rdf:Description rdf:about=\"hasChild\" /></owl:members></owl:AllDisjointProperties>\n"442                + '\n'443                + "<rdf:Description rdf:about=\"Stewie\">\n"444                + "  <hasFather rdf:resource=\"Peter\" />\n"445                + "</rdf:Description>\n"446                + '\n'447                + "<rdf:Description rdf:about=\"Stewie\">\n"448                + "  <hasMother rdf:resource=\"Lois\" />\n"449                + "</rdf:Description>\n"450                + '\n'451                + "<rdf:Description rdf:about=\"Stewie\">\n"452                + "  <hasChild rdf:resource=\"StewieJr\" />\n"453                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";454        String conclusion = "<?xml version=\"1.0\"?>\n"455                + "<rdf:RDF\n"456                + "  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"457                + '\n'458                + "<owl:Ontology/>\n"459                + '\n'460                + "<owl:AllDifferent>\n"461                + "  <owl:distinctMembers rdf:parseType=\"Collection\">\n"462                + "    <rdf:Description rdf:about=\"Peter\" />\n"463                + "    <rdf:Description rdf:about=\"Lois\" />\n"464                + "    <rdf:Description rdf:about=\"StewieJr\" /></owl:distinctMembers></owl:AllDifferent>\n"465                + '\n' + "</rdf:RDF>";466        String id = "New_Feature_DisjointObjectProperties_002";467        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");468        String d = "A modification of test New-Feature-DisjointObjectProperties-001 to demonstrate a ternary disjoint object properties axiom.";469        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);470        r.setReasonerFactory(factory());471        r.run();472    }473    @Test474    public void testNew_Feature_DisjointUnion_001() {475        String premise = "<?xml version=\"1.0\"?>\n"476                + "<rdf:RDF\n"477                + "  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"478                + '\n'479                + "<owl:Ontology/>\n"480                + '\n'481                + "<owl:Class rdf:about=\"Child\" />\n"482                + "<owl:Class rdf:about=\"Boy\" />\n"483                + "<owl:Class rdf:about=\"Girl\" />\n"484                + '\n'485                + "<rdf:Description rdf:about=\"Child\">\n"486                + "  <owl:disjointUnionOf rdf:parseType=\"Collection\">\n"487                + "    <rdf:Description rdf:about=\"Boy\" />\n"488                + "    <rdf:Description rdf:about=\"Girl\" /></owl:disjointUnionOf></rdf:Description>\n"489                + '\n'490                + "<Child rdf:about=\"Stewie\" />\n"491                + "<rdf:Description rdf:about=\"Stewie\">\n"492                + "  <rdf:type>\n"493                + "    <owl:Class>\n"494                + "      <owl:complementOf rdf:resource=\"Girl\" /></owl:Class></rdf:type>\n"495                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";496        String conclusion = "<?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' + "<owl:Ontology/>\n" + '\n'500                + "<owl:Class rdf:about=\"Boy\" />\n" + '\n'501                + "<Boy rdf:about=\"Stewie\" />\n" + '\n' + "</rdf:RDF>";502        String id = "New_Feature_DisjointUnion_001";503        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");504        String d = "Demonstrates a disjoint union axiom based on the example in the Structural Specification and Functional-Style Syntax document.";505        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);506        r.setReasonerFactory(factory());507        r.run();508    }509    @Test510    public void testNew_Feature_IrreflexiveProperty_001() {511        String premise = "<?xml version=\"1.0\"?>\n"512                + "<rdf:RDF\n"513                + "  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"514                + '\n' + "<owl:Ontology/>\n" + '\n'515                + "<owl:ObjectProperty rdf:about=\"marriedTo\" />\n"516                + "<owl:IrreflexiveProperty rdf:about=\"marriedTo\" />\n"517                + '\n' + "<rdf:Description rdf:about=\"Peter\">\n"518                + "  <marriedTo rdf:resource=\"Peter\" />\n"519                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";520        String conclusion = "";521        String id = "New_Feature_IrreflexiveProperty_001";522        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");523        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.";524        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);525        r.setReasonerFactory(factory());526        r.run();527    }528    @Test529    public void testNew_Feature_NegativeDataPropertyAssertion_001() {530        String premise = "<?xml version=\"1.0\"?>\n"531                + "<rdf:RDF\n"532                + "  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"533                + '\n'534                + "<owl:Ontology/>\n"535                + '\n'536                + "<owl:DatatypeProperty rdf:about=\"hasAge\" />\n"537                + '\n'538                + "<owl:NegativePropertyAssertion>\n"539                + "  <owl:sourceIndividual rdf:resource=\"Meg\" />\n"540                + "  <owl:assertionProperty rdf:resource=\"hasAge\" />\n"541                + "  <owl:targetValue rdf:datatype=\"http://www.w3.org/2001/XMLSchema#integer\">5</owl:targetValue></owl:NegativePropertyAssertion>\n"542                + '\n'543                + "<rdf:Description rdf:about=\"Meg\">\n"544                + "  <hasAge rdf:datatype=\"http://www.w3.org/2001/XMLSchema#integer\">5</hasAge></rdf:Description>\n"545                + '\n' + "</rdf:RDF>";546        String conclusion = "";547        String id = "New_Feature_NegativeDataPropertyAssertion_001";548        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");549        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.";550        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);551        r.setReasonerFactory(factory());552        r.run();553    }554    @Test555    public void testNew_Feature_NegativeObjectPropertyAssertion_001() {556        String premise = "<?xml version=\"1.0\"?>\n"557                + "<rdf:RDF\n"558                + "  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"559                + '\n'560                + "<owl:Ontology/>\n"561                + '\n'562                + "<owl:ObjectProperty rdf:about=\"hasSon\" />\n"563                + '\n'564                + "<owl:NegativePropertyAssertion>\n"565                + "  <owl:sourceIndividual rdf:resource=\"Peter\" />\n"566                + "  <owl:assertionProperty rdf:resource=\"hasSon\" />\n"567                + "  <owl:targetIndividual rdf:resource=\"Meg\" /></owl:NegativePropertyAssertion>\n"568                + '\n' + "<rdf:Description rdf:about=\"Peter\">\n"569                + "  <hasSon rdf:resource=\"Meg\" />\n"570                + "</rdf:Description>\n" + "</rdf:RDF>";571        String conclusion = "";572        String id = "New_Feature_NegativeObjectPropertyAssertion_001";573        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");574        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.";575        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);576        r.setReasonerFactory(factory());577        r.run();578    }579    @Test580    @Changed581    public void testNew_Feature_ObjectPropertyChain_001() {582        String premise = "<?xml version=\"1.0\"?>\n"583                + "<rdf:RDF\n"584                + "  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"585                + "<owl:Ontology/><owl:ObjectProperty rdf:about=\"hasMother\" />\n"586                + "<owl:ObjectProperty rdf:about=\"hasSister\" />\n"587                + "<owl:ObjectProperty rdf:about=\"hasAunt\" />\n"588                + "<rdf:Description rdf:about=\"hasAunt\">\n"589                + "  <owl:propertyChainAxiom rdf:parseType=\"Collection\">\n"590                + "    <rdf:Description rdf:about=\"hasMother\" />\n"591                + "    <rdf:Description rdf:about=\"hasSister\" /></owl:propertyChainAxiom></rdf:Description>\n"592                + "<rdf:Description rdf:about=\"Stewie\">\n"593                + "  <hasMother rdf:resource=\"Lois\" />\n"594                + "</rdf:Description>\n"595                + "<rdf:Description rdf:about=\"Lois\">\n"596                + "  <hasSister rdf:resource=\"Carol\" />\n"597                + "</rdf:Description>\n" + "</rdf:RDF>";598        String conclusion = "<?xml version=\"1.0\"?>\n"599                + "<rdf:RDF\n"600                + "  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"601                + "<owl:Ontology/>\n"602                + "<owl:ObjectProperty rdf:about=\"hasAunt\" />\n"603                + "<rdf:Description rdf:about=\"Stewie\"><hasAunt rdf:resource=\"Carol\" /></rdf:Description></rdf:RDF>";604        String id = "New_Feature_ObjectPropertyChain_001";605        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");606        String d = "Demonstrates an object property chain in a subproperty axiom based on the example in the Structural Specification and Functional-Style Syntax document.";607        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);608        r.setReasonerFactory(factory());609        r.run();610    }611    @Test612    public void testNew_Feature_ObjectPropertyChain_BJP_004() {613        String premise = "<?xml version=\"1.0\"?>\n"614                + "<rdf:RDF\n"615                + "    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"616                + '\n'617                + "<owl:Ontology/>\n"618                + '\n'619                + "    <rdf:Description rdf:about=\"p\">\n"620                + "        <owl:propertyChainAxiom rdf:parseType=\"Collection\">\n"621                + "            <owl:ObjectProperty rdf:about=\"p\"/>\n"622                + "            <owl:ObjectProperty rdf:about=\"q\"/></owl:propertyChainAxiom></rdf:Description>\n"623                + "    \n" + "    <rdf:Description rdf:about=\"a\">\n"624                + "        <q rdf:resource=\"b\"/>\n"625                + "    </rdf:Description>\n" + "    \n"626                + "    <rdf:Description rdf:about=\"b\">\n"627                + "        <q rdf:resource=\"c\"/>\n"628                + "    </rdf:Description>\n" + "   \n" + "</rdf:RDF>";629        String conclusion = "<rdf:RDF\n"630                + "    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"631                + '\n' + "   <owl:Ontology/>\n"632                + "   <owl:ObjectProperty rdf:about=\"p\"/>\n"633                + "   <owl:TransitiveProperty rdf:about=\"p\"/>\n"634                + "</rdf:RDF>";635        String id = "New_Feature_ObjectPropertyChain_BJP_004";636        TestClasses tc = TestClasses.valueOf("NEGATIVE_IMPL");637        String d = "A test of an interaction between a role chain +hierarchy and transitivity axioms.";638        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);639        r.setReasonerFactory(factory());640        r.run();641    }642    @Test643    public void testNew_Feature_ObjectQCR_001() {644        String premise = "<?xml version=\"1.0\"?>\n"645                + "<rdf:RDF\n"646                + "  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"647                + '\n'648                + "<owl:Ontology/>\n"649                + '\n'650                + "<owl:ObjectProperty rdf:about=\"fatherOf\" />\n"651                + "<owl:Class rdf:about=\"Man\" />\n"652                + '\n'653                + "<rdf:Description rdf:about=\"Peter\">\n"654                + "  <fatherOf rdf:resource=\"Stewie\" />\n"655                + "  <fatherOf rdf:resource=\"Chris\" />\n"656                + "</rdf:Description>\n"657                + '\n'658                + "<Man rdf:about=\"Stewie\" />\n"659                + "<Man rdf:about=\"Chris\" />\n"660                + '\n'661                + "<rdf:Description rdf:about=\"Stewie\">\n"662                + "  <owl:differentFrom rdf:resource=\"Chris\" /></rdf:Description>\n"663                + '\n' + "</rdf:RDF>";664        String conclusion = "<?xml version=\"1.0\"?>\n"665                + "<rdf:RDF\n"666                + "  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"667                + '\n'668                + "<owl:Ontology/>\n"669                + '\n'670                + "<owl:ObjectProperty rdf:about=\"fatherOf\" />\n"671                + "<owl:Class rdf:about=\"Man\" />\n"672                + '\n'673                + "<rdf:Description rdf:about=\"Peter\">\n"674                + "  <rdf:type>\n"675                + "    <owl:Restriction>\n"676                + "      <owl:onProperty rdf:resource=\"fatherOf\" />\n"677                + "      <owl:minQualifiedCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">2</owl:minQualifiedCardinality>\n"678                + "      <owl:onClass rdf:resource=\"Man\" /></owl:Restriction></rdf:type>\n"679                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";680        String id = "New_Feature_ObjectQCR_001";681        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");682        String d = "Demonstrates a qualified minimum cardinality object property restriction based on example in the Structural Specification and Functional-Style Syntax document.";683        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);684        r.setReasonerFactory(factory());685        r.run();686    }687    @Test688    public void testNew_Feature_ObjectQCR_002() {689        String premise = "<?xml version=\"1.0\"?>\n"690                + "<rdf:RDF\n"691                + "  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"692                + '\n'693                + "<owl:Ontology/>\n"694                + '\n'695                + "<owl:ObjectProperty rdf:about=\"fatherOf\" />\n"696                + "<owl:Class rdf:about=\"Woman\" />\n"697                + '\n'698                + "<rdf:Description rdf:about=\"Peter\">\n"699                + "  <fatherOf rdf:resource=\"Stewie\" />\n"700                + "  <fatherOf rdf:resource=\"Meg\" /></rdf:Description>\n"701                + '\n'702                + "<Woman rdf:about=\"Meg\" />\n"703                + '\n'704                + "<rdf:Description rdf:about=\"Peter\">\n"705                + "  <rdf:type>\n"706                + "    <owl:Restriction>\n"707                + "      <owl:onProperty rdf:resource=\"fatherOf\" />\n"708                + "      <owl:maxQualifiedCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">1</owl:maxQualifiedCardinality>\n"709                + "      <owl:onClass rdf:resource=\"Woman\" /></owl:Restriction></rdf:type>\n"710                + "</rdf:Description>\n"711                + '\n'712                + "<rdf:Description rdf:about=\"Stewie\">\n"713                + "  <owl:differentFrom rdf:resource=\"Meg\" /></rdf:Description>\n"714                + '\n' + "</rdf:RDF>";715        String conclusion = "<?xml version=\"1.0\"?>\n"716                + "<rdf:RDF\n"717                + "  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"718                + '\n'719                + "<owl:Ontology/>\n"720                + '\n'721                + "<owl:Class rdf:about=\"Woman\" />\n"722                + '\n'723                + "<rdf:Description rdf:about=\"Stewie\">\n"724                + "  <rdf:type>\n"725                + "    <owl:Class>\n"726                + "      <owl:complementOf rdf:resource=\"Woman\" /></owl:Class></rdf:type>\n"727                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";728        String id = "New_Feature_ObjectQCR_002";729        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");730        String d = "Demonstrates a qualified maximum cardinality object property restriction adapted from example in the Structural Specification and Functional-Style Syntax document.";731        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);732        r.setReasonerFactory(factory());733        r.run();734    }735    @Test736    public void testFS2RDF_different_individuals_2_ar() {737        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"738                + "  <owl:Ontology/>\n"739                + "  <rdf:Description rdf:about=\"http://example.org/a\">\n"740                + "    <owl:differentFrom rdf:resource=\"http://example.org/b\"/></rdf:Description></rdf:RDF>";741        String conclusion = "";742        String id = "FS2RDF_different_individuals_2_ar";743        TestClasses tc = TestClasses.valueOf("CONSISTENCY");744        String d = "Functional syntax to RDFXML translation of ontology consisting of a 2 argument DifferentIndividuals";745        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);746        r.setReasonerFactory(factory());747        r.run();748    }749    @Test750    public void testFS2RDF_different_individuals_3_ar() {751        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"752                + "  <owl:Ontology/>\n"753                + "  <owl:AllDifferent>\n"754                + "    <owl:distinctMembers rdf:parseType=\"Collection\">\n"755                + "      <rdf:Description rdf:about=\"http://example.org/a\"/>\n"756                + "      <rdf:Description rdf:about=\"http://example.org/b\"/>\n"757                + "      <rdf:Description rdf:about=\"http://example.org/c\"/></owl:distinctMembers></owl:AllDifferent>\n"758                + "</rdf:RDF>";759        String conclusion = "";760        String id = "FS2RDF_different_individuals_3_ar";761        TestClasses tc = TestClasses.valueOf("CONSISTENCY");762        String d = "Functional syntax to RDFXML translation of ontology consisting of a 3 argument DifferentIndividuals";763        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);764        r.setReasonerFactory(factory());765        r.run();766    }767    @Test768    public void testFS2RDF_no_builtin_prefixes_ar() {769        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"770                + "  <owl:Ontology/>\n"771                + "  <rdf:Description rdf:about=\"http://example.org/d\">\n"772                + "    <owl:sameAs rdf:resource=\"http://example.org/e\"/></rdf:Description>\n"773                + "  <rdf:Description rdf:about=\"http://example.org/a\">\n"774                + "    <owl:sameAs>\n"775                + "      <rdf:Description rdf:about=\"http://example.org/b\">\n"776                + "        <owl:sameAs>\n"777                + "          <rdf:Description rdf:about=\"http://example.org/c\">\n"778                + "            <owl:sameAs rdf:resource=\"http://example.org/d\"/></rdf:Description></owl:sameAs></rdf:Description></owl:sameAs></rdf:Description>\n"779                + "</rdf:RDF>";780        String conclusion = "";781        String id = "FS2RDF_no_builtin_prefixes_ar";782        TestClasses tc = TestClasses.valueOf("CONSISTENCY");783        String d = "Functional syntax to RDFXML checking that there aren't builtin prefixes for xsd, rdf, rdfs, owl";784        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);785        r.setReasonerFactory(factory());786        r.run();787    }788    @Test789    public void testFS2RDF_same_individual_2_ar() {790        String premise = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns=\"http://example.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"791                + "  <owl:Ontology/>\n"792                + "  <rdf:Description rdf:about=\"http://example.org/a\">\n"793                + "    <owl:sameAs rdf:resource=\"http://example.org/b\"/></rdf:Description></rdf:RDF>";794        String conclusion = "";795        String id = "FS2RDF_same_individual_2_ar";796        TestClasses tc = TestClasses.valueOf("CONSISTENCY");797        String d = "Functional syntax to RDFXML translation of ontology consisting of a 2 argument SameIndividual";798        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);799        r.setReasonerFactory(factory());800        r.run();801    }802    @Test803    public void testbnode2somevaluesfrom() {804        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:ex=\"http://example.org/\"\n"805                + "  xml:base=\"http://example.org/\">\n"806                + "  <owl:Ontology/>\n"807                + "  <owl:ObjectProperty rdf:about=\"p\"/>\n"808                + "   \n"809                + "  <owl:Thing rdf:about=\"a\">\n"810                + "    <ex:p><rdf:Description rdf:nodeID=\"x\"/></ex:p> </owl:Thing></rdf:RDF>";811        String conclusion = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"   xmlns:ex=\"http://example.org/\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\n"812                + "          xml:base=\"http://example.org/\">\n"813                + "  <owl:Ontology/>\n"814                + "  <owl:ObjectProperty rdf:about=\"p\"/>\n"815                + "  <owl:Thing rdf:about=\"a\">\n"816                + "        <rdf:type>\n"817                + "            <owl:Restriction>\n"818                + "                <owl:onProperty rdf:resource=\"p\"/>\n"819                + "                <owl:someValuesFrom rdf:resource=\"http://www.w3.org/2002/07/owl#Thing\"/></owl:Restriction></rdf:type></owl:Thing></rdf:RDF>";820        String id = "bnode2somevaluesfrom";821        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");822        String d = "Shows that a BNode is an existential variable.";823        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);824        r.setReasonerFactory(factory());825        r.run();826    }827    @Test828    public void testchain2trans1() {829        String premise = "<rdf:RDF \n"830                + "     xml:base=\"http://example.org/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"831                + '\n'832                + "    <owl:Ontology rdf:about=\"http://owl.semanticweb.org/page/Special:GetOntology/Chain2trans?m=p\"/>\n"833                + "    <owl:ObjectProperty rdf:about=\"#p\"/>\n"834                + '\n'835                + "    <rdf:Description rdf:about=\"#p\">\n"836                + "        <owl:propertyChainAxiom rdf:parseType=\"Collection\">\n"837                + "            <rdf:Description rdf:about=\"#p\"/>\n"838                + "            <rdf:Description rdf:about=\"#p\"/></owl:propertyChainAxiom></rdf:Description>\n"839                + "</rdf:RDF>";840        String conclusion = "<?xml version=\"1.0\"?>\n"841                + "<rdf:RDF \n"842                + "     xml:base=\"http://example.org/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n"843                + "    <owl:Ontology rdf:about=\"http://owl.semanticweb.org/page/Special:GetOntology/Chain2trans?m=c\"/>\n"844                + "    <owl:TransitiveProperty rdf:about=\"#p\"/>\n"845                + "</rdf:RDF>";846        String id = "chain2trans1";847        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");848        String d = "A role chain can be a synonym for transitivity.";849        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);850        r.setReasonerFactory(factory());851        r.run();852    }853    @Test854    public void testConsistent_dateTime() {855        String premise = "Prefix(:=<http://example.org/>)\n"856                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"857                + "Ontology(\n"858                + "  Declaration(NamedIndividual(:a))\n"859                + "  Declaration(DataProperty(:dp))\n"860                + "  Declaration(Class(:A))\n"861                + "  SubClassOf(:A \n"862                + "    DataSomeValuesFrom(:dp DatatypeRestriction(\n"863                + "      xsd:dateTime \n"864                + "      xsd:minInclusive \"2008-10-08T20:44:11.656+01:00\"^^xsd:dateTime)\n"865                + "    )\n"866                + "  ) \n"867                + "  SubClassOf(:A \n"868                + "    DataAllValuesFrom(:dp DatatypeRestriction(\n"869                + "      xsd:dateTime \n"870                + "      xsd:maxInclusive \"2008-10-08T20:44:11.656+01:00\"^^xsd:dateTime)\n"871                + "    )\n" + "  )\n" + "  ClassAssertion(:A :a)\n" + ')';872        String conclusion = "";873        String id = "Consistent_dateTime";874        TestClasses tc = TestClasses.valueOf("CONSISTENCY");875        String d = "The datatype restrictions leave exactly one dateTime value as dp filler for the individual a, so the ontology is consistent.";876        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);877        r.setReasonerFactory(factory());878        r.run();879    }880    @Test881    public void testconsistent_integer_filler() {882        String premise = "Prefix(:=<http://example.org/>)\n"883                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"884                + "Ontology(\n" + "  Declaration(NamedIndividual(:a))\n"885                + "  Declaration(DataProperty(:dp))\n"886                + "  Declaration(Class(:A))\n"887                + "  SubClassOf(:A DataHasValue(:dp \"18\"^^xsd:integer)) \n"888                + "  ClassAssertion(:A :a) \n"889                + "  ClassAssertion(DataAllValuesFrom(:dp xsd:integer) :a)\n"890                + ')';891        String conclusion = "";892        String id = "consistent_integer_filler";893        TestClasses tc = TestClasses.valueOf("CONSISTENCY");894        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.";895        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);896        r.setReasonerFactory(factory());897        r.run();898    }899    @Test900    public void testDatatype_DataComplementOf_001() {901        String premise = "<?xml version=\"1.0\"?>\n"902                + "<rdf:RDF\n"903                + "  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"904                + '\n'905                + "<owl:Ontology/>\n"906                + '\n'907                + "<owl:DatatypeProperty rdf:about=\"p\" />\n"908                + '\n'909                + "<rdf:Description rdf:about=\"p\">\n"910                + "  <rdfs:range>\n"911                + "    <rdfs:Datatype>\n"912                + "      <owl:datatypeComplementOf rdf:resource=\"http://www.w3.org/2001/XMLSchema#positiveInteger\" /></rdfs:Datatype></rdfs:range></rdf:Description>\n"913                + '\n'914                + "<rdf:Description rdf:about=\"i\">\n"915                + "  <p rdf:datatype=\"http://www.w3.org/2001/XMLSchema#negativeInteger\">-1</p>\n"916                + "  <p rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">A string</p></rdf:Description>\n"917                + '\n' + "</rdf:RDF>";918        String conclusion = "";919        String id = "Datatype_DataComplementOf_001";920        TestClasses tc = TestClasses.valueOf("CONSISTENCY");921        String d = "Demonstrates that the complement of a datatype contains literals from other datatypes.";922        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);923        r.setReasonerFactory(factory());924        r.run();925    }926    @Test927    public void testDifferent_types_in_Datatype_Restrictions_and_Complement() {928        String premise = "Prefix(:=<http://example.org/>)\n"929                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"930                + "Ontology(\n" + "  Declaration(NamedIndividual(:a))\n"931                + "  Declaration(DataProperty(:dp))\n"932                + "  Declaration(Class(:A))\n"933                + "  SubClassOf(:A DataAllValuesFrom(:dp \n"934                + "    DataOneOf(\"3\"^^xsd:integer \"4\"^^xsd:int))\n"935                + "  ) \n" + "  SubClassOf(:A DataAllValuesFrom(:dp \n"936                + "    DataOneOf(\"2\"^^xsd:short \"3\"^^xsd:integer))\n"937                + "  )\n" + "  ClassAssertion(:A :a)\n"938                + "  ClassAssertion(DataSomeValuesFrom(:dp\n"939                + "    DataComplementOf(DataOneOf(\"3\"^^xsd:integer))) :a\n"940                + "  )\n" + ')';941        String conclusion = "";942        String id = "Different_types_in_Datatype_Restrictions_and_Complement";943        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");944        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.";945        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);946        r.setReasonerFactory(factory());947        r.run();948    }949    @Test950    public void testinconsistent_integer_filler() {951        String premise = "Prefix(:=<http://example.org/>)\n"952                + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"953                + "Ontology(\n"954                + "  Declaration(NamedIndividual(:a))\n"955                + "  Declaration(DataProperty(:hasAge))\n"956                + "  Declaration(Class(:Eighteen))\n"957                + "  SubClassOf(DataHasValue(:hasAge \"18\"^^xsd:integer) :Eighteen) \n"958                + "  ClassAssertion(DataHasValue(:hasAge \"18\"^^xsd:integer) :a) \n"959                + "  ClassAssertion(ObjectComplementOf(:Eighteen) :a)\n" + ')';960        String conclusion = "";961        String id = "inconsistent_integer_filler";962        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");963        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.";964        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);965        r.setReasonerFactory(factory());966        r.run();967    }968    @Test969    public void testDisjointClasses_001() {970        String premise = "<?xml version=\"1.0\"?>\n"971                + "<rdf:RDF\n"972                + "  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"973                + '\n'974                + "<owl:Ontology/>\n"975                + '\n'976                + "<owl:Class rdf:about=\"Boy\" />\n"977                + "<owl:Class rdf:about=\"Girl\" />\n"978                + '\n'979                + "<rdf:Description rdf:about=\"Boy\">\n"980                + "  <owl:disjointWith rdf:resource=\"Girl\" /></rdf:Description>\n"981                + '\n' + "<Boy rdf:about=\"Stewie\" />\n" + "</rdf:RDF>";982        String conclusion = "<?xml version=\"1.0\"?>\n"983                + "<rdf:RDF\n"984                + "  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"985                + '\n'986                + "<owl:Ontology/>\n"987                + '\n'988                + "<owl:Class rdf:about=\"Girl\" />\n"989                + '\n'990                + "<rdf:Description rdf:about=\"Stewie\">\n"991                + "  <rdf:type>\n"992                + "    <owl:Class>\n"993                + "      <owl:complementOf rdf:resource=\"Girl\" /></owl:Class></rdf:type>\n"994                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";995        String id = "DisjointClasses_001";996        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");997        String d = "Demonstrates a binary disjoint classes axiom based on example in the Structural Specification and Functional-Style Syntax document.";998        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);999        r.setReasonerFactory(factory());1000        r.run();1001    }1002    @Test1003    public void testDisjointClasses_002() {1004        String premise = "<?xml version=\"1.0\"?>\n"1005                + "<rdf:RDF\n"1006                + "  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"1007                + '\n'1008                + "<owl:Ontology/>\n"1009                + '\n'1010                + "<owl:Class rdf:about=\"Boy\" />\n"1011                + "<owl:Class rdf:about=\"Girl\" />\n"1012                + '\n'1013                + "<rdf:Description rdf:about=\"Boy\">\n"1014                + "  <owl:disjointWith rdf:resource=\"Girl\" /></rdf:Description>\n"1015                + '\n' + "<Boy rdf:about=\"Stewie\" />\n"1016                + "<Girl rdf:about=\"Stewie\" />\n" + '\n' + "</rdf:RDF>";1017        String conclusion = "";1018        String id = "DisjointClasses_002";1019        TestClasses tc = TestClasses.valueOf("INCONSISTENCY");1020        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.";1021        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);1022        r.setReasonerFactory(factory());1023        r.run();1024    }1025    @Test1026    public void testDisjointClasses_003() {1027        String premise = "<?xml version=\"1.0\"?>\n"1028                + "<rdf:RDF\n"1029                + "  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"1030                + '\n' + "<owl:Ontology/>\n" + '\n'1031                + "<owl:Class rdf:about=\"Boy\" />\n"1032                + "<owl:Class rdf:about=\"Girl\" />\n"1033                + "<owl:Class rdf:about=\"Dog\" />\n" + '\n'1034                + "<owl:AllDisjointClasses>\n"1035                + "  <owl:members rdf:parseType=\"Collection\">\n"1036                + "    <rdf:Description rdf:about=\"Boy\" />\n"1037                + "    <rdf:Description rdf:about=\"Girl\" />\n"1038                + "    <rdf:Description rdf:about=\"Dog\" />\n"1039                + "  </owl:members></owl:AllDisjointClasses>\n" + '\n'1040                + "<Boy rdf:about=\"Stewie\" />\n" + '\n' + "</rdf:RDF>";1041        String conclusion = "<?xml version=\"1.0\"?>\n"1042                + "<rdf:RDF\n"1043                + "  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"1044                + '\n'1045                + "<owl:Ontology/>\n"1046                + '\n'1047                + "<owl:Class rdf:about=\"Girl\" />\n"1048                + "<owl:Class rdf:about=\"Dog\" />\n"1049                + '\n'1050                + "<rdf:Description rdf:about=\"Stewie\">\n"1051                + "  <rdf:type>\n"1052                + "    <owl:Class>\n"1053                + "      <owl:complementOf rdf:resource=\"Girl\" /></owl:Class></rdf:type>\n"1054                + "</rdf:Description>\n"1055                + '\n'1056                + "<rdf:Description rdf:about=\"Stewie\">\n"1057                + "  <rdf:type>\n"1058                + "    <owl:Class>\n"1059                + "      <owl:complementOf rdf:resource=\"Dog\" /></owl:Class></rdf:type>\n"1060                + "</rdf:Description>\n" + '\n' + "</rdf:RDF>";1061        String id = "DisjointClasses_003";1062        TestClasses tc = TestClasses.valueOf("POSITIVE_IMPL");1063        String d = "A modification of test DisjointClasses-001 to demonstrate a ternary disjoint classes axiom.";1064        JUnitRunner r = new JUnitRunner(premise, conclusion, id, tc, d);1065        r.setReasonerFactory(factory());1066        r.run();1067    }1068}...

Full Screen

Full Screen

Source:NewFeaturesTestCase.java Github

copy

Full Screen

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

Full Screen

Full Screen

Source:NewFeatures.java Github

copy

Full Screen

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

Full Screen

Full Screen

Source:SupervisorTest.java Github

copy

Full Screen

...11import java.util.Properties;12import static com.blazemeter.taurus.junit.CustomRunnerTest.getLinesCount;13@Category(TestCategory.class)14public class SupervisorTest extends TestCase {15    public void testDelayCalculation() throws Exception {16        File report = File.createTempFile("report", ".ldjson");17        report.deleteOnExit();18        Properties props = new Properties();19        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());20        props.setProperty(CustomRunner.HOLD, String.valueOf(5));21        props.setProperty(CustomRunner.ITERATIONS, String.valueOf(0));22        props.setProperty(CustomRunner.CONCURRENCY, String.valueOf(10));23        props.setProperty(CustomRunner.RAMP_UP, String.valueOf(14));24        props.setProperty(CustomRunner.STEPS, String.valueOf(3));25        Supervisor supervisor = new Supervisor(props);26        // step 127        assertEquals(0, supervisor.getWorkerDelay(0));28        assertEquals(0, supervisor.getWorkerDelay(3));29        // step 230        assertEquals(4, supervisor.getWorkerDelay(4));31        assertEquals(4, supervisor.getWorkerDelay(6));32        // step 333        assertEquals(9, supervisor.getWorkerDelay(7));34        assertEquals(9, supervisor.getWorkerDelay(9));35        // new case36        props.setProperty(CustomRunner.CONCURRENCY, String.valueOf(400));37        props.setProperty(CustomRunner.RAMP_UP, String.valueOf(200));38        props.setProperty(CustomRunner.STEPS, String.valueOf(4));39        supervisor = new Supervisor(props);40        // step 141        assertEquals(0, supervisor.getWorkerDelay(0));42        assertEquals(0, supervisor.getWorkerDelay(99));43        // step 244        assertEquals(50, supervisor.getWorkerDelay(100));45        assertEquals(50, supervisor.getWorkerDelay(199));46        // step 347        assertEquals(100, supervisor.getWorkerDelay(200));48        assertEquals(100, supervisor.getWorkerDelay(299));49        // step 450        assertEquals(150, supervisor.getWorkerDelay(300));51        assertEquals(150, supervisor.getWorkerDelay(399));52        // new case53        props.setProperty(CustomRunner.CONCURRENCY, String.valueOf(10));54        props.setProperty(CustomRunner.RAMP_UP, String.valueOf(0));55        props.setProperty(CustomRunner.STEPS, String.valueOf(4));56        supervisor = new Supervisor(props);57        assertEquals(0, supervisor.getWorkerDelay(0));58        assertEquals(0, supervisor.getWorkerDelay(5));59        assertEquals(0, supervisor.getWorkerDelay(9));60        // new case61        props.setProperty(CustomRunner.CONCURRENCY, String.valueOf(10));62        props.setProperty(CustomRunner.RAMP_UP, String.valueOf(50));63        props.setProperty(CustomRunner.STEPS, String.valueOf(1));64        supervisor = new Supervisor(props);65        assertEquals(0, supervisor.getWorkerDelay(0));66        assertEquals(0, supervisor.getWorkerDelay(9));67        props.setProperty(CustomRunner.STEPS, "-10");68        supervisor = new Supervisor(props);69        assertEquals(0, supervisor.getWorkerDelay(4));70    }71    public void testDelayCalculationWithoutSteps() throws Exception {72        File report = File.createTempFile("report", ".ldjson");73        report.deleteOnExit();74        Properties props = new Properties();75        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());76        props.setProperty(CustomRunner.HOLD, String.valueOf(5));77        props.setProperty(CustomRunner.ITERATIONS, String.valueOf(0));78        props.setProperty(CustomRunner.CONCURRENCY, String.valueOf(5));79        props.setProperty(CustomRunner.RAMP_UP, String.valueOf(10));80        Supervisor supervisor = new Supervisor(props);81        assertEquals(0, supervisor.getWorkerDelay(0));82        assertEquals(2, supervisor.getWorkerDelay(1));83        assertEquals(4, supervisor.getWorkerDelay(2));84        assertEquals(7, supervisor.getWorkerDelay(3));85        assertEquals(9, supervisor.getWorkerDelay(4));86    }87    public void testFailedToCreateReporter() throws IOException {88        File report = File.createTempFile("report", ".ldjson");89        report.setWritable(false);90        report.deleteOnExit();91        Properties properties = new Properties();92        properties.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());93        try {94            new Supervisor(properties);95            fail("failed to create reporter");96        } catch (CustomRunnerException e) {97            assertEquals("Failed to create reporter", e.getMessage());98        }99    }100    public void testHold() throws Exception {101        File report = File.createTempFile("report", ".ldjson");102        report.deleteOnExit();103        Properties props = new Properties();104        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());105        props.setProperty(CustomRunner.HOLD, String.valueOf(5));106        Supervisor supervisor = new Supervisor(props) {107            @Override108            protected Worker createWorker(int workerId) {109                return new Worker(properties, reporter, counter, getWorkerDelay(workerId), iterations) {110                    @Override111                    protected JUnitRunner getJUnitRunner(String junitVersion) {112                        return new TestJUnitRunner();113                    }114                };115            }116        };117        supervisor.execute();118        assertTrue(2 < getLinesCount(report));119    }120    public void testHoldAndIterations() throws Exception {121        File report = File.createTempFile("report", ".ldjson");122        report.deleteOnExit();123        Properties props = new Properties();124        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());125        props.setProperty(CustomRunner.HOLD, String.valueOf(5));126        props.setProperty(CustomRunner.ITERATIONS, String.valueOf(1));127        Supervisor supervisor = new Supervisor(props) {128            @Override129            protected Worker createWorker(int workerId) {130                return new Worker(properties, reporter, counter, getWorkerDelay(workerId), iterations) {131                    @Override132                    protected JUnitRunner getJUnitRunner(String junitVersion) {133                        return new TestJUnitRunner();134                    }135                };136            }137        };138        supervisor.execute();139        assertEquals(1, getLinesCount(report));140    }141    public void testIterations() throws Exception {142        File report = File.createTempFile("report", ".ldjson");143        report.deleteOnExit();144        Properties props = new Properties();145        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());146        props.setProperty(CustomRunner.ITERATIONS, String.valueOf(3));147        Supervisor supervisor = new Supervisor(props) {148            @Override149            protected Worker createWorker(int workerId) {150                return new Worker(properties, reporter, counter, getWorkerDelay(workerId), iterations) {151                    @Override152                    protected JUnitRunner getJUnitRunner(String junitVersion) {153                        return new TestJUnitRunner();154                    }155                };156            }157        };158        supervisor.execute();159        assertEquals(3, getLinesCount(report));160    }161    public void testMain() throws Exception {162        File report = File.createTempFile("report", ".ldjson");163        report.deleteOnExit();164        Properties props = new Properties();165        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());166        Supervisor supervisor = new Supervisor(props) {167            @Override168            protected Worker createWorker(int workerId) {169                return new Worker(properties, reporter, counter, getWorkerDelay(workerId), iterations) {170                    @Override171                    protected JUnitRunner getJUnitRunner(String junitVersion) {172                        return new TestJUnitRunner();173                    }174                };175            }176        };177        supervisor.execute();178        assertEquals(1, getLinesCount(report));179    }180    public void testConcurrency() throws Exception {181        File report = File.createTempFile("report", ".csv");182        report.deleteOnExit();183        Properties props = new Properties();184        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());185        props.setProperty(CustomRunner.CONCURRENCY, "10");186        props.setProperty(CustomRunner.ITERATIONS, "5");187        Supervisor supervisor = new Supervisor(props) {188            @Override189            protected Worker createWorker(int workerId) {190                return new Worker(properties, reporter, counter, getWorkerDelay(workerId), iterations) {191                    @Override192                    protected JUnitRunner getJUnitRunner(String junitVersion) {193                        return new TestJUnitRunner();194                    }195                };196            }197        };198        supervisor.execute();199        assertEquals(51, getLinesCount(report)); // 5 * 10 - reports line + header200    }201    public void testRampUp() throws Exception {202        File report = File.createTempFile("report", ".ldjson");203        report.deleteOnExit();204        Properties props = new Properties();205        props.setProperty(CustomRunner.REPORT_FILE, report.getAbsolutePath());206        props.setProperty(CustomRunner.ITERATIONS, String.valueOf(5));207        props.setProperty(CustomRunner.RAMP_UP, String.valueOf(3));208        props.setProperty(CustomRunner.CONCURRENCY, String.valueOf(3));209        Supervisor supervisor = new Supervisor(props) {210            @Override211            protected Worker createWorker(int workerId) {212                return new Worker(properties, reporter, counter, getWorkerDelay(workerId), iterations) {213                    @Override214                    protected JUnitRunner getJUnitRunner(String junitVersion) {215                        return new TestJUnitRunner();216                    }217                };218            }219        };220        supervisor.execute();221        assertTrue(3 < getLinesCount(report));222    }223}...

Full Screen

Full Screen

Source:JUnitCore.java Github

copy

Full Screen

...28     * stack traces for all failed tests after the tests all complete.29     *30     * @param args names of classes in which to find tests to run31     */32    public static void main(String... args) {33        Result result = new JUnitCore().runMain(new RealSystem(), args);34        System.exit(result.wasSuccessful() ? 0 : 1);35    }36    /**37     * Run the tests contained in <code>classes</code>. Write feedback while the tests38     * are running and write stack traces for all failed tests after all tests complete. This is39     * similar to {@link #main(String[])}, but intended to be used programmatically.40     *41     * @param classes Classes in which to find tests42     * @return a {@link Result} describing the details of the test run and the failed tests.43     */44    public static Result runClasses(Class<?>... classes) {45        return runClasses(defaultComputer(), classes);46    }47    /**48     * Run the tests contained in <code>classes</code>. Write feedback while the tests49     * are running and write stack traces for all failed tests after all tests complete. This is50     * similar to {@link #main(String[])}, but intended to be used programmatically.51     *52     * @param computer Helps construct Runners from classes53     * @param classes  Classes in which to find tests54     * @return a {@link Result} describing the details of the test run and the failed tests.55     */56    public static Result runClasses(Computer computer, Class<?>... classes) {57        return new JUnitCore().run(computer, classes);58    }59    /**60     * @param system61     * @param args from main()62     */63    Result runMain(JUnitSystem system, String... args) {64        system.out().println("JUnit version " + Version.id());65        JUnitCommandLineParseResult jUnitCommandLineParseResult = JUnitCommandLineParseResult.parse(args);66        RunListener listener = new TextListener(system);67        addListener(listener);68        return run(jUnitCommandLineParseResult.createRequest(defaultComputer()));69    }70    /**71     * @return the version number of this release72     */73    public String getVersion() {74        return Version.id();75    }76    /**77     * Run all the tests in <code>classes</code>.78     *79     * @param classes the classes containing tests80     * @return a {@link Result} describing the details of the test run and the failed tests.81     */82    public Result run(Class<?>... classes) {83        return run(defaultComputer(), classes);84    }85    /**86     * Run all the tests in <code>classes</code>.87     *88     * @param computer Helps construct Runners from classes89     * @param classes the classes containing tests90     * @return a {@link Result} describing the details of the test run and the failed tests.91     */92    public Result run(Computer computer, Class<?>... classes) {93        return run(Request.classes(computer, classes));94    }95    /**96     * Run all the tests contained in <code>request</code>.97     *98     * @param request the request describing tests99     * @return a {@link Result} describing the details of the test run and the failed tests.100     */101    public Result run(Request request) {102        return run(request.getRunner());103    }104    /**105     * Run all the tests contained in JUnit 3.8.x <code>test</code>. Here for backward compatibility.106     *107     * @param test the old-style test108     * @return a {@link Result} describing the details of the test run and the failed tests.109     */110    public Result run(junit.framework.Test test) {111        return run(new JUnit38ClassRunner(test));112    }113    /**114     * Do not use. Testing purposes only.115     */116    public Result run(Runner runner) {117        Result result = new Result();118        RunListener listener = result.createListener();119        notifier.addFirstListener(listener);120        try {121            notifier.fireTestRunStarted(runner.getDescription());122            runner.run(notifier);123            notifier.fireTestRunFinished(result);124        } finally {125            removeListener(listener);126        }127        return result;128    }129    /**130     * Add a listener to be notified as the tests run.131     *132     * @param listener the listener to add133     * @see org.junit.runner.notification.RunListener134     */135    public void addListener(RunListener listener) {136        notifier.addListener(listener);137    }138    /**139     * Remove a listener.140     *141     * @param listener the listener to remove142     */143    public void removeListener(RunListener listener) {144        notifier.removeListener(listener);145    }146    static Computer defaultComputer() {147        return new Computer();148    }149}...

Full Screen

Full Screen

Source:File_11973.java Github

copy

Full Screen

...28     * stack traces for all failed tests after the tests all complete.29     *30     * @param args names of classes in which to find tests to run31     */32    public static void main(String... args) {33        Result result = new JUnitCore().runMain(new RealSystem(), args);34        System.exit(result.wasSuccessful() ? 0 : 1);35    }36    /**37     * Run the tests contained in <code>classes</code>. Write feedback while the tests38     * are running and write stack traces for all failed tests after all tests complete. This is39     * similar to {@link #main(String[])}, but intended to be used programmatically.40     *41     * @param classes Classes in which to find tests42     * @return a {@link Result} describing the details of the test run and the failed tests.43     */44    public static Result runClasses(Class<?>... classes) {45        return runClasses(defaultComputer(), classes);46    }47    /**48     * Run the tests contained in <code>classes</code>. Write feedback while the tests49     * are running and write stack traces for all failed tests after all tests complete. This is50     * similar to {@link #main(String[])}, but intended to be used programmatically.51     *52     * @param computer Helps construct Runners from classes53     * @param classes  Classes in which to find tests54     * @return a {@link Result} describing the details of the test run and the failed tests.55     */56    public static Result runClasses(Computer computer, Class<?>... classes) {57        return new JUnitCore().run(computer, classes);58    }59    /**60     * @param system61     * @param args from main()62     */63    Result runMain(JUnitSystem system, String... args) {64        system.out().println("JUnit version " + Version.id());65        JUnitCommandLineParseResult jUnitCommandLineParseResult = JUnitCommandLineParseResult.parse(args);66        RunListener listener = new TextListener(system);67        addListener(listener);68        return run(jUnitCommandLineParseResult.createRequest(defaultComputer()));69    }70    /**71     * @return the version number of this release72     */73    public String getVersion() {74        return Version.id();75    }76    /**77     * Run all the tests in <code>classes</code>.78     *79     * @param classes the classes containing tests80     * @return a {@link Result} describing the details of the test run and the failed tests.81     */82    public Result run(Class<?>... classes) {83        return run(defaultComputer(), classes);84    }85    /**86     * Run all the tests in <code>classes</code>.87     *88     * @param computer Helps construct Runners from classes89     * @param classes the classes containing tests90     * @return a {@link Result} describing the details of the test run and the failed tests.91     */92    public Result run(Computer computer, Class<?>... classes) {93        return run(Request.classes(computer, classes));94    }95    /**96     * Run all the tests contained in <code>request</code>.97     *98     * @param request the request describing tests99     * @return a {@link Result} describing the details of the test run and the failed tests.100     */101    public Result run(Request request) {102        return run(request.getRunner());103    }104    /**105     * Run all the tests contained in JUnit 3.8.x <code>test</code>. Here for backward compatibility.106     *107     * @param test the old-style test108     * @return a {@link Result} describing the details of the test run and the failed tests.109     */110    public Result run(junit.framework.Test test) {111        return run(new JUnit38ClassRunner(test));112    }113    /**114     * Do not use. Testing purposes only.115     */116    public Result run(Runner runner) {117        Result result = new Result();118        RunListener listener = result.createListener();119        notifier.addFirstListener(listener);120        try {121            notifier.fireTestRunStarted(runner.getDescription());122            runner.run(notifier);123            notifier.fireTestRunFinished(result);124        } finally {125            removeListener(listener);126        }127        return result;128    }129    /**130     * Add a listener to be notified as the tests run.131     *132     * @param listener the listener to add133     * @see org.junit.runner.notification.RunListener134     */135    public void addListener(RunListener listener) {136        notifier.addListener(listener);137    }138    /**139     * Remove a listener.140     *141     * @param listener the listener to remove142     */143    public void removeListener(RunListener listener) {144        notifier.removeListener(listener);145    }146    static Computer defaultComputer() {147        return new Computer();148    }149}...

Full Screen

Full Screen

id

Using AI Code Generation

copy

Full Screen

1package com.example;2import junit.runner.Version;3public class JunitVersion {4    public static void main(String[] args) {5        System.out.println("Version of Junit is: " + Version.id());6    }7}8JUnit | @RunWith(Parameterized.class)9JUnit | @RunWith(Suite.class)10JUnit | @RunWith(SpringRunner.class)

Full Screen

Full Screen

id

Using AI Code Generation

copy

Full Screen

1import org.junit.runner.Version;2public class JUnitVersion {3    public static void main(String[] args) {4        System.out.println(Version.id());5    }6}

Full Screen

Full Screen

id

Using AI Code Generation

copy

Full Screen

1import junit.runner.Version;2public class Test {3    public static void main(String[] args) {4        System.out.println(Version.id());5    }6}7import junit.runner.Version;8public class Test {9    public static void main(String[] args) {10        System.out.println(Version.id());11    }12}13import junit.runner.Version;14public class Test {15    public static void main(String[] args) {16        System.out.println(Version.id());17    }18}19import junit.runner.Version;20public class Test {21    public static void main(String[] args) {22        System.out.println(Version.id());23    }24}25import junit.runner.Version;26public class Test {27    public static void main(String[] args) {28        System.out.println(Version.id());29    }30}31import junit.runner.Version;32public class Test {33    public static void main(String[] args) {34        System.out.println(Version.id());35    }36}37import junit.runner.Version;38public class Test {39    public static void main(String[] args) {40        System.out.println(Version.id());41    }42}43import junit.runner.Version;44public class Test {45    public static void main(String[] args) {46        System.out.println(Version.id());47    }48}49import junit.runner.Version;50public class Test {51    public static void main(String[] args) {52        System.out.println(Version.id());53    }54}55import junit.runner.Version;56public class Test {

Full Screen

Full Screen

id

Using AI Code Generation

copy

Full Screen

1import org.junit.runner.Version;2System.out.println("junit version = " + Version.id());3import org.junit.runner.Version;4System.out.println("junit version = " + Version.id());5import org.junit.runner.Version;6System.out.println("junit version = " + Version.id());7import org.junit.runner.Version;8System.out.println("junit version = " + Version.id());9import org.junit.runner.Version;10System.out.println("junit version = " + Version.id());11import org.junit.runner.Version;12System.out.println("junit version = " + Version.id());13import org.junit.runner.Version;14System.out.println("junit version = " + Version.id());15import org.junit.runner.Version;16System.out.println("junit version = " + Version.id());17import org.junit.runner.Version;18System.out.println("junit version = " + Version.id());19import org.junit.runner.Version;20System.out.println("junit version = " + Version.id());

Full Screen

Full Screen

id

Using AI Code Generation

copy

Full Screen

1import junit.runner.Version;2import java.io.PrintStream;3import java.io.OutputStream;4import java.io.IOException;5import java.io.ByteArrayOutputStream;6public class JunitVersion {7    public static void main(String[] args) {8        String version = Version.id();9        System.out.println(version);10    }11}12import org.junit.runner.JUnitCore;13import org.junit.runner.Result;14import org.junit.runner.notification.Failure;15import org.junit.Test;16import static org.junit.Assert.assertEquals;17public class MyTest {18    public void testAdd() {19        String str = "JUnit is working fine";20        assertEquals("JUnit is working fine", str);21    }22    public static void main(String[] args) {23        Result result = JUnitCore.runClasses(MyTest.class);24        for (Failure failure : result.getFailures()) {25            System.out.println(failure.toString());26        }27        System.out.println(result.wasSuccessful());28    }29}30$ javac -cp .;junit-4.13.jar;hamcrest-core-1.3.jar MyTest.java31$ java -cp .;junit-4.13.jar;hamcrest-core-1.3.jar MyTest32import org.junit.runner.JUnitCore;33import org.junit.runner.Result;34import org.junit.runner.notification.Failure;35import org.junit.Test;36import static org.junit.Assert.assertEquals;37public class MyTest2 {38    public void testAdd() {39        String str = "JUnit is working fine";40        assertEquals("JUnit is working fine", str);41    }42    public static void main(String[] args) {43        Result result = JUnitCore.runClasses(MyTest2.class);44        for (Failure failure : result.getFailures()) {45            System.out.println(failure.toString());46        }47        System.out.println(result.wasSuccessful());48    }49}50$ javac -cp .;junit-4.13.jar;hamcrest-core-1.3.jar

Full Screen

Full Screen

id

Using AI Code Generation

copy

Full Screen

1import junit.runner.Version;2System.out.println("junit version: " + Version.id());3import junit.runner.Version;4System.out.println("junit version: " + Version.id());5import junit.runner.Version;6System.out.println("junit version: " + Version.id());7import junit.runner.Version;8System.out.println("junit version: " + Version.id());9import junit.runner.Version;10System.out.println("junit version: " + Version.id());11import junit.runner.Version;12System.out.println("junit version: " + Version.id());13import junit.runner.Version;14System.out.println("junit version: " + Version.id());15import junit.runner.Version;16System.out.println("junit version: " + Version.id());17import junit.runner.Version;18System.out.println("junit version: " + Version.id());19import junit.runner.Version;20System.out.println("junit version: " + Version.id());

Full Screen

Full Screen

JUnit Tutorial:

LambdaTest also has a detailed JUnit tutorial explaining its features, importance, advanced use cases, best practices, and more to help you get started with running your automation testing scripts.

JUnit Tutorial Chapters:

Here are the detailed JUnit testing chapters to help you get started:

  • Importance of Unit testing - Learn why Unit testing is essential during the development phase to identify bugs and errors.
  • Top Java Unit testing frameworks - Here are the upcoming JUnit automation testing frameworks that you can use in 2023 to boost your unit testing.
  • What is the JUnit framework
  • Why is JUnit testing important - Learn the importance and numerous benefits of using the JUnit testing framework.
  • Features of JUnit - Learn about the numerous features of JUnit and why developers prefer it.
  • JUnit 5 vs. JUnit 4: Differences - Here is a complete comparison between JUnit 5 and JUnit 4 testing frameworks.
  • Setting up the JUnit environment - Learn how to set up your JUnit testing environment.
  • Getting started with JUnit testing - After successfully setting up your JUnit environment, this chapter will help you get started with JUnit testing in no time.
  • Parallel testing with JUnit - Parallel Testing can be used to reduce test execution time and improve test efficiency. Learn how to perform parallel testing with JUnit.
  • Annotations in JUnit - When writing automation scripts with JUnit, we can use JUnit annotations to specify the type of methods in our test code. This helps us identify those methods when we run JUnit tests using Selenium WebDriver. Learn in detail what annotations are in JUnit.
  • Assertions in JUnit - Assertions are used to validate or test that the result of an action/functionality is the same as expected. Learn in detail what assertions are and how to use them while performing JUnit testing.
  • Parameterization in JUnit - Parameterized Test enables you to run the same automated test scripts with different variables. By collecting data on each method's test parameters, you can minimize time spent on writing tests. Learn how to use parameterization in JUnit.
  • Nested Tests In JUnit 5 - A nested class is a non-static class contained within another class in a hierarchical structure. It can share the state and setup of the outer class. Learn about nested annotations in JUnit 5 with examples.
  • Best practices for JUnit testing - Learn about the best practices, such as always testing key methods and classes, integrating JUnit tests with your build, and more to get the best possible results.
  • Advanced Use Cases for JUnit testing - Take a deep dive into the advanced use cases, such as how to run JUnit tests in Jupiter, how to use JUnit 5 Mockito for Unit testing, and more for JUnit testing.

JUnit Certification:

You can also check out our JUnit certification if you wish to take your career in Selenium automation testing with JUnit to the next level.

Run junit automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in Version

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful