Page MenuHomePhabricator

The wikibase-api README.md misses some vital information
Closed, InvalidPublic

Description

The https://github.com/addwiki/wikibase-api/blob/master/README.md misses some vital information when building the code.
To make the https://github.com/addwiki/wikibase-api/blob/master/README.md#load--general-setup work on needs to add (and search for) dependencies

composer.json

"data-values/geo": "1.1.*",
"data-values/time": "0.8.*",
"data-values/number": "0.8.*"

It would be best to add this to the readme. See https://github.com/addwiki/wikibase-api/pull/44

To make the code run https://github.com/addwiki/wikibase-api/blob/master/README.md#create-an-empty-entity full path are needed.

$edit = new \Mediawiki\DataModel\Revision(
  new \Wikibase\DataModel\ItemContent( Wikibase\DataModel\Entity\Item::newEmpty() )
);

Not sure how to easy solve this apart from put this in the README but some factory methods would make this easier.

Event Timeline

It would be best to add this to the readme. See https://github.com/addwiki/wikibase-api/pull/44

+1 to adding better examples to the readme ( and or the new doc sites)

Also once T157637 has been tackled we can link there.

To make the code run https://github.com/addwiki/wikibase-api/blob/master/README.md#create-an-empty-entity full path are needed.

Indeed, this is already something being solved as docs are being moved to the docs sites.
For example https://addwiki.readthedocs.io/projects/mediawiki-api-base/en/latest/quickstart.html contains all of the use statements required.

We use the wikibase code but we miss documentation and are stuck.

For example, adding strings is mentioned, but in Wikidata an important data type is to connect to another qid. The documentation could have a basic example how to declare an item 'is a human' (P31=Q5). Other examples I would love to see is how to read/set aliases, and how to handle dates.