Skip to content

Ability to save "schema templates": schemas where some values are left empty #5043

@wetneb

Description

@wetneb

Wikibase communities generally establish some data modelling conventions, which users are asked to follow when importing data.
For instance, a book on Wikidata will generally have a certain set of statements on it (title, author, date of publication…).

When importing data in a Wikibase instance, users need to have the knowledge of those modelling conventions. If they do not have this knowledge, a blank schema page can be quite daunting.

Proposed solution

We should make it possible for users to define "schema templates" which represent a prototypical Wikibase schema for an import in a certain domain. Those schema templates would be incomplete Wikibase schemas, in the sense that some statement values could be left blank, for instance. After loading such a template, the user could then drag and drop the columns from their project to the appropriate locations in the schema.

For the implementation, we would just use the same classes as the ones that define schemas, but relax the validation in the constructors to allow for empty value. We would then add methods to check that a given schema is complete. This would be the opportunity to return more precise error messages when the schema is incomplete (#4724).

Alternatives considered

Use ShEx or SHACL. Those formats are not designed for the Wikibase data model, but rather for RDF. This means that it would not be possible to take a schema represented in one of those formats, and render it as a Wikibase schema with holes. Therefore this does not seem fitting here.

Additional context

Requested by @trnstlntk @lozanaross in the context of the Wikimedia Commons integration project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Feature RequestIdentifies requests for new features or enhancements. These involve proposing new improvements.wikibaseRelated to wikidata/wikibase integrationwikicommonsRelated to Wikimedia Commons integration

    Type

    No type

    Projects

    Status

    SDC (WMF) grant 2021-22 - done

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions