Getting a list of American physicists from DBpedia using SPARQL

ぃ、小莉子 提交于 2019-12-07 03:50:35

问题


I want to query the American Physicsts and get the list of physicists. How can I do this?


回答1:


The SPARQL you need would look like this ....

PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT *
WHERE {
  ?s dcterms:subject category:American_physicists .
}

see results here

If you want the list with some extra predicates you need to join more triple patterns using the variable ?s. For instance, to retrieve the birthdate for each physicist ...

PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>

SELECT *
WHERE {
  ?s dcterms:subject category:American_physicists .
  ?s dbpedia:birthDate ?bithdate .
}

results here



来源:https://stackoverflow.com/questions/7419320/getting-a-list-of-american-physicists-from-dbpedia-using-sparql

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