By @mhawksey

OER Visualisation Project: Adding a bit of SPARQL to make a UKOER map [day 2] #ukoer #ooher

I’m not intending on blogging about the OER Visualisation Project but I’ve got a new piece in the jigsaw worth sharing. Below should be an embedded map of JISC/HEA funded OER projects (well half of them anyway. If you visit the Yahoo Pipe which was used to generate this there are 51 projects listed but I was only able to automatically get locations for 28). This was generated by using SPARQL to query the CETIS PROD database for projects matching the strand title “open education …”. After the map is the recipe used to make it, which includes some 2-to-1 online tutoring (aren’t PLNs great 😉 and a bunch of other tools which I might dip into during this project.
{“pipe_id”:”c0fc850aa9498ece2d41320d7234b024″,”_btype”:”map”}
[As part of the processes I also produced this PROD Theme GeoMap as a proof of concept.  As there’s a user defined theme entry on this it would be easy to drop into the CETIS PROD summary pages like this one filtering the querystring parameter into the map embed code highlighted below:
<script src=”http://l.yimg.com/a/i/us/pps/mapbadge_1.5.js”>{“pipe_id”:”810495bf81c7d207400937f2ebfe0ebb”,”_btype”:”map”,”pipe_params”:{“theme”:”UKOER“}}</script>

How it was made

It all started last night after reading Owen Stephens’ post on Experimenting with British Museum data in which he uses SPARQL (a query language) to extract data for use elsewhere. As I mentioned in my opening post for this project I’m not a huge fan of SPARQL, part of the problem being I can’t get my head around the markup. As I was venting my frustration ‘via the medium of Twitter’ I started received encouraging words of support from Wilbert Kraan (CETIS) @wilm and Owen @ostephens which spilled over into this Google Doc.
[If you want to see what the query in the doc does Wilbert also pointed me to the Sgvizler library which renders SPARQL SELECT queries using Google Visualization API. A version is hosted on Wilbert’s site and here is the query rendered as a table). Another resource I’ve found helpful that was recommended by Owen is Ed Chamberlain’s SPARQL Tutorial].
With my SPARQL Rosetta in hand I headed back to the CETIS Wiki knowing there was a SPARQL example to produce geographical position of projects from the FSD programme that use Archimate.
From this I produced:

PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX owl:  <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>
PREFIX prod: <http://prod.cetis.ac.uk/vocab/>
PREFIX doap: <http://usefulinc.com/ns/doap#>
PREFIX mu:   <http://www.jiscmu.ac.uk/schema/muweb/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT DISTINCT xsd:float(?lat) xsd:float(?long) ?projectName ?desc ?project
WHERE {  
?project a doap:Project .
?project doap:name ?projectName .
?project prod:strand ?strand .
 FILTER regex(?strand, “^open education”, “i”) .
OPTIONAL { ?project doap:shortdesc ?desc } .
?project doap:vendor ?uni .
OPTIONAL {  
 ?uni owl:sameAs ?fbID .
 ?muID owl:sameAs ?fbID .
 ?muID geo:lat ?lat .
 ?muID geo:long ?long .
}
}

Which I now translate as SELECT DISTINCT project id, name, latitude, longitude, description and strand WHERE strand begins with ‘open education’ “ignoring case” and OPTIOANLly get a short description (if available) and from project host name OPTIONALly lookup a matching lat/long from JISC Monitoring Unit.
There a couple of things we can do with this query. Putting it through the Rensselaer Polytechnic Institutes SPARQL Proxy we can generate formats easily digestible by Yahoo Pipes, as demonstrated by the example above (if you log in to Pipes you can see there is very little going on with the source). The proxy service also has a Google Visualization API output which could lend itself to further mashineerings, wrapping in widget/gadget etc.
Another option is to publish the results as .csv  and then use the resulting url in the formula =ImportData(“your url”), which I’ve done in this spreadsheet and again you have options for presenting the data in different ways.
So lots of potential around these techniques to extract some data, but notes of caution Yahoo Pipes can be very temperamental (in fact while I hover over the publish button for this post it’s showing no results) and whilst the concept of linked data eg using JISC MU data to get geo-location for projects listed in PROD, as the spreadsheet linked above shows it didn’t always find a longitude/latitude for the project, it was a 50% hit (more investigation required).
Big thanks for Wilbert and Owen for there help with this!

Exit mobile version