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?
Those data types are provided by separate extensions:
* Math https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Math provides /math/ * WikibaseLexeme https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:WikibaseLexeme provides /wikibase-lexeme/, /wikibase-sense/ and /wikibase-form/ * Score https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Score provides /musical-notation/
To use these types, you’ll need to find some way to install those extensions. (I’m not familiar enough with wikibase-docker to know how.)
Cheers, Lucas
On 26.12.19 16:12, mosha chen wrote:
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
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot