Download the PHP package professional-wiki/semantic-wikibase without Composer
On this page you can find all versions of the php package professional-wiki/semantic-wikibase. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download professional-wiki/semantic-wikibase
More information about professional-wiki/semantic-wikibase
Files in professional-wiki/semantic-wikibase
Package semantic-wikibase
Short Description MediaWiki extension that makes Wikibase data available in Semantic MediaWiki
License GPL-2.0-or-later
Homepage https://github.com/ProfessionalWiki/SemanticWikibase
Informations about the package semantic-wikibase
Semantic Wikibase
MediaWiki extension that makes Wikibase data available in Semantic MediaWiki.
Semantic Wikibase was created by Professional.Wiki with help from Frans AL van der Horst.
Demo
Platform requirements
- PHP 7.4 or later
- MediaWiki 1.35.x
- Semantic MediaWiki 3.2.x
- Wikibase Repository branch: REL1_35
Installation
First install MediaWiki, Semantic MediaWiki and Wikibase Repository.
The recommended way to install Semantic Wikibase 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:
Then enable the extension by adding the following to the bottom of your wikis LocalSettings.php
file:
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
Data part of Wikibase Items and properties gets translated to Semantic MediaWiki property value pairs.
Labels, descriptions, IDs, etc
Translated data in the form Wikibase datamodel element => SMW property name (SMW property type)
- EntityId => Wikibase ID (Text)
- Labels => Wikibase label (Monolingual text)
- Descriptions => Wikibase description (Monolingual text)
- Aliases => Wikibase alias (Monolingual text)
Statements
When a statement is translated, only the value of the "main snak" is stored in SMW.
The SMW property 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. Only statements with a supported property type are translated.
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
You can configure Semantic Wikibase via LocalSettings.php.
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:
Renaming the SMW property namespace:
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:
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":
Disabling translation for an entity type / namespace
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 provides commercial MediaWiki development, Wikibase development, and managed wiki hosting.
Release notes
Version 0.1
Released on September 3, 2020