I am not 100% sure there is a perfect way to do what you want by querying the metadata databases (I assume that is what you mean with query)- I don't think that data is metadata, but content itself, which is not on the metadata databases.
Calling the wikidata query service is probably what you want:
< https://query.wikidata.org/#SELECT%20%3Fitem%20%3FitemLabel%20%3Fgeoname%0AW...
Note the LIMIT and OFFSET that will let you iterate over the dataset (a where close would be faster).
There is a way to get results, which is iterating over: < https://www.wikidata.org/w/index.php?title=Special:WhatLinksHere/Property:P1...
That is a standard mediawiki api query, you will also find this on the pagelinks table, but you should check every page you get afterwards (by retrieving its contents), as it could include false positives or be behind on updates.
On Sun, Mar 11, 2018 at 3:44 PM, Huji Lee huji.huji@gmail.com wrote:
Hello,
I need help writing a query that I would like to run on the Clouds. The goal of the query is to retrieve the following information from wikidatawiki_p:
- Find all pages that have a claim for the property P1566, for example see
https://www.wikidata.org/wiki/Q2113430
- Find out what is the value of their P1566 property (in this case, 18918)
Output format should be like this:
page_id entity property_value 2039804 Q2113430 18918 ...
Thanks in advance,
Huji
Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud