maxlath / wikibase-cli

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

wb query numeric object value for property #85

Closed HakanIST closed 5 years ago

HakanIST commented 5 years ago

Hello,

The query:

wb query --property P2448 --object 2217527

returns no results however the query wb claims Q138172 P2448 shows corresponding result. Thanks in advance,

maxlath commented 5 years ago

it works when you make the object explicitly a string

wd query --property P2448 --object '"2217527"'

In this case the tool could check the property datatype to format it correctly, but sometimes the property isn't provided.

Another solution would be to always query both the string and the number formats, but then you can't make the query that wants one and not the other, so that's not totally satisfying I guess

HakanIST commented 5 years ago

First solution works very well. Thank you.