1

I'm looking for a way to perform, with a single SPARQL query, a complete lookup of a Wikidata item and to return a JSON representation very similar to what Wikidata returns when you add .json to the entity URL (i.e. https://www.wikidata.org/wiki/Special:EntityData/Q42.json).

As you can see, each one of the claims already contains the qualifiers (e.g. start and end time for property P69).

I assume this can be done with a single SPARQL query, but despite having looked into the Wikidata model I still can't get it to work. I am able to select qualifiers for specific properties that I know in advance, like:

SELECT ?root ?s ?value ?q0
WHERE
{
    VALUES ?root { <http://www.wikidata.org/entity/Q42> } .
    ?root <http://www.wikidata.org/prop/P69> ?s .
    ?s <http://www.wikidata.org/prop/statement/P69> ?value .
    ?s <http://www.wikidata.org/prop/qualifier/P582> ?q0.  
} 

but can't find a way to select everything about a specific item at once.

The Coding Monk
  • 7,684
  • 12
  • 41
  • 56

0 Answers0