Page MenuHomePhabricator

Include EntitySchema in bundle
Closed, ResolvedPublic

Event Timeline

@danshick-wmde

In LocalSettings.php

wfLoadExtension( 'EntitySchema' );

Simple enough, however I couldn't find any documentation on how to use it.

If you now visit /wiki/EntitySchema:RandomNameForTheSchema you can create this new EntitySchema and add some shex.

<something> {
    wdt:P1 [wd:Q1]
  }

Like the docs already state you can also set $wgEntitySchemaShExSimpleUrlto point to a external verification tool which then renders a link to the specific schema.

Bit late, but helpful for these is Wikidata:WikiProject Schemas / Tutorial, and the overview at Wikidata:Schemas. Both may be worth mentioning in documentation (I added them to the Extension page).

EntitySchema support is still rough, e.g. Cradle (and maybe other tools by the same author) currently a) requires the prefix wdt:, and b) doesn't work with the syntax above, but instead needs:

<human> EXTRA wdt:P31 {
  wdt:P31 [wd:Q5];
  [...]
}

This took a while to figure out as most Wikidata schemas include EXTRA. Wikidata assumptions could become relevant if tools are bundled without changes, or if documentation refers to them.