albertvillanova / WikidataBot

Wikidata bot
http://www.wikidata.org/wiki/User:AVMbot
0 stars 0 forks source link

[scripts] Add population ignores instances of commune_nouvelle #12

Closed albertvillanova closed 4 years ago

albertvillanova commented 4 years ago

The hierarchy of classes is:

commune_nouvelle < commune_of_France
albertvillanova commented 4 years ago

Add subclass*:

?item p:{instance_of} ?st .
?st ps:{instance_of}/wdt:{subclass}* wd:{administrative_division} .
albertvillanova commented 4 years ago

There is a problem with current solution:

ps:{instance_of}/wdt:{subclass}* wd:{administrative_division}

because:

I have commented it in Wikidata: https://www.wikidata.org/wiki/Wikidata:Project_chat#Why_'former_X'_is_subclass_of_'X'? but no solution has been given yet.

Note, that there is no problem with other administrative divisions:

albertvillanova commented 4 years ago

Better remove subclass* and explicitly enumerate all administrative divisions with VALUES:

VALUES ?administrative_division { wd:Q484170 wd:Q2989454 }  # [commune of France, commune nouvelle]

?item p:P31 ?st .
?st ps:P31 ?administrative_division .