RDFIO-Mediawiki Extension: Difference between revisions
Line 109: | Line 109: | ||
|title=Web 2.0 strategies in libraries and information services | |title=Web 2.0 strategies in libraries and information services | ||
|journal=The Australian Library Journal | |journal=The Australian Library Journal | ||
}} | }} | ||
Revision as of 16:32, 26 May 2020
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 management[1] 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
Installing
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"
Settings
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
SPARQL Query
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/>.
SELECT *
WHERE { ?s ?p ?v }
LIMIT 200
@PREFIX w : <http://oooooooooo.io/index.php/Special:URIResolver/> .
@PREFIX foaf: <http://xmlns.com/foaf/0.1/>.
SELECT *
WHERE { ?s ?p "André Castro" }
LIMIT 25
Who knows who
@PREFIX w : <http://oooooooooo.io/index.php/Special:URIResolver/> .
@PREFIX foaf : <http://xmlns.com/foaf/0.1/> .
SELECT *
WHERE { ?s foaf:knows ?v }
LIMIT 25
Furture Research
- can we use RDIO to query external SPARQL endoints and bring the results to the wiki? Don't think so
- can we embbed SPARQL queries in wiki pages?
- use Python's RDFlib to query the wiki, as explified in Where do Mayors Come From: Querying Wikidata with Python and SPARQL
References
TestByrne 2008
{{#scite:Byrne 2008
|type=journal |author=Byrne, A |year=2008 |title=Web 2.0 strategies in libraries and information services |journal=The Australian Library Journal
}}
{{{author}}}. ({{{year}}}) "{{{title}}}". {{{journal}}} .
{{#scite: |@article{Lampa2017, doi = {10.1186/s13326-017-0136-y}, url = {https://doi.org/10.1186/s13326-017-0136-y}, year = {2017}, month = sep, publisher = {Springer Science and Business Media {LLC}}, volume = {8}, number = {1}, author = {Samuel Lampa and Egon Willighagen and Pekka Kohonen and Ali King and Denny Vrande{\v{c}}i{\'{c}} and Roland Grafstr\"{o}m and Ola Spjuth}, title = {{RDFIO}: extending Semantic {MediaWiki} for interoperable biomedical data management}, journal = {Journal of Biomedical Semantics} } }}
- ↑ Lampa, S., Willighagen, E., Kohonen, P. et al. RDFIO: extending Semantic MediaWiki for interoperable biomedical data management. J Biomed Semant 8, 35 (2017). https://doi.org/10.1186/s13326-017-0136-y