Getting a list of American physicists from DBpedia

2019-04-28 21:53发布

问题:

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