Hi Bo!
Would it be possible to get access / a URL to this test instance? Feel free to send it to me outside of this list (if possible)
Addshore
On 11 August 2015 at 08:05, Bo Ferri zazi@smiy.org wrote:
Hi Addshore,
currently, I can't see what's wrong with the Statement with the property P251. It should refer to another Item (which should be possible within the Wikidata data model). This is the difference between all other Statements - they simply refer to literal Values. I also had a look at the JSON serialisation documentation. In the Snak section [1] I can find an example that looks similar to mine (or maybe I'm blind and oversee something). Furthermore, I'm serialising POJO objects from the Wikidata Toolkit (i.e. I do not construct the JSON at my own). The Item that is the Value of this Statement exists already in my Wikibase instance (all properties exists as well). We are running a nightly snapshot of MediaWiki (incl. Wikibase extension).
Thanks a lot in advance for all your help.
Cheers,
Bo/T
[1] https://www.mediawiki.org/wiki/Wikibase/DataModel/JSON#Snaks
Quoting Addshore addshorewiki@gmail.com:
At a guess this is due to a miss match between the datavalue of a property
and the datavalue that you are trying to set in a statement for that property.
The error also says that it gets an array where it expects a string so I guess the issue is with P251 where the value is an array instead of a string!
Could P251 possibly be a string?
On 10 August 2015 at 14:25, Bo Ferri zazi@smiy.org wrote:
Hi all,
(apologies, if this is not the right place for raising the following issue (if this is the case, then please delegate me to a more appropriated place ;) ))
we are currently evaluating Wikibase as storage for D:SWARM GDM data (see [1,2]). Right now, we have a prototype client [3] that makes use of a Wikidata Toolkit fork [4]. So far, we were able to write/create simple items and properties. However, we also would like to create new items with a given set of statements. Therefore, we intended to utilise the 'wbeditentity' HTTP API (and I had (and still have) a lively conversation with Markus Krötzsch about this topic, see [5]). We get (a kind of) item JSON serialisation (e.g. with help of JacksonObjectFactory-based DatamodelConverter (Wikidata Toolkit code)). However, when sending this to the 'webeditentity' API we always receive an error response like this:
" { "error": { "code": "modification-failed", "info": "array instead of string", "messages": [ { "name": "wikibase-validator-bad-type", "parameters": [ "string", "array" ], "html": { "*": "array instead of string" } } ], "*": "See http://%5BOUR WIKIBASE SERVICE IP]/api.php for API usage" } } "
We cannot really interpret what's wrong with the data model that we send to this API (note: we make use of the POJOs below 'org.wikidata.wdtk.datamodel.json.jackson' package of Wikidata Toolkit, see [6]). An example of a data JSON is attached to this e-mail.
Thanks a lot in advance for all your help.
Cheers,
Bo/T
[1] http://dswarm.org [2] https://github.com/dswarm/dswarm-documentation/wiki/Graph-Data-Model [3]
https://github.com/zazi/wikidata-d-swarm-importer/tree/own_mediawiki_api_cli... [4]
https://github.com/zazi/Wikidata-Toolkit/tree/wikibase_api_write_modificatio... [5] https://github.com/Wikidata/Wikidata-Toolkit/issues/162 [6]
https://github.com/zazi/wikidata-d-swarm-importer/blob/own_mediawiki_api_cli...
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
-- Addshore
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech