Hi, pywikibot experts:
I am now creating new Property using the wikidata Wbeditentity API
<https://www.wikidata.org/w/api.php?action=help&modules=wbeditentity>, I'm
running wikibase software via the wikibase-Docker images on my local
machine, and use the pywikibot() script:
data = {
'datatype': 'math', # mandatory
'descriptions': {
'en': {
'language': 'en',
'value': row['Property Description']
}
},
'labels': {
'en': {
'language': 'en',
'value': row['Property Label']
}
}
}
params = {
'action': 'wbeditentity',
'new': 'property',
'data': json.dumps(data),
'summary': 'bot adding in properties',
'token': site.tokens['edit']
}
req = site._simple_request(**params)
results = req.submit()
It would report errors when creating the following datatypes:
*math wikibase-sense wikibase-lexeme musical-notation wikibase-form *
ERROR: P5973 param-illegal: A datatype was expected, but either missing or
not recognized. [messages:[{'name':
'wikibase-api-not-recognized-datatype',
'parameters': [], 'html': {'*': 'A datatype was expected, but
either
missing or not recognized.'}}]; help:See
http://localhost:8181/w/api.php
for API usage.
The other types will return success, just list some:
external-id
wikibase-item
...
geo-shape
However, the unsupported datatypes are in the supported datatype list by
the official document:
https://www.wikidata.org/wiki/Help:Data_type
Any idea?
--
Regards,
Mosha