I have stored large amount of RDF data into a relational database with the help of rdflib_sqlalchemy.SQLAlchemy.Now I want to execute Sparql query over the same.I can not find any thing to know how to implement sparql query here. Can anyone help.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Including sample code would make it easier to know what you are after but see the documentation on querying an RDFLib graph with SPARQL.
Using the example from the rdflib-sqlalchemy README where graph is the name of the open graph.
rq = "select ?s where {?s ?p ?o} limit 10"
results = graph.query(rq)
for row in results:
print row.s