Hello. I'm trying to run a quite simple query on WDQS. I would like to get all instances of cities in Germany:
http://tinyurl.com/kl9hvsh http://tinyurl.com/kl9hvsh
But there are a number of cities which I'm missing at the result … such as
https://www.wikidata.org/wiki/Q16085 https://www.wikidata.org/wiki/Q16085
THX
Michael
2017-03-25 23:46 GMT+01:00 Michael Riedel mailing@riddel.eu:
Hello. I'm trying to run a quite simple query on WDQS. I would like to get all instances of cities in Germany:
But there are a number of cities which I'm missing at the result … such as
https://www.wikidata.org/wiki/Q16085
THX
This result is to be expected : Neuruppin has the value "city" (and P17 and P625) but it has the value "municipality of Germany" with an higher rank. By default, the WDQS only take the higher rank.
Cdlt, ~nicolas
Neuruppin has two “instance of” statements: “city” and “municipality of Germany”. The second statement has preferred rank, and the first one has normal rank. The wdt: only includes “truthy” statements, that is, statements with the highest rank, and never statements of deprecated rank. The “municipality of Germany” statement has higher rank than the “city” statement, so Neuruppin is not wdt:P31 wd:Q515. In this case, you want to use the full statements: p: points at the statement node, and ps: points from there to the statement value, so the full path from Q16085 to Q515 is ?item p:P31/ps:P31 wd:Q515. Here’s the fixed query: http://tinyurl.com/k68skwt
Cheers, Lucas
On 25.03.2017 23:46, Michael Riedel wrote:
Hello. I'm trying to run a quite simple query on WDQS. I would like to get all instances of cities in Germany:
But there are a number of cities which I'm missing at the result … such as
https://www.wikidata.org/wiki/Q16085
THX
Michael
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Ok ... That make sense. Thank you.
Am 25.03.2017 um 23:55 schrieb Lucas Werkmeister mail@lucaswerkmeister.de:
Neuruppin has two “instance of” statements: “city” and “municipality of Germany”. The second statement has preferred rank, and the first one has normal rank. The wdt: only includes “truthy” statements, that is, statements with the highest rank, and never statements of deprecated rank. The “municipality of Germany” statement has higher rank than the “city” statement, so Neuruppin is not wdt:P31 wd:Q515. In this case, you want to use the full statements: p: points at the statement node, and ps: points from there to the statement value, so the full path from Q16085 to Q515 is ?item p:P31/ps:P31 wd:Q515. Here’s the fixed query: http://tinyurl.com/k68skwt http://tinyurl.com/k68skwt Cheers, Lucas
On 25.03.2017 23:46, Michael Riedel wrote:
Hello. I'm trying to run a quite simple query on WDQS. I would like to get all instances of cities in Germany:
http://tinyurl.com/kl9hvsh http://tinyurl.com/kl9hvsh
But there are a number of cities which I'm missing at the result … such as
https://www.wikidata.org/wiki/Q16085 https://www.wikidata.org/wiki/Q16085
THX
Michael
Wikidata mailing list Wikidata@lists.wikimedia.org mailto:Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata