Hello,
I am trying to execute sparql queries. But whenever I try to execute the method
graph = my_world.as_rdflib_graph()
I immediately get an error:
ModuleNotFoundError: no module named 'rdflib'
I installed the latest version of owlready2 from Nov 7, 2019
Below is a screenshot of my code and the exact error message I get. Any ideas how I can fix this error.
Regards Marcel
image:
https://imgur.com/a/PyDzZxCcode:
from owlready2 import *
from time import sleep
my_world = World()
# onto = my_world.get_ontology("C:/Users/Mischo/Desktop/Backup/FTOnto/FTOnto.owl").load()
onto = my_world.get_ontology("
http://www.lesfleursdunormal.fr/static/_downloads/pizza_onto.owl").load()
sync_reasoner(my_world, keep_tmp_file=True)
print("reasoning successful")
sleep(1)
print("trying to create a graph")
graph = my_world.as_rdflib_graph()
request = """SELECT ?x ?y ?z WHERE {
?x ?y ?z .
}
"""
results = list(graph.query(request))
print(results)