Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a list of American physicists from DBpedia using SPARQL

Tags:

sparql

dbpedia

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

like image 630
Tanmoy Avatar asked Sep 14 '11 15:09

Tanmoy


1 Answers

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

like image 149
Manuel Salvadores Avatar answered Sep 23 '22 15:09

Manuel Salvadores