Example #1
0
    def test_subclass_assertion_is_false(self, get_inferred_facts, add_facts,
                                         inference_init):
        facts = get_empty_graph()
        facts.add((URIRef(":Human"), RDFS.subClassOf, URIRef(":Mortal")))

        assertion = can_infer(self.EXPECTED_FACTS).from_facts(facts)
        self.assertFalse(assertion.assertion_value)
Example #2
0
    def test_subclass_assertion(self):
        facts = get_empty_graph()
        facts.add((URIRef(":Human"), RDFS.subClassOf, URIRef(":Mortal")))
        facts.add((URIRef(":Icaro"), RDF.type, URIRef(":Human")))

        expected_facts = get_empty_graph()
        expected_facts.add((URIRef(":Icaro"), RDF.type, URIRef(":Mortal")))
        expected_facts.add((URIRef(":Mortal"), RDF.type, OWL.Class))
        expected_facts.add((URIRef(":Human"), RDF.type, OWL.Class))

        assertion = can_infer(expected_facts).from_facts(facts)
        self.assertTrue(assertion.assertion_value)
 def test_check_expected_facts(self):
     EXPECTED_FACTS_FILE = "example/db/check_expected_facts/expected_facts.n3"
     ONTOLOGY_FILE = "example/db/check_expected_facts/ontology.n3"
     self.assert_that(can_infer(EXPECTED_FACTS_FILE).from_facts(ONTOLOGY_FILE))