Daniel
Daniel

Reputation: 6039

Query both DBPedia and Wikidata at the same time?

Is there a way to query both DBPedia and Wikidata at the same time? Like any way to query all the people in DBPedia and Wikidata at the same time?

PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX dbo: <http://dbpedia.org/ontology/> 

{ SELECT ?person WHERE { ?person wdt:P31 wd:Q5 } limit 100 }
UNION 
{ SELECT * { ?person a dbo:Person } }

Try here

Upvotes: 1

Views: 894

Answers (1)

Daniel
Daniel

Reputation: 6039

Thanks to @AKSW I got the answer to my question.

The Federated SPARQL queries would do the trick:

PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX dbo: <http://dbpedia.org/ontology/> 

SELECT ?person WHERE { 
  SERVICE <http://dbpedia.org/sparql> {?person a dbo:Person }
  SERVICE <https://query.wikidata.org/sparql> { ?person wdt:P31 wd:Q5 }
} LIMIT 100 

try here

Upvotes: 2

Related Questions