Querying Dbpedia by DBO - SPARQL

偶尔善良 提交于 2019-12-02 15:36:00

问题


I am trying to extract the manufacturer section of this dbpedia page http://dbpedia.org/page/Diageo. However my SPARQL query returns nothing. Yet I can return most other values on the page, such as keyPersons which has the exact same layout.

PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT ?label
WHERE { <http://dbpedia.org/resource/Diageo>
        dbpedia-owl:keyPerson ?label }

PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT ?label
WHERE { <http://dbpedia.org/resource/Diageo>
        dbpedia-owl:manufacturer ?label }

Any ideas?


回答1:


In DBpedia, an entity page displays statements in which an entity may be not only a subject, but also an object. In the latter case, respective property appears as "is ... of".

Conversely, the page you have linked to says that dbr:Diageo is dbo:manufacturer of dbr:Johnnie_Walker etc. This means that dbr:Johnnie_Walker dbo:manufacturer dbr:Diageo holds, not that dbr:Diageo dbo:manufacturer dbr:Johnnie_Walker does.

By the way, rdfs:range of dbo:manufacturer is dbo:Organization.

Thus, you should looking for triples that match reversed pattern:

SELECT * WHERE { ?variable dbo:manufacturer ?dbr:Diageo . }

Or, using property paths:

SELECT * WHERE { dbr:Diageo ^dbo:manufacturer ?variable . }

Try it on DBpedia



来源:https://stackoverflow.com/questions/49152535/querying-dbpedia-by-dbo-sparql

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