wikibase-cli icon indicating copy to clipboard operation
wikibase-cli copied to clipboard

support custom datatypes

Open persona0591 opened this issue 2 years ago • 4 comments

Hi!

Thanks for this library - very helpful! :)

I'm trying to add a claim ("P1") to an entity ("Q1") in a Wikibase instance. This instance has its own, custom datatype for "P1" (named "urix").

If I run e.g.

wb add-claim Q1 P1 "test"

... then the response is:

unsupported datatype: urix. Please open an issue at ...

How can I use this library for custom datatypes?

persona0591 avatar Aug 03 '23 16:08 persona0591

Hi! That's the first time I encounter that problem, so it had not been considered until now for this lib, I'm afraid ^^ The problem comes from wikibase-edit, which doesn't know how to validate and format that unknown datatype

maxlath avatar Aug 03 '23 17:08 maxlath

Hi @maxlath Thank you - good to know! Do you have plans to support this feature? Or do you know of a workaround?

persona0591 avatar Aug 04 '23 04:08 persona0591

Different possibilities:

  • wikibase-edit could support declaring custom datatypes in some way: we would need a way to declare a statement builder function for that datatype, or to declare that that custom datatype has the same shape as another known datatype
  • you could fork wikibase-edit to add the desired statement builder function, possibly by just aliasing the new datatype to an existing builder, as it already done for most datatypes

maxlath avatar Aug 04 '23 09:08 maxlath

Hi @maxlath Thank you, much appreciated!

persona0591 avatar Aug 07 '23 07:08 persona0591