MW2SPARQL

MediaWiki 2 SPARQL is an experimental SPARQL endpoint for Wikimedia wikis working on top of their database. It is based on Ontop and rewrites SPARQL queries to SQL.

Are currently available:
 * An endpoint for the English Wikipedia: http://tools.wmflabs.org/mw2sparql/enwiki/sparql
 * An endpoint for the French Wikipedia: http://tools.wmflabs.org/mw2sparql/frwiki/sparql

As there is no UI built yet, you could use generic SPARQL endpoint user interfaces like YASGUI (you have to input the URL of the endpoint you want to query in the endpoint URI input).

The mapping is under work and is very partial and not stable.

Query examples
Retrieve the current facts available about the English Wikipedia SPARQL article:

execute in YASGUI. .

Current data model
The formal OWL definition of the model used is available at: http://tools.wmflabs.org/mw2sparql/ontology

The prefixes used are:
 * rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
 * rdfs: http://www.w3.org/2000/01/rdf-schema#
 * owl: http://www.w3.org/2002/07/owl#
 * xsd: http://www.w3.org/2001/XMLSchema#
 * mw: http://tools.wmflabs.org/mw2sparql/ontology#

Pages
A MediaWiki page. It has the  type and contains a , a  , is in a namespace stored in. Its content model is provided by. Internal links to other pages are connected by, categories by   and included pages by. Its latest revision is connected throw.

New pages have the type  and redirection pages the type.

Example:

Revision
A version of a MediaWiki page. Has the type, an oldid stored by  , belongs to the page connected by  , may have a previous revision provided by.

Example:

Known issues

 * The URIs of the MediaWiki page uses the page id and not the page title
 * GROUP BY is not supported