From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status stable

ImplementationTemplate:Extension#type Parser extension, Special page, Data extraction
DescriptionTemplate:Extension#description The LinkedWiki extension allows to read and save your data and reuse the Linked Open Data in pages or modules of your Wiki.
Author(s)Template:Extension#username Karima Rafes (Karima Rafestalk)
Latest versionTemplate:Extension#version 3.0.0
MediaWikiTemplate:Extension#mediawiki 1.25.* or greater
PHPTemplate:Extension#php 5.3+ and 7+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license CC BY-NC-SA 3.0
ExampleTemplate:Extension#example http://daap.eu/wiki/Demo_Wikidata
Hooks usedTemplate:Extension#hook

Translate the LinkedWiki extension if it is available at translatewiki.net

Check usage and version matrix.


Open tasks · Report a bug

The LinkedWiki extension allows to reuse the Linked Data in your Wiki. You are able to reuse Wikidata or another source directly with a SPARQL query. This extension gives also Lua functions to build your module in order to write your data in your RDF database.


Configuration of your SPARQL endpoints[edit]

Often, the configuration of endpoints is not trivial and very different in function of RDF databases. In the configuration of the extension, you can declare correctly public endpoints and also your private endpoints.

The extension supports the endpoints with credentials where the users of your Wiki can reuse your private data without seeing your credentials.

See details : Configuration of the LinkedWiki extension

With a lua class, you are able to save and check data with an external knowledge base such as Wikidata.

Module : Lua class to read/write your data[edit]

Generally in Wiki for users, a page is a object where they want write/read a property. Unfortunately, your ontology can be complex and the contributor are rarely experts in RDF or in SPARQL.

The extension can simplify the job of contributors and developers without imposing a specific ontology.

We built a Lua class where you can build your own module (for example an infobox) where you are able to write or read a property via a simple function. This function will use the description of your ontology in the configuration of the extension in order to save correctly this property in your database.

See details : Use LinkedWiki in your module

Example with the SPARQL parser with templates
Example with the WSPARQL parser. You can build by yourself new widgets for your Wiki. Example with the Google maps widget with Worldwide Earthquakes.

Parsers : Reuse your data in your wiki[edit]

The extension gives parser functions #SPARQL and #WSPARQL in order to reuse your data or the Linked Data in your wiki.

You can use a specific endpoint or reuse an endpoint already defined in he configuration.

It's possible to customize the result of your SPARQL query via templates or via widgets.

See details :

Build your SPARQL query (Work in progress)[edit]

The LinkedWiki extension gives two SPARQL editors. Flint Editor works with SPARQL endpoint 1.1 or 1.0 but sometimes, it doesn't work for example with Wikidata.

We develop a new SPARQL editor where you can select in one click an endpoint already defined in your configuration and read (and write, if you want) via SPARQL directly in this editor.

See details : Test your queries in your wiki (Work in progress)

Visualization (Work in progress)[edit]

We tested several tools to insert nice visualization of your data in your wiki.

See details : Visualization

Download instructions[edit]

For the version 3.x, you need to use the master version. It's tested with PHP7 and Mediawiki 1.27 (but it works also with PHP5 and Mediawiki 1.25+).

You can download the last version with this link.


To install this extension :

  1. copy the extension in the folder extension/LinkedWiki of your wiki
  2. add the following line to LocalSettings.php:
wfLoadExtension( 'LinkedWiki' );


Wikidata is the endpoint by default of your wiki (read only).

If you add a new endpoint and change the default endpoint of your wiki, you need to change the file : extension/Linkedwiki/extension.json

And you have to mask this file on the server. You can add these line in the file .htaccess in the root folder.

RewriteEngine On
RewriteRule ^.*/extensions/LinkedWiki/.*\.json$ /w/index.php

Example in extension/Linkedwiki/extension.json with Wikidata doesn't support the POST method.

      "http://www.wikidata.org": {
        "debug": false,
        "isReadOnly": true,
        "endpoint": "https://query.wikidata.org/sparql",
        "typeRDFDatabase": "blazegraph",
        "HTTPMethodForQuery": "GET",
        "storageMethodClass": "WikidataStorageMethod",
        "lang": "en"

Known issue[edit]

Errors about CURL[edit]

If, after the installation, you have errors about CURL, probably you need to install the lib php5-curl in your server.

Example with ubuntu & fedora :
# apt-get install php5-curl
apt-get install php70w-common
# yum install php5-curl
yum / dnf install php70w-common

Questions ?[edit]

How to propose a new feature ?[edit]

How to declare a problem ?[edit]

See also[edit]