interrogation .owl file through SPARQL in Python

17 views
Skip to first unread message

dme...@gmail.com

unread,
Jan 1, 2018, 9:21:15 AM1/1/18
to rdflib-dev
I am having trouble getting a sparql describe query to work. WHEn i have used the sample give not a result .


the program :

my_data ='c:/wamp/www/onto-hadith261117.owl'

import rdflib
import tempfile
import os
fd, file_name = tempfile.mkstemp()
f = os.fdopen(fd, 'w')
dummy = f.write(my_data) # Returns num bytes written on py3
f.close()
g = rdflib.Graph()
import rdflib

import xml.sax
from xml.sax.handler import ContentHandler,EntityResolver,DTDHandler
subjects= g.query(
"""
SELECT ?a ?b WHERE{ ?a rdfs:sugcghdbClassOf ?b } """)

print("sub",subjects)

execution result :

sub <rdflib.plugins.sparql.processor.SPARQLResult object at 0x03AB0C70>

Reply all
Reply to author
Forward
0 new messages