Extension:LinkedWiki

Use LinkedWiki if you want to use data from external endpoints and expose your data to the rest of the world (linked data).

The LindeWiki extension will allow to integrate Semantic Mediawiki with a SPARQL 1.1 endpoint via an API REST (ie, HTTP GET).

What can this extension do?
The LinkedWiki extension can :
 * read a local or remote endpoint with Sparql 1.0 (lib ARC2, tested with DBpedia and 4store)
 * write a local or remote endpoint with the functions Insert DATA and Delete DATA of SPARQL 1.1 (lib 4store-php, tested only with 4store)
 * help you to build and test a sparql query with a special page
 * share with the special page, your query sparql because it can generate in your wiki a new page "tutorial" with your query.
 * print the result of your query in a page with a parser function. Example :
 * print the result of your query in a mediawiki widget. So you can build yourself new widgets for your linked data in your Linked Wiki. Example with the widget Google static maps :

Comparison of Semantic MediaWiki triplestore connectors
There are important differences with the Extension:Halo Extension, Extension:SparqlExtension and Extension:RDFIO :
 * LinkedWiki don't change the real ontology of your semantic mediawiki. Interoperability !
 * LinkedWiki uses 4Store because 4Store is an efficient, scalable and stable RDF database more than jena or ARC2 (LinkedWiki not use the ARC's endpoint, only the API parser sparql1.0).
 * LinkedWiki uses Sparql 1.1 to write in a local or remote endpoint.(Insert DATA and Delete DATA)
 * LinkedWiki can use Extension:Widgets to print a result because anybody can customize a widget without change the code php.
 * LinkedWiki is a project Open Source with maintenance.

Basic Use : #sparql
Print a simple Array with the results :


 * Querying of the default endpoint and in all the graphs of this endpoint.


 * Querying of the default endpoint with one graph.


 * Querying of the default endpoint with the graph of this wiki (define with the variable $wgLinkedWikiGraphWiki).


 * Querying the properties of the current page (3 query equivalent) :


 * Querying with any language.

Parameter : endpoint

 * Querying of another endpoint.

Parameter : headers

 * Change the headers.

Parameter : classHeaders

 * You can hide or change the style of your headers. Here, the first column hasn't header and it is unsortable.

Example :



Parameter : templates
With a example of template like, Template:Test1 : , and


 * You can use this template like that


 * And you can use a different template for each column :

Parameter : cache

 * It's possible that your data can be very volatile and you need to refresh the result of this query each time. So you can disable the cache with the parameter cache like that :

Parameter : debug

 * Well, you can add several parameters in same time and so the text wiki can be very hard to debug. This parameter give you the result of this parser before the last parsing of mediawiki :

Usage
You want use your SPARQL results with Google Maps, Youtube, Flickr, etc... It's very hard or impossible to develop all the possibilities in an extension mediawiki. So, the function wsparql can preformat the parameters for a widget.


 * The parameters query, endpoint, cache and debug are the same than #sparql, the syntax is different (little) :


 * Example, with the widget Google Static Maps :


 * Result of wsparql before the parsing of mediawiki :

And after parsing :



You can see, the wsparql aggregates the sparql results in one list, with this pattern : rows.NUMBER_LINE.VARIABLE_NAME = VARIABLE_VALUE rows.0.point=43.30, 5.38 | rows.1.point=48.83, 2.3 | rows.2.point=49.93, 2.3
 * Like that :

You have to find a compatible widget with this syntax or you can create or change a widget of mediawikiwidgets.

Build your widget
This widget allows you to embed Google Static Maps on your wiki page.
 * 1) Install the  extension Widgets
 * 2) Create the page Widget:NAME_OF_YOUR_WIDGET
 * 3) Insert your code, example with google static maps :

Sample result


And share your widget in mediawikiwidgets.org.

I resume!
 * To read one list like rows.NUMBER_LINE.VARIABLE_NAME = VARIABLE_VALUE, you have to do a foreach of rows and read keys and items, like that :

It's a little hard the first time. Use the talk page, if you are a problem.

Download instructions
Download the last version on GitHub at http://github.com/BorderCloud/LinkedWiki/downloads.

Without endpoint for your wiki
Install Extension:Semantic MediaWiki.

If you want use a widget with sparql, install Extension:Widgets.

Extract the downloaded archive into your extension/ directory. The folder name of destination is LinkedWiki.

To install this extension, add the following to LocalSettings.php:

Installation of Extension LinkedWiki
Install Extension:Semantic MediaWiki.

If you want use a widget with sparql, install Extension:Widgets.

Extract the downloaded archive into your extension/ directory. The folder name of destination is LinkedWiki.

To install this extension, add the following to LocalSettings.php:

Installation of 4Store
Read this little tutorial.

See also the site of 4store