maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

add claim doesn't support monolingual text #33

Closed jhsoby closed 6 years ago

jhsoby commented 6 years ago

Similar to issue #30 in that it's about an unsupported datatype.

The datatype monolingual string requires a two parts: A language code and a string. It's currently not possible to add that via this tool (or, alternatively, I don't know the correct syntax to do so). In QuickStatements, the syntax to do this is languagecode:"string", perhaps the same syntax should be used here? Tested with P1705.

jhsoby commented 6 years ago

Oh, and similarly, we need some syntax for how to add this for create-item.

maxlath commented 6 years ago

The monolingual text claim issue got fixed by 18aa868, see the rich claim value documentation

And for create-item (and now also edit-item), the updated documentation is here

jhsoby commented 6 years ago

Thank you very much! :+1:

maxlath commented 6 years ago

you're welcome :)

jhsoby commented 6 years ago

Sorry to bother you about this again, but I'm not getting this to work with create-item. I'm wondering if I'm doing something wrong, or if it is a bug. The command I'm trying is this:

wd create-item '{"labels":{"nb":"Lundeborg"},"descriptions":{"nb":"etternavn"},"claims":{"P1705":{"text":"Lundeborg","language":"mul"}}}'

The error I'm getting is missing claim value [ 'P1705', undefined ]

With add-claim it works as it should.

maxlath commented 6 years ago

And its was indeed a bug in wikidata-edit, that was fixed in https://github.com/maxlath/wikidata-edit/commit/570b2d1d7be2b62af3caff8618cf06845b3827ca

The patch was published in wikidata-cli v5.7.2. Thank you for spotting and sorry for the trouble!

jhsoby commented 6 years ago

@maxlath It's working, hurrah! Thank you very much, and happy new year to you! :-)

maxlath commented 6 years ago

you're welcome! :D happy new year to you too!