GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ProfessionalWiki/WikibaseRDF: Wikibase extension that allows defining RDF mappings for Wikibase Entities

BranchesTags
Open more actions menu

Latest commit

 

History

295 Commits
295 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
i18n
i18n
 
 
resources
resources
 
 
src
src
 
 
tests
tests
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.stylelintrc.json
.stylelintrc.json
 
 
Gruntfile.js
Gruntfile.js
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
WikibaseRdf.alias.php
WikibaseRdf.alias.php
 
 
codecov.yml
codecov.yml
 
 
composer.json
composer.json
 
 
extension.json
extension.json
 
 
package.json
package.json
 
 
phpcs.xml
phpcs.xml
 
 
phpstan-baseline.neon
phpstan-baseline.neon
 
 
phpstan.neon
phpstan.neon
 
 
phpunit.xml.dist
phpunit.xml.dist
 
 
psalm-baseline.xml
psalm-baseline.xml
 
 
psalm.xml
psalm.xml
 
 

Repository files navigation

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 conceived and funded the extension.

Table of Contents

  • Usage
    • REST API
  • Installation
  • PHP Configuration
  • Development
  • Release notes

Usage

When the extension is enabled, Item and Property pages show a "Mapping to other ontologies" section. This section is located 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 valid.

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:

  • PHP 8.1 or later (tested up to 8.4)
  • MediaWiki 1.43 or later (tested up to 1.43)
  • Wikibase 1.43 or later (tested up to 1.43)

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

On the command line, go to your wiki's root directory. Then run these two commands:

COMPOSER=composer.local.json composer require --no-update professional-wiki/wikibase-rdf:~2.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 wiki's 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.

  • make ci: Run everything
  • make test: Run all tests
  • make cs: Run all style checks and static analysis

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

  • PHPUnit: php tests/phpunit/phpunit.php -c extensions/WikibaseRDF/
  • Style checks: vendor/bin/phpcs -p -s --standard=extensions/WikibaseRDF/phpcs.xml
  • PHPStan: vendor/bin/phpstan analyse --configuration=extensions/WikibaseRDF/phpstan.neon --memory-limit=2G
  • Psalm: php vendor/bin/psalm --config=extensions/WikibaseRDF/psalm.xml

Release notes

Version 2.0.0 - 2025-07-07

  • Raised minimum MediaWiki version to 1.43
  • Raised minimum PHP version to 8.1
  • Translation updates for system messages (thanks @translatewiki and its translator community)

Version 1.1.0 - 2022-11-25

  • Added notification about SPARQL store behavior that shows on first edit
  • Translation updates for system messages (thanks @translatewiki and its translator community)

Version 1.0.0 - 2022-10-04

Initial release for Wikibase 1.37 with these features:

  • Ability to add mappings to Items and Properties via an on-page UI
  • Inclusion of mappings in the RDF output
  • Configurable relationships (predicates), including configuration UI on MediaWiki:MappingPredicates
  • API endpoint to retrieve or update the mappings for an Entity
  • API endpoint to retrieve all mappings defined on the wiki
  • TranslateWiki integration
  • Support for PHP 8.0 and 8.1

About

Wikibase extension that allows defining RDF mappings for Wikibase Entities

rdf.wikibase.wiki

Topics

mediawikimediawiki-extensionrdfwikibasewikibase-extension

Resources

Readme
GPL-2.0 license
Activity
Custom properties

Stars

17 stars

Watchers

7 watching

Forks

4 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.