interrogation file .owl (serialsé by RDF/XML) through sparql in Python

12 views
Skip to first unread message

dme...@gmail.com

unread,
Jan 1, 2018, 9:02:51 AM1/1/18
to rdflib-dev
I am having trouble getting a sparql describe query to work. when I have used a sample set from DBpedia.org, the program (below) has given a result, but when i have used sample in localhost the result conatin error.

the file (.owl) in the localhost : http://localhost/exemple.owl)
i defined the localhots like thise : command : c:/pyhon34/python -m http.server dans le repertoire c:/application wich contain the hhtp server.

the program :

from SPARQLWrapper import SPARQLWrapper, RDF, JSON, POST, SELECT
result= "http://localhost:8000";


sparql = SPARQLWrapper(result)
sparql.setQuery("""
SELECT ?a ?b WHERE{ ?a rdfs:subClassOf ?b }
""")
sparql.setReturnFormat(JSON)

results = sparql.query().convert()
print(results)

Reply all
Reply to author
Forward
0 new messages