maxlath / wikibase-cli

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

Is it possible to create 'somevalue' claims with wd edit-item ? #75

Closed Jheald closed 5 years ago

Jheald commented 5 years ago

When I try

wd edit-item '{"id":"Q63313825", "claims":{"P767": {"value": {"snaktype":"somevalue"}, "qualifiers": {"P1932": "UBL, E."}, "references": {"P248": "Q53556514", "P5199": "000011361", "P813": "2019-03-06"} } } }'

I get the error "Error: invalid wikidata id: [object Object]"

Similarly with the simpler

wd edit-item '{"id":"Q63313825", "claims":{"P767": {"value": {"snaktype": "somevalue"} } } }'

What is the correct syntax for adding a claim with value 'somevalue' using wd edit-item? Is it in fact possible?

maxlath commented 5 years ago

yes it is: snaktype should be at the reference object root and value shouldn't be set, see example here

Jheald commented 5 years ago

Thank you. That was the problem. Edits now successfully made!