Re: Accessing inferences and asserstions rather than just assertions
Posted by
Jiba on
URL: http://owlready.306.s1.nabble.com/Accessing-inferences-and-asserstions-rather-than-just-assertions-tp144p146.html
I've just tested using a very simple script (see below), but it seems to work as expected.
Are you sure the problem is not somewhere else?
-----8<-----------
from owlready2 import *
world = World()
world.get_ontology("file:///tmp/t.owl").load()
sync_reasoner(world)
graph = world.as_rdflib_graph()
request = """SELECT ?x WHERE {
?x <
http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <
http://www.semanticweb.org/jiba/ontologies/2018/1/untitled-ontology-40#C>
}
"""
results = list(graph.query(request))
print(results)
Tested with this ontology:
t.owl