Page MenuHomePhabricator

bootstrap Wikibase installation with basic ontology
Open, Needs TriagePublic

Description

As an admin of a new Wikibase instance I want to quickly create a basic ontology and basic required properties (eg formatterUrlProperty)

Problem

Some components (either Wikibase itself or some extensions) rely on special properties or items which have a special behavior. For instance, Wikibase has a $formatterUrlProperty configuration variable which expects a PID. This property is then used to render values for external identifiers. The Quality Constraints extension relies on bazillions of special PIDs and QIDs to define the constraints. The OpenRefine reconciliation interface also relies on some (instance of, subclass of…).

We need a workflow to set up these magic properties.

Currently

  • Boot your Wikibase with Docker
  • Manually login as WikibaseAdmin and create the properties / items
  • Put the properties / ids of these entities in the various config files of the various components that require them
  • Reboot Wikibase.

Ideally

As the docker-compose config grows and integrates more services (such as the ones mentioned above), it will become quite inconvenient to create all these special entities manually. It seems hard to do this process completely automatically as part of the Docker boot process (since we can't really avoid restarting Wikibase after formatterUrlProperty has been set), but there could be a maintenance script that creates all these special entities and store their ids in a file that is accessible to all relevant Docker containers, which would then feed these ids into their own config files.

Acceptance criteria:

  • a script exists that creates a few basic properties
  • the properties are linked to their corresponding property on Wikidata
  • the properties have at least English labels, descriptions and aliases
  • it is documented in the setup documentation

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptOct 8 2019, 3:41 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Addshore What are your thoughts on how to integrate this in the docker image?

@Lucas_Werkmeister_WMDE I remember a similar script for setting up the constraints. Could you link that?

@Lucas_Werkmeister_WMDE I remember a similar script for setting up the constraints. Could you link that?

maintenance/ImportConstraintEntities.php – note that it removes all statements and sitelinks from the entities it imports, and the connection to the original item is only recorded in the edit summary (and dumped to stdout in a config file format), not anywhere within the entity itself.

I don't think this is the best solution. Reusing Wikidata property directly should be encouraged, not create a local duplicate, unless the wiki is internal and have no connection to internet.

I don't think this is the best solution. Reusing Wikidata property directly should be encouraged, not create a local duplicate, unless the wiki is internal and have no connection to internet.

Yes we need to have that too (Federation) but people asked for this in particular even when offered the Federation option. They just want a one-time import and not give up total control of the ontology in their wiki.

I think there is room for a feature like this in the wikibase docker images.
It should probably be developed as an extension that generically allows copying a property from Wikidata also leaving a reference to the property on Wikidata.
Lots of Wikibases already do something similar, but in a more manual way.

It would be nice for the extension to provide a special page with limited access allowing users with certain rights to create these properties.
Maybe also with a special page.

I originally posted this on T236619, but going to close that as a dupe of this and do discussion here instead..

I would like this to a well speced out feature before doing to much dev work on it in possibly the wrong direction. As I see it, and including the thoughts of others I have discussed this with over the past days at wikidata con and wikibase workshops etc there are a few different situations:

  1. People want a totally clean wikibase, and they want to be able to do whatever they want with it (no preset ontology etc)
  2. People that want to set things like formatterUrlProperty or the constraints properties don't want to have to change LocalSettings
  3. People that want to create these properties do not want to do it manually.

For quality constraints there is already a maintenance script for doing this a bit https://github.com/wikimedia/mediawiki-extensions-WikibaseQualityConstraints/blob/master/maintenance/ImportConstraintEntities.php
But the situation across the board could definitely be improved.

We probably want to end up in a situation where:

  • There is a new mechanism for these property IDs or item IDs to be recorded in wikibase without needing to change PHP files. (would be great if there was a mediawiki core thing here that could be used, but we can also make our own)
  • Code exists to easily create template / default versions of all of these properties and items (probably also registering the IDs in the system the 1st point describes
  • This code can be called via a special page OR maintenance script OR be automatically run on install of wikibase (depending on some flag or config).

I believe this would cover all of the use cases that I have heard of so far.
I'm going to send this into the Wikibase communication channels to gather further feedback.

Addshore updated the task description. (Show Details)Oct 29 2019, 10:25 AM

I think we indeed have these different cases, yeah. It doesn't quite seem to cover the initial issue anymore though. That was about "non-magic" but almost always needed properties like instance-of, subclass of, part of, etc. And thinking about it we probably also want one for linking to Wikidata.

I think we indeed have these different cases, yeah. It doesn't quite seem to cover the initial issue anymore though.

That's quite true, depending on which bit of "ontology" we are talking about and how far reaching it is.

Adding to my list of bullet points, also relating to same-as below, we need a method of creating a property on a local wikibase that is the "same as" a property on another wikibase.

And thinking about it we probably also want one for linking to Wikidata.

Probably same as as discussed at wikidatacon 2019