performing sparql query on the rdf data stored in relational database

我是研究僧i 提交于 2019-12-13 04:33:34

问题


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


来源:https://stackoverflow.com/questions/30492870/performing-sparql-query-on-the-rdf-data-stored-in-relational-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!