By introducing read models we hope to achieve a better separation of data required for creating or updating ("writing"), and data to be used in responses ("reading"). We will for now consider DataModel entities write models, and will create corresponding read models for the REST API.
Needed read models:
- ItemData (already exists)
- StatementList
- Statement
- includes all parts of the statement, except those not defined by Wikibase itself (e.g. DataValue objects)
- major goal: include the property data type for statement properties, qualifier properties, and reference proeprties. This will make ADR 4 obsolete, and means that we no longer need to look up the data type at serialization time.
- labels, descriptions, aliases
- sitelinks
ACs:
- document the decision in an ADR
- create and use read models
- (disallow DataModel objects in Wikibase\Repo\RestApi\UseCases\*\*Response classes via PHPat?)