Extension:LinkedWiki

INSTALLATION OBSOLETE: In 2 days, this page will be up to date.

The LinkedWiki extension lets you reuse Linked Data in your wiki. You can get data from Wikidata or another source directly with a SPARQL query. This extension also provides Lua functions for building your module so that you can write your data in your RDF database.

Configuration of your SPARQL endpoints
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





Module : Lua class to read/write your data
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



Parsers : Reuse your data in your wiki
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 :
 * #sparql reuses your data in your wiki with templates
 * (deprecated) #wsparql reuses your data in your wiki with widgets

Build your SPARQL query (Work in progress)
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)
We are developing (from scratch) several tools to insert nice visualization of your data in your wiki. The version 3.1.0 uses Sgvizler2 to insert maps of Google or OpenStreetMap (Work in progress).

See details : Visualization

Import Turtle in wiki to write, check, transfer and validate RDF (Work in progress - Installation is hard)
The LinkedWiki extension creates namespaces Data and UserData. Only users in group Data can change these namespaces. A user can use these namespaces to import a Turtle file RDF started in a software and import (check/validate) it. This part is experimental and can again change. See details

Download instructions
You can download the last version with this link.

LinkedWiki
To install this extension :
 * 1) copy the extension in the folder   of your wiki
 * 2) in the folder, execute   and   (or  ). If you don't have install composer or yarn, see in this page : "How install composer and yarn ?".
 * 3) add the following line to :


 * If you want to make an infobox with LinkedWiki, you need to install Extension:Scribunto,Extension:Capiunto and read the quick start with Lua.


 * If you want to use a map, you need to insert in the file keys.json the key of Google Map and the token access of OpenStreepMap.

Add a data tab for main pages and user pages
LinkedWiki allows the tag  to write with RDF/Turtle directly in a page (their ontology or their SHACL rules, for example) but people prefer to separate natural language from RDF/Turtle in their wiki.

In your localsettings, the following line inserts a new Data tab on all main pages and user pages. After, you can give the rights to users to see or not this tab and to change or not the pages in the Data namespace.

Add a push tab
When you have finished working in private (ie, in a private wiki), you may want to push your pages (with their modules, templates, files and data pages) in another (public) wiki. This installation inserts has discrete push tab on your pages. On the Special: BotPasswords page of the target wiki, you need only to create the login and password for the locasettings of your source wiki.

You can add push targets (wikis you can push content to) by adding elements to the  array. The array keys should be the names of your wikis and the values should point to the wiki root, without tailing slash. You can find your wiki root by clicking the history tab on a page, finding the '/index.php' in it, and taking everything that's left of that. You create the logins and passwords via the Special: BotPasswords of targets.

Example:

Details:

Configuration
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.

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


 * See details : Configuration
 * Examples of other endpoints : List of configurations

Errors about CURL
If, after the installation, you have errors about CURL, probably you need to install the lib php5-curl in your server. Example with ubuntu, debian or fedora: or

Questions ?

 * FAQ and problems
 * Old google group : http://groups.google.com/group/linkedwiki

How install composer and yarn ?
For debian or fedora: or

How to propose a new feature ?

 * You can propose a new task : Propose a new feature

How to declare a problem ?

 * You can declare a problem here : Declare a problem

=See also=


 * SPARQL in Wikipedia
 * SPARQL examples
 * Wikidata examples
 * Tutorial SPARQL in french (Wikiversity)