On 22.05.2015 05:32, Ricordisamoa wrote:
I don't think the information you're looking for is available for direct queries. If you need data about a predetermined set of items, just use the official Wikidata API: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q107146&.... For a SQL-like syntax, Wikidata Query https://wdq.wmflabs.org comes in handy.
If you want full statements with all details (including references, ranks, etc.), then you can also try some of the available SPARQL endpoints. See https://www.wikidata.org/wiki/Wikidata:Data_access These services are still experimental and in particular the RDF encoding will change, but the general infrastructure behind this should remain similar and service will improve further over time. So it might be worth to learn about it. Eventually this should give you random access to all data in Wikidata in real time.
Regards,
Markus
Il 22/05/2015 05:15, Raymond Yee ha scritto:
Is it possible to get claims made in Wikidata using the SQL interface to the replicas of the production databases run by Wikimedia Labs (https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Database)?
I see on http://quarry.wmflabs.org/ (a service to "Run SQL queries against Wikipedia & other databases from your browser!") queries involving the wikidatawiki_p database -- e.g., http://quarry.wmflabs.org/query/3152. But I've not been able to find queries that pull out values for Wikidata claims.
To provide a concrete example, can one write a SQL query on the Wikimedia databases to return claims about the population of Alameda County, California (https://www.wikidata.org/wiki/Q107146), which was specifically, 1,510,271 in the 2010 census?
P1082 (https://www.wikidata.org/wiki/Property:P1082) is the population properly. In https://www.wikidata.org/wiki/Special:EntityData/Q107146.json, we see the following json fragment:
P1082: [ { id: "Q107146$8938463B-C469-4162-80F7-96DDDE1429DD", mainsnak: { snaktype: "value", property: "P1082", datatype: "quantity", datavalue: { value: { amount: "+1510271", unit: "1", upperBound: "+1510271", lowerBound: "+1510271" }, type: "quantity" } } ... } ] },
I've looked through the tables in wikidatawiki_p but can't find any table that has the claim data.
So I suspect the answer is no -- that although there's lot of metadata about Wikidata available to SQL queries on the replicas. (SQL not mentioned in https://www.wikidata.org/wiki/Wikidata:Data_access). Is this correct?
Thanks, -Raymond
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata