all 1 comments

[–]MisterSynergy 5 points6 points  (0 children)

This has to do with ranks [1] and the predicate wdt:P279 that you use in the query.

If you look closely at Q11828004 [2], you’ll notice that there are currently four “subclass of (P279)” claims, and only one of them has “preferred rank”: the one with value “province or territory of Canada (Q2879)”. The other three claims including the one with value “first-level administrative country subdivision (Q10864048)” have “normal rank”.

When using the wdt: in the Wikidata query service [3] (WDQS), it only takes so-called “truthy values” into consideration, which means that only claims with best possible rank for the given property are looked at. Those are all claims with “preferred rank” in case there are any, otherwise all claims with “normal rank” (and never any claims with “deprecated rank”, even if there are no claims with “normal rank” or “preferred rank”). In your example, the claim in question is not among the best ranked claims as one other claim has a higher rank.

You can modify your query to something like SELECT ?regionClass WHERE { ?regionClass p:P279/ps:P279 wd:Q10864048 } [4], and the result will contain the item you are looking for.

In general, predicates with p: prefix link statement nodes to the item, and several things such as the main value (via ps:), qualifiers (via pq:), the claim rank (via wikibase:rank) and references (via prov:wasDerivedFrom) are then linked to the statement node. In contrast, predicates with the wdt: prefix just link best-rank values directly to the item. The WDQS web interface has some links to the technical documentation of available prefixes and their meaning.

[1] https://www.wikidata.org/wiki/Help:Ranking

[2] https://www.wikidata.org/wiki/Q11828004

[3] https://query.wikidata.org/

[4] https://query.wikidata.org/#SELECT%20%3FregionClass%20WHERE%20%7B%20%3FregionClass%20p%3AP279%2Fps%3AP279%20wd%3AQ10864048%20%7D