RDFIO-Mediawiki Extension

From artserver wiki

RDFIO is a Mediawiki extension which:

  • adds SPARQL Endpoint to SMW installtion
  • imports RDFs into the wiki
  • queries remote SPARQL endpoint URL

To me it is quite interesting to be able to have a SPARQL endpoint in a wiki, without having to setup a RDF store, which to the extent of my knowldge, disables SMW's ask queries, forcing users to use only the SPARQL endpoint. So RDFIO seems to combine the best of both approaches.

The article RDFIO: extending Semantic MediaWiki for interoperable biomedical data managementLampa2017 was quite eye opening, as to how RDFIO can be used to expand the territory of Mediawiki + Semantic Mediawiki into Semantic Web, in "usage scenarios such as bootstrapping new wikis from existing data sources, or round-tripping between the SMW data structure and the RDF data format used in the wider Semantic Web, "

The possibility of gathering and publishing from and to other Semantic Web resources, or in other words, sindicating structured data, makes the RDFIO extension quite appealing. I was looking forward to be able to embed sparql queries from other sparql endpoints into this wiki, bringing in other data sources to here as well as my data accessible through RDFIO sparql endpoint. However, it didn't quite work as I expected, for the following reasons:

  • RDFIO sparql endpoint was often giving incoherent results, seeming to not pickup all the values of a property which I was querying
  • It has no functionality to embed sparql queries in wiki pages, it's main focus is on importing RDF data.
    • in my view, it does not take advantage of a killer-feature the point of the Semantic Web, which is data syndication - being able to do realtime queries data that is being curated by other communities, rather than have data frozen and then giving me the responsibility to curate it.
  • the documentation is also scarse and organized

In search for a Mediawiki extension that we cover those points I came across the LinkedWiki extension. Started playing with it and I quite excited, so decided to investigate a bit more, which can be read in LinkedWiki-Mediawiki Extension

In any case here are my notes on RDFIO


Installation of RDFIO is simple, if the installation steps are followed.

However, as described in the following issue: the extension development team is having a hard time to keep up with the development and deployment rate of Mediawiki. So for the moment, for Mediawiki 1.34.1, the branch 59-make-work-with-mw-1.34 should be checkout.

php composer.phar require rdfio/rdfio --update-no-dev
cd extensions/
mv Rdfio/ Rdfio.bak
git clone https://github.com/rdfio/RDFIO.git Rdfio
cd Rdfio
git checkout 59-make-work-with-mw-1.34
php ../../maintenance/update.php
rm -r ../Rdfio.bak

Once done in the page Special:RDFIOAdmin it should read: "The triplestore is already set up"


I have added the following settings to LocalSettings.php, so that the SPARQL endpoint is accessible to non-logged in users, but editind (insert statments are disabled)

# ---------------------------------------------------------------
#  RDFIO Configuration
# ---------------------------------------------------------------
$rdfiogAllowRemoteEdit = false;
$wgGroupPermissions['*']['rdfio-sparql'] = true;

import RDF

using Rdfio/maintenance/importRdf.php it is possible to import to the wiki RDF files. As example I will import Tim Berners Lee FOAF card

php importRdf.php --server http://localhost --in ~/Documents/Projects/RDF/LearningSparql/TimBernersLee.ttl

That import will probably add a few Jobs to be MW queue which need to be run:

 php ../../maintenance/update.php


We can user Special:SPARQLEndpoint to query the wiki property & values

Note: that despite runing the update.php and runJobs.php I needed to perform a refresh action on the pages with Semantic annotation so that the RDFIO could pick it them up.

@PREFIX w : <http://oooooooooo.io/index.php/Special:URIResolver/> .
@PREFIX foaf: <http://xmlns.com/foaf/0.1/>.

WHERE { ?s ?p ?v }

@PREFIX w : <http://oooooooooo.io/index.php/Special:URIResolver/> .
@PREFIX foaf: <http://xmlns.com/foaf/0.1/>.

WHERE { ?s ?p "André Castro" }

Who knows who

@PREFIX w : <http://oooooooooo.io/index.php/Special:URIResolver/> .
@PREFIX foaf : <http://xmlns.com/foaf/0.1/> .

WHERE { ?s foaf:knows ?v }

Furture Research


"Test Quote"Byrne 2008


|browselinks=true // ("true", "1", "on" and "yes") or ( "false", "0", "off", and "no")


... more about "RDFIO-Mediawiki Extension"
Code Notes +
Date"Date" is a type and predefined property provided by Semantic MediaWiki to represent date values.
2020 +