Wikibase DataModel 1.0

I’m happy to announce the 1.0 release of Wikibase DataModel. Wikibase DataModel is the canonical PHP implementation of the Data Model at the heart of the Wikibase software.

This is a big release which has been some time in the making, even though many additions have been split of and included in previous releases. The highlights are as follows:

Removal of the (de)serialization code

The entities and value objects in Wikibase DataModel used to have toArray and newFromArray methods. This caused several problems, such as having a pile of static code, depending on configuration (which was done via global state) and adding support for an arbitrary array format to the responsibilities of the objects. This has been fully removed, and can now be done via the dedicated serialization components (Public format, internal format) which where released some time back.

In earlier versions of Wikibase DataModel, the Item and Property classes contained the array representation internally rather than fields for the value objects items and properties contain. While this was not visible via the getters and setters, which dealt with those value objects, it was exposed in the constructor. As of DataModel 1.0, the constructors take the value objects rather than the array representation.

Deprecation of Entity

Type hinting against the Entity class has been deprecated. This was announced on the Wikidata tech list some time back. While the class is still there, most methods it defines have been deprecated, and some have been removed. A new EntityDocument interface has been introduced in version 0.8.2, which can be used instead. As part of the cleanup here, Item has been made to only accept statements, rather than all claims, as it wrongly did before.

 

Many more changes and additions where made. You can view the full list of changes affecting users of the component in the release notes.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.