Most namespaces on Wikidata are no longer declaring the defaultcontentmodel in action=query+meta=siteinfo+siprop=namespaces, e.g. the main (Item) namespace:
$ curl -s 'https://www.wikidata.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces&formatversion=2&format=json' | jq '.query.namespaces["0"]' { "id": 0, "case": "first-letter", "name": "", "subpages": false, "content": true, "nonincludable": false }
In fact, only four namespaces still declare it:
$ curl -s 'https://www.wikidata.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces&formatversion=2&format=json' | jq '.query.namespaces | .[] | select(has("defaultcontentmodel")) | { id, canonical, defaultcontentmodel }' { "id": 640, "canonical": "EntitySchema", "defaultcontentmodel": "EntitySchema" } { "id": 641, "canonical": "EntitySchema talk", "defaultcontentmodel": "wikitext" } { "id": 2302, "canonical": "Gadget definition", "defaultcontentmodel": "GadgetDefinition" } { "id": 2600, "canonical": "Topic", "defaultcontentmodel": "flow-board" }
One outcome of this is that Pywikibot refuses to operate on Wikidata, since it thinks the Item entity type isn’t supported:
>>> import pywikibot >>> site = pywikibot.Site("wikidata", "wikidata") >>> item = pywikibot.ItemPage(site, "Q42") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/luwe/git/pywikibot/core/pywikibot/page/__init__.py", line 3900, in __init__ ns = site.item_namespace File "/home/luwe/git/pywikibot/core/pywikibot/site/_datasite.py", line 91, in item_namespace self._item_namespace = self.get_namespace_for_entity_type('item') File "/home/luwe/git/pywikibot/core/pywikibot/site/_datasite.py", line 78, in get_namespace_for_entity_type raise EntityTypeUnknownError( pywikibot.exceptions.EntityTypeUnknownError: DataSite("wikidata", "wikidata") does not support entity type "item"