I am learning how to use Quarry to query Wikidata data. I have written these two queries:
- Get the number of statements on a Wikidata item given its QID
- Get all revisions on a Wikidata item given its QID
I now want to write a SQL query that gets the current statements on a Wikidata item given its QID (the returned rows should be the same of those rows returned by this SPARQL query). This is my initial idea on how to do it: I know that the table revision
contains all the revisions on a given page and the table comment
contain information on the introduced changes, so one way to do what I want to do is to parse the column comment_text
(see an example in the results of query 2 above), which describes the changes, and determine the latest changes. I think this method is complex to implement using SQL since I need to determine which changes were not edited by any other other changes. I wonder if there's a simpler approach or a table that already contains the current statements on a Wikidata item.
I know that the current statements on a Wikidata item can be easily obtained in SPARQL (this query already does that), but since I'm learning how to query data in Quarry (i.e. using SQL), reading a SQL query that does that would help me to understand more about how data is stored and should be queried in Quarry.