Page MenuHomePhabricator

Make RDF prefixes configurable
Open, Needs TriagePublic

Description

The prefixes Wikibase uses for Turtle and RDF/XML output are hardcoded in the RdfVocabulary class. It would be nice if they were configurable. The prefixes have no formal meaning and the output is valid as long as these prefixes are mapped to the correct base URI, but it'S still very confusing for 3rd party installs to use the "wd" prefix.

If this becomes configurable in Wikibase, it will also need to become configurable in the query service.

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseQualityConstraints : masterRestored the skipped test after changes to Wikibase
mediawiki/extensions/Wikibase : masterPrefix statement, and reference namespaces in RDF output
mediawiki/extensions/Wikibase : masterPrefix the value namespace in the RDF output
mediawiki/extensions/Wikibase : masterAdded prefixes to document (data) URIs in the RDF output
mediawiki/extensions/WikibaseQualityConstraints : masterTemporarily skip a test
mediawiki/extensions/Wikibase : masterAdded a service generating canonical URLs of "document" pages for defined Entity Sources
mediawiki/extensions/WikibaseQualityConstraints : masterAdjusted calls to RdfVocabulary methods
mediawiki/extensions/Wikibase : masterPrefix RDF (turtle) namespaces with configurable prefixes instead of using a source/repository suffix
mediawiki/extensions/Wikibase : masterAdd RDF namespace prefixes to the entity source config

Event Timeline

daniel created this task.Dec 12 2018, 5:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 12 2018, 5:32 PM

A list of prefixes is available in the RDF dump format documentation – all of the non-standard ones, except for wikibase:, would have to be configurable.

However, how the prefixes should be named instead is a difficult question. Let’s take FactGrid as an example: wd: should perhaps become fg:, and therefore wdt:fgt:, wds:fgs:, wdreffgref, etc. – but surely that doesn’t mean that wdata: becomes fgata:? And what about prefix names like p:, pqv:, prn:, which don’t include anything Wikidata-specific?

Fortunately, prefix names can contain hyphens, so we can still distill this down to a single “prefix-prefix” if we’re willing to make the standard prefix names a bit longer, and have Wikidata be a special case:

PREFIX fg: <https://database.factgrid.de/entity/>
PREFIX fgt: <https://database.factgrid.de/prop/direct/>
PREFIX fg-p: <https://database.factgrid.de/prop/>
PREFIX fg-ps: <https://database.factgrid.de/prop/statement/>
PREFIX fg-psv: <https://database.factgrid.de/prop/statement/value/>
PREFIX fg-data: <https://database.factgrid.de/wiki/Special:EntityData/>
# ...

But that does mean we’d still need more configuration settings to preserve p:, ps: etc. for Wikidata.

Tpt added a subscriber: Tpt.May 13 2019, 6:08 PM

Change 517022 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Add RDF namespace prefixes to the entity source config

https://gerrit.wikimedia.org/r/517022

Change 517021 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Prefix RDF (turtle) namespaces with configurable prefixes instead of using a source/repository suffix

https://gerrit.wikimedia.org/r/517021

Addshore moved this task from incoming to in progress on the Wikidata board.Jun 21 2019, 11:25 PM

Change 527149 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Added prefixes to document (data) URIs in the RDF output

https://gerrit.wikimedia.org/r/527149

Change 517022 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add RDF namespace prefixes to the entity source config

https://gerrit.wikimedia.org/r/517022

Change 528076 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Added a service generating canonical URLs of "document" pages for defined Entity Sources

https://gerrit.wikimedia.org/r/528076

daniel removed a subscriber: daniel.Aug 5 2019, 9:28 AM

Change 528519 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Prefix statement, reference and value namespaces in RDF output

https://gerrit.wikimedia.org/r/528519

Change 517021 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Prefix RDF (turtle) namespaces with configurable prefixes instead of using a source/repository suffix

https://gerrit.wikimedia.org/r/517021

Change 529812 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/WikibaseQualityConstraints@master] Adjusted calls RdfVocubulary methods

https://gerrit.wikimedia.org/r/529812

Change 529812 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Adjusted calls to RdfVocabulary methods

https://gerrit.wikimedia.org/r/529812

Change 528076 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Added a service generating canonical URLs of "document" pages for defined Entity Sources

https://gerrit.wikimedia.org/r/528076

Change 533033 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/WikibaseQualityConstraints@master] Temporarily skip a test

https://gerrit.wikimedia.org/r/533033

Change 533036 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/WikibaseQualityConstraints@master] Restored the skipped test after changes to Wikibase

https://gerrit.wikimedia.org/r/533036

Change 533033 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Temporarily skip a test

https://gerrit.wikimedia.org/r/533033

Change 527149 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Added prefixes to document (data) URIs in the RDF output

https://gerrit.wikimedia.org/r/527149

Change 533202 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Prefix the value namespace in the RDF output

https://gerrit.wikimedia.org/r/533202

Change 528519 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Prefix statement, and reference namespaces in RDF output

https://gerrit.wikimedia.org/r/528519

Change 533036 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Restored the skipped test after changes to Wikibase

https://gerrit.wikimedia.org/r/533036