PHPackages                             professional-wiki/semantic-wikibase - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. professional-wiki/semantic-wikibase

ActiveMediawiki-extension[Utility &amp; Helpers](/categories/utility)

professional-wiki/semantic-wikibase
===================================

MediaWiki extension that makes Wikibase data available in Semantic MediaWiki

0.1.0(5y ago)183686[3 issues](https://github.com/ProfessionalWiki/SemanticWikibase/issues)[3 PRs](https://github.com/ProfessionalWiki/SemanticWikibase/pulls)GPL-2.0-or-laterPHPPHP &gt;=7.4CI failing

Since Aug 22Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/ProfessionalWiki/SemanticWikibase)[ Packagist](https://packagist.org/packages/professional-wiki/semantic-wikibase)[ Docs](https://github.com/ProfessionalWiki/SemanticWikibase)[ GitHub Sponsors](https://github.com/JeroenDeDauw)[ Patreon](https://www.patreon.com/jeroendedauw)[ RSS](/packages/professional-wiki-semantic-wikibase/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

Semantic Wikibase
=================

[](#semantic-wikibase)

MediaWiki extension that makes [Wikibase](https://wikibase.consulting/what-is-wikibase/) data available in [Semantic MediaWiki](https://www.semantic-mediawiki.org).

Semantic Wikibase was created by [Wikibase developers](https://professional.wiki/en/wikibase-software-development) at [Professional Wiki](https://professional.wiki/)with help from [Frans AL van der Horst](https://www.linkedin.com/in/frans-a-l-van-der-horst-95a3836/).

Demo
----

[](#demo)

[![](.github/youtube.png "Play video")](https://www.youtube.com/watch?v=ovZl_ZoGkc0)

Platform requirements
---------------------

[](#platform-requirements)

- [PHP](https://www.php.net) 7.4 or later
- [MediaWiki](https://www.mediawiki.org) 1.35.x
- [Semantic MediaWiki](https://www.semantic-mediawiki.org) 3.2.x
- [Wikibase Repository](https://www.mediawiki.org/wiki/Extension:Wikibase_Repository) branch: REL1\_35

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

[](#installation)

First install MediaWiki, Semantic MediaWiki and Wikibase Repository.

The recommended way to install Semantic Wikibase 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 commandline, go to your wikis root directory. Then run these two commands:

```
COMPOSER=composer.local.json composer require --no-update professional-wiki/semantic-wikibase:*
composer update professional-wiki/semantic-wikibase --no-dev -o
```

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

```
wfLoadExtension( 'SemanticWikibase' );
```

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

As a final step you need to configure the property namespaces. See the configuration section.

Translated data
---------------

[](#translated-data)

Data part of [Wikibase Items and properties](https://www.mediawiki.org/wiki/Wikibase/DataModel) gets translated to Semantic MediaWiki property value pairs.

### Labels, descriptions, IDs, etc

[](#labels-descriptions-ids-etc)

Translated data in the form `Wikibase datamodel element => SMW property name (SMW property type)`

- EntityId =&gt; Wikibase ID (Text)
- Labels =&gt; Wikibase label (Monolingual text)
- Descriptions =&gt; Wikibase description (Monolingual text)
- Aliases =&gt; Wikibase alias (Monolingual text)

### Statements

[](#statements)

When a [statement](https://www.mediawiki.org/wiki/Wikibase/DataModel#Statements) is translated, only the value of the "main snak" is stored in SMW.

The [SMW property](https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types) name is the ID of the Wikibase property, for instance P42. The label of the Wikibase property gets added as alias. This means both `[[P42::+]]` and `[[Capital city::+]]` are valid in SMW queries.

Deprecated statements are never translated. Normal statements are not translated if there are preferred statements. The SMW property type is based on the [Wikibase property type](https://www.mediawiki.org/wiki/Wikibase/DataModel#Datatypes_and_their_Values). Only statements with a supported property type are translated.

Supported property types
------------------------

[](#supported-property-types)

  Wikibase name (en) SMW name (en) Wikibase id SMW id   **Commons media file** Text commonsMedia \_txt   **External identifier** External identifier external-id \_eid   **Geographic coordinates** Geographic coordinates globe-coordinate \_geo   **Item** Page wikibase-item \_wpg   **Monolingual text** Monolingual text monolingualtext \_mlt\_rec   **Point in time** Date time \_dat   **Property** Page wikibase-property \_wpg   **Quantity** Subobject (Page + Record) quantity \_wpg + \_rec   **String** Text string \_txt   **URL** URL url \_uri Currently not supported types:

- Entity Schema (entity-schema)
- Geographic shape (geo-shape)
- Tabular Data (tabular-data)

Configuration
-------------

[](#configuration)

You can configure Semantic Wikibase via [LocalSettings.php](https://www.mediawiki.org/wiki/Manual:LocalSettings.php).

### Property namespaces

[](#property-namespaces)

This is the only required configuration for setting up Semantic Wikibase.

Wikibase and Semantic MediaWiki both add a Property namespace called "Property". This results in a conflict which can be resolved by renaming either the Wikibase property namespace or the Semantic MediaWiki property namespace.

Renaming the Wikibase property namespace:

```
$wgExtraNamespaces[WB_NS_PROPERTY] = 'WikibaseProperty';
$wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'WikibaseProperty_talk';
```

Renaming the SMW property namespace:

```
$wgExtensionFunctions[] = function() {
    $GLOBALS['wgExtraNamespaces'][SMW_NS_PROPERTY] = 'SemanticProperty';
    $GLOBALS['wgExtraNamespaces'][SMW_NS_PROPERTY_TALK] = 'SemanticProperty_talk';
};
```

You can choose what to rename these namespaces to. They do not need to be `WikibaseProperty` and/or `SemanticProperty`. As long as they are not the same, Semantic Wikibase will work.

You will likely need to set these extra permissions to avoid getting errors when creating new items or properties:

```
$wgGroupPermissions['user']['item-create'] = true;
$wgGroupPermissions['user']['property-create'] = true;
```

### Property label language

[](#property-label-language)

The language used for translation of property labels defaults to the wiki language (`$wgLanguageCode`).

This means that if your wiki language is English, and you have a property P1 with Dutch label "lokatie" and English label "location", the name of the property in Semantic MediaWiki will be "location".

You can specify a language different from your wiki language should be used. This is done with the `$wgSemanticWikibaseLanguage` setting. With the below example, the label for P1 would be "lokatie":

```
$wgSemanticWikibaseLanguage = 'nl';
```

### Disabling translation for an entity type / namespace

[](#disabling-translation-for-an-entity-type--namespace)

```
$smwgNamespacesWithSemanticLinks[WB_NS_ITEM] = false;
$smwgNamespacesWithSemanticLinks[WB_NS_PROPERTY] = false;
```

Enhancement ideas
-----------------

[](#enhancement-ideas)

Data translation:

- Ability to whitelist or blacklist entities from being translated
- Ability to whitelist or blacklist statements from being translated
- Translation of qualifiers, references, statement rank and other non-main-snak data
- Support for Entities other than Items and Properties
- Translation of Item sitelinks

Properties:

- Detection and possibly prevention of property name conflicts between Wikibase and SMW
- (Multilingual) descriptions of Wikibase properties on SMW property pages
- Grouping of Wikibase properties on Special:Browse

[Professional.Wiki](https://professional.wiki) provides commercial [MediaWiki development](https://professional.wiki/en/mediawiki-development), [Wikibase development](https://professional.wiki/en/wikibase-software-development), and [managed wiki hosting](https://professional.wiki/en/hosting).

Release notes
-------------

[](#release-notes)

### Version 0.1

[](#version-01)

Released on September 3, 2020

- [Initial release with support for main snaks and most data types](https://professional.wiki/en/news/semantic-wikibase-released)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance55

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

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

Unknown

Total

1

Last Release

2140d ago

### 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

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (100 commits)")[![kghbln](https://avatars.githubusercontent.com/u/1104078?v=4)](https://github.com/kghbln "kghbln (3 commits)")[![alistair3149](https://avatars.githubusercontent.com/u/9260542?v=4)](https://github.com/alistair3149 "alistair3149 (1 commits)")[![kizule](https://avatars.githubusercontent.com/u/28963303?v=4)](https://github.com/kizule "kizule (1 commits)")

---

Tags

mediawikimediawiki-extensionopendatasemantic-mediawikisemantic-websmwwikiwikibasewikibase-extensionwikidatamediawikiwikiSemantic Webstructured-datawikidatawikibaseSMWSemantic MediaWiki

###  Code Quality

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[professional-wiki/wikibase-local-media

Adds the local media data type to Wikibase

128.8k](/packages/professional-wiki-wikibase-local-media)[mediawiki/semantic-media-wiki

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

622381.2k34](/packages/mediawiki-semantic-media-wiki)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[mediawiki/semantic-result-formats

Provides additional result formats for queries using Semantic MediaWiki

56188.7k1](/packages/mediawiki-semantic-result-formats)[mediawiki/semantic-extra-special-properties

Provides extra special properties for Semantic MediaWiki

3079.9k1](/packages/mediawiki-semantic-extra-special-properties)

PHPackages © 2026

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