PHPackages                             professional-wiki/wikibase-rdf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. professional-wiki/wikibase-rdf

ActiveMediawiki-extension

professional-wiki/wikibase-rdf
==============================

Wikibase extension that allows defining RDF mappings for Wikibase Entities

2.0.0(10mo ago)167.7k↑450%4[6 issues](https://github.com/ProfessionalWiki/WikibaseRDF/issues)GPL-2.0-or-laterPHPPHP &gt;=8.1CI failing

Since Oct 4Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/ProfessionalWiki/WikibaseRDF)[ Packagist](https://packagist.org/packages/professional-wiki/wikibase-rdf)[ Docs](https://professional.wiki/en/extension/wikibase-rdf)[ RSS](/packages/professional-wiki-wikibase-rdf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

Wikibase RDF
============

[](#wikibase-rdf)

[![GitHub Workflow Status](https://camo.githubusercontent.com/9da0b6305ec71a0fd27f65c10e66f304e737d84b052bb63159de1d8e25c30d09/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f50726f66657373696f6e616c57696b692f57696b69626173655244462f63692e796d6c3f6272616e63683d6d6173746572)](https://github.com/ProfessionalWiki/WikibaseRDF/actions?query=workflow%3ACI)[![Type Coverage](https://camo.githubusercontent.com/b92bfa727341608dc81168edbafe266aefa9ab119380d96c4b9da19526f84e86/68747470733a2f2f73686570686572642e6465762f6769746875622f50726f66657373696f6e616c57696b692f57696b69626173655244462f636f7665726167652e737667)](https://shepherd.dev/github/ProfessionalWiki/WikibaseRDF)[![Psalm level](https://camo.githubusercontent.com/e1f37440bac86e4297b3c339da525a1dff643b7bd5eb4cd8a7e43428defa684d/68747470733a2f2f73686570686572642e6465762f6769746875622f50726f66657373696f6e616c57696b692f57696b69626173655244462f6c6576656c2e737667)](psalm.xml)[![Latest Stable Version](https://camo.githubusercontent.com/e1359d38fe3d0ae1ad8d684a5ac95d8a39df8b3fcae8200d132226df1c1d2c62/68747470733a2f2f706f7365722e707567782e6f72672f70726f66657373696f6e616c2d77696b692f77696b69626173652d7264662f762f737461626c65)](https://packagist.org/packages/professional-wiki/wikibase-rdf)[![Download count](https://camo.githubusercontent.com/7891749cd140c9b53e894097c251a43a3ab0398b0e7f09ab839fd8cd3d3bfc56/68747470733a2f2f706f7365722e707567782e6f72672f70726f66657373696f6e616c2d77696b692f77696b69626173652d7264662f646f776e6c6f616473)](https://packagist.org/packages/professional-wiki/wikibase-rdf)[![License](https://camo.githubusercontent.com/4e109c0f3dfbabb224f90fbc6ac6b78b2ebc0a01a481b12eb2b2dbc4d3f05572/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70726f66657373696f6e616c2d77696b692f77696b69626173652d726466)](LICENSE)

[Wikibase](https://wikibase.consulting/what-is-wikibase/) extension that allows defining RDF mappings for Wikibase Entities.

[Professional Wiki](https://professional.wiki) created and maintains Wikibase RDF. We provide [Wikibase hosting](https://professional.wiki/en/hosting/wikibase), [Wikibase development](https://professional.wiki/en/wikibase-software-development), and [Wikibase consulting](https://wikibase.consulting/).

The [Wikibase Stakeholder Group](https://wbstakeholder.group/) conceived and funded the extension.

**Table of Contents**

- [Usage](#usage)
    - [REST API](#rest-api)
- [Installation](#installation)
- [PHP Configuration](#php-configuration)
- [Development](#development)
- [Release notes](#release-notes)

Usage
-----

[](#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](https://user-images.githubusercontent.com/146040/193851219-dc30080a-7cbb-4c1a-9800-e7c7d98ef644.png)](https://user-images.githubusercontent.com/146040/193851219-dc30080a-7cbb-4c1a-9800-e7c7d98ef644.png)

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](https://user-images.githubusercontent.com/146040/193851211-b4031ca1-4cc9-47ab-9160-658f4a38d979.png)](https://user-images.githubusercontent.com/146040/193851211-b4031ca1-4cc9-47ab-9160-658f4a38d979.png)

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](#php-configuration).

[![Mapping predicates configuration page](https://user-images.githubusercontent.com/146040/193851215-86b8ad05-0c1a-431c-ad4b-5750997fd642.png)](https://user-images.githubusercontent.com/146040/193851215-86b8ad05-0c1a-431c-ad4b-5750997fd642.png)

[![Editing mapping predicates via the configuration page](https://user-images.githubusercontent.com/146040/193854181-af8b85f2-1444-4882-a0af-d8123331f30c.png)](https://user-images.githubusercontent.com/146040/193854181-af8b85f2-1444-4882-a0af-d8123331f30c.png)

### REST API

[](#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](docs/rest.md).

Installation
------------

[](#installation)

Platform requirements:

- [PHP](https://www.php.net) 8.1 or later (tested up to 8.4)
- [MediaWiki](https://www.mediawiki.org) 1.43 or later (tested up to 1.43)
- [Wikibase](https://wikibase.consulting/what-is-wikibase/) 1.43 or later (tested up to 1.43)

The recommended way to install Wikibase RDF is using [Composer](https://getcomposer.org) with [MediaWiki's built-in support for Composer](https://professional.wiki/en/articles/installing-mediawiki-extensions-with-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](https://www.pro.wiki/help/mediawiki-localsettings-php-guide) file:

```
wfLoadExtension( 'WikibaseRDF' );
```

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

PHP Configuration
-----------------

[](#php-configuration)

Configuration can be changed via [LocalSettings.php](https://www.pro.wiki/help/mediawiki-localsettings-php-guide).

### Allowed predicates

[](#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
-----------

[](#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

[](#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
-------------

[](#release-notes)

### Version 2.0.0 - 2025-07-07

[](#version-200---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

[](#version-110---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

[](#version-100---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

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance61

Regular maintenance activity

Popularity34

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~503 days

Total

3

Last Release

315d ago

Major Versions

1.1.0 → 2.0.02025-07-07

PHP version history (2 changes)1.0.0PHP &gt;=8.0

2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

![](https://avatars.githubusercontent.com/u/1104078?v=4)[Karsten Hoffmeyer](/maintainers/kghbln)[@kghbln](https://github.com/kghbln)

---

Top Contributors

[![malberts](https://avatars.githubusercontent.com/u/1428594?v=4)](https://github.com/malberts "malberts (117 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (88 commits)")[![translatewiki](https://avatars.githubusercontent.com/u/24829418?v=4)](https://github.com/translatewiki "translatewiki (61 commits)")[![Universal-Omega](https://avatars.githubusercontent.com/u/54654040?v=4)](https://github.com/Universal-Omega "Universal-Omega (8 commits)")[![kghbln](https://avatars.githubusercontent.com/u/1104078?v=4)](https://github.com/kghbln "kghbln (4 commits)")[![alistair3149](https://avatars.githubusercontent.com/u/9260542?v=4)](https://github.com/alistair3149 "alistair3149 (3 commits)")[![Volker-E](https://avatars.githubusercontent.com/u/619536?v=4)](https://github.com/Volker-E "Volker-E (1 commits)")

---

Tags

mediawikimediawiki-extensionrdfwikibasewikibase-extensionmediawikiRDFwikibase

###  Code Quality

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/professional-wiki-wikibase-rdf/health.svg)

```
[![Health](https://phpackages.com/badges/professional-wiki-wikibase-rdf/health.svg)](https://phpackages.com/packages/professional-wiki-wikibase-rdf)
```

###  Alternatives

[mediawiki/semantic-media-wiki

An extension to MediaWiki that lets you store and query structured data within wiki pages

586361.8k33](/packages/mediawiki-semantic-media-wiki)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3164.5k](/packages/starcitizentools-citizen-skin)[mediawiki/semantic-result-formats

Provides additional result formats for queries using Semantic MediaWiki

51180.7k1](/packages/mediawiki-semantic-result-formats)[mediawiki/translate

The only standard solution to translate any kind of text with an avant-garde web interface within MediaWiki, including your documentation and software

457.9k](/packages/mediawiki-translate)[professional-wiki/network

MediaWiki extension for adding interactive network visualizations to your wiki pages

3211.9k](/packages/professional-wiki-network)[mediawiki/universal-language-selector

The primary aim is to allow users to select a language and configure its support in an easy way. Main features are language selection, input methods and web fonts.

2418.6k](/packages/mediawiki-universal-language-selector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
