ProfessionalWiki / WikibaseRDF

Wikibase extension that allows defining RDF mappings for Wikibase Entities
https://rdf.wikibase.wiki
GNU General Public License v2.0
14 stars 4 forks source link
mediawiki mediawiki-extension rdf wikibase wikibase-extension

Wikibase RDF

GitHub Workflow Status Type Coverage Psalm level Latest Stable Version Download count License

Wikibase extension that allows defining RDF mappings for Wikibase Entities.

Professional.Wiki created and maintains Wikibase RDF. We provide Wikibase hosting, Wikibase development and Wikibase consulting.

The Wikibase Stakeholder Group concieved and funded the extension.

Table of Contents

Usage

When the extension is enabled, Item and Property pages show a "Mapping to other ontologies" section. This section is located in between the "In more languages" and "Statements" sections.

Property page with a mapping

Users with editing permissions can add, edit or remove mappings.

A mapping consists of a predicate and a URL. The predicate can only be one out of a preconfigured set of values. The URL has to be a valid URL.

Mapping editing UI

Mapping predicates can be configured via the MediaWiki:MappingPredicates page by anyone with interface-admin permissions. You can also configure mapping predicates via PHP Configuration.

Mapping predicates configuration page Editing mapping predicates via the configuration page

REST API

This extension provides REST API endpoints for getting and setting the RDF mappings for a Wikibase entity.

For more information, refer to the REST API documentation.

Installation

Platform requirements:

The recommended way to install Wikibase RDF is using Composer with MediaWiki's built-in support for Composer.

On the commandline, go to your wikis root directory. Then run these two commands:

COMPOSER=composer.local.json composer require --no-update professional-wiki/wikibase-rdf:~1.0
composer update professional-wiki/wikibase-rdf --no-dev -o

Then enable the extension by adding the following to the bottom of your wikis LocalSettings.php file:

wfLoadExtension( 'WikibaseRDF' );

You can verify the extension was enabled successfully by opening your wikis Special:Version page in your browser.

PHP Configuration

Configuration can be changed via LocalSettings.php.

Allowed predicates

List of allowed predicates.

Variable: $wgWikibaseRdfPredicates

Default: []

Example:

$wgWikibaseRdfPredicates = [
    'owl:sameAs',
    'owl:SymmetricProperty',
    'rdfs:subClassOf',
    'rdfs:subPropertyOf',
];

You can also configure what predicates are allowed via the MediaWiki:MappingPredicates page.

Development

To ensure the dev dependencies get installed, have this in your composer.local.json:

{
    "require": {
        "vimeo/psalm": "^4",
        "phpstan/phpstan": "^1.4.9"
    },
    "extra": {
        "merge-plugin": {
            "include": [
                "extensions/WikibaseRDF/composer.json"
            ]
        }
    }
}

Running tests and CI checks

You can use the Makefile by running make commands in the WikibaseRDF directory.

Alternatively, you can execute commands from the MediaWiki root directory:

Release notes

Version 1.1.0 - 2022-11-25

Version 1.0.0 - 2022-10-04

Initial release for Wikibase 1.37 with these features: