问题
Using the sparql query below, I successfully got some of soccer players informations, then I tried to retrieve wikipedia page-id with wikidata Item-id, but it returns an error (java.util.concurrent.TimeoutException):
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?Wikidata_id ?SoccerPlayerLabel ?Team ?TeamLabel ?numMatches ?numGoals ?startTime ?article ?wikipedia_id WHERE {
?Wikidata_id wdt:P106 wd:Q937857;
p:P54 ?stmt.
?stmt ps:P54 ?Team;
pq:P1350 ?numMatches;
pq:P1351 ?numGoals;
pq:P580 ?startTime .
filter not exists {?Wikidata_id p:P54/pq:P580 ?startTimeOther filter(?startTimeOther > ?startTime)}
FILTER(?startTime >= "2019-01-01T00:00:00Z"^^xsd:dateTime).
OPTIONAL { ?article schema:about ?Wikidata_id .
?article schema:isPartOf <https://en.wikipedia.org/> . }
SERVICE <http://dbpedia.org/sparql> {?dbpedia_id owl:sameAs ?Wikidata_id .?dbpedia_id dbo:wikiPageID ?wikipedia_id.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".} }
来源:https://stackoverflow.com/questions/60514757/get-wikipedia-id-page-using-wikidata-id