I am a student and I'm learning to use sparql. I would like to query an endpoint by running the sparql query from GRAPHDB. So looking online I found that the solution is to use SERVICE with the endpoint link.
I have tried with the wikidata endpoint on GRAPHDB but the query result is empty.
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT
?partyLabel
WHERE {
SERVICE <https://query.wikidata.org/bigdata/namespace/categories/sparql> {
?party wdt:P31 wd:Q7278;
wdt:P17 wd:Q38.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}
LIMIT 5
However, the same query (without SERVICE) works on https://query.wikidata.org.
SELECT DISTINCT
?partyLabel
WHERE {
?party wdt:P31 wd:Q7278;
wdt:P17 wd:Q38.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 5
Surely I didn't understand how SERVICE works or something else, could you help me out? Thank you in advance