Very brief introduction to Linked Data for the SSSW 2013 summer school. Preparing for the practical exercises. See http://sssw.org/2013/learning-resources/
5. Open University
Website
Open University
VLE
KMi Website
Mathieu’s
Homepage
Mathieu’s
List of
Publications
Mathieu’s
Twitter
M366 Course
page
Person: Mathieu
Publication: Pub1
Organisation:
The Open University
Course: M366
Country: Belgium
Book: Mechatronics
author
workFor
availableIn
offers
setBook
The Web of
Linked DataThe Web
6. Basis
• URIs and Web based information access
• RDF, graph-based data modelling
• SPARQL, querying and updating over web
endpoints
7. URIs
Example:
http://data.open.ac.uk/course/aa100
An anchor for linking
Let’s say you took this course.
You – took this URI
An identifier for a
data entity
Here, the a course offered by
the Open University
An access point to
representation(s) of
the data entity
In possibly different
formats…
8. RDF – graph data model for the Web
http://data.open.ac.uk/course/aa100
“The arts past and present”
http://data.open.ac.uk/saou/ontology#undergraduate
http://purl.org/vocab/aiiso/schema#Module
http://data.open.ac.uk/topic/arts_and_humanities
http://sws.geonames.org/3017382/ “France”
dc:title
rdf:label
rdf:type
dc:subject
courseLevel
geo:latgeo:long
10. N3<http://data.open.ac.uk/course/aa100> <http://purl.org/dc/terms/title> "The arts past and
present"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://data.open.ac.uk/course/aa100> <http://data.open.ac.uk/saou/ontology#OUCourseLevel>
"1"^^<http://www.w3.org/2001/XMLSchema#string> . <http://data.open.ac.uk/course/aa100>
<http://data.open.ac.uk/saou/ontology#courseLevel> <http://data.open.ac.uk/saou/ontology#undergraduate> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/goodrelations/v1#isSimilarTo> <http://data.open.ac.uk/course/a200> .
<http://data.open.ac.uk/course/aa100> <http://data.open.ac.uk/saou/ontology#hasBook> <http://data.open.ac.uk/book/9780571195473> .
<http://data.open.ac.uk/course/aa100> <http://data.open.ac.uk/saou/ontology#hasBook> <http://data.open.ac.uk/book/9780582817807> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/net/mlo/location> <http://sws.geonames.org/3077311/> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/net/mlo/location> <http://sws.geonames.org/597427/> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/net/mlo/location> <http://sws.geonames.org/2802361/> .
<http://data.open.ac.uk/course/aa100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/vocab/aiiso/schema#Module>
.
<http://data.open.ac.uk/course/aa100> <http://courseware.rkbexplorer.com/ontologies/courseware#has-title> "The arts past and
present"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/net/mlo/assessment> <http://data.open.ac.uk/saou/assessment/end-of-course-
assessment> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/net/mlo/assessment> <http://data.open.ac.uk/saou/assessment/tma> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/dc/terms/subject> <http://data.open.ac.uk/topic/classical_studies> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/dc/terms/subject> <http://data.open.ac.uk/topic/arts_and_humanities> .
<http://data.open.ac.uk/course/aa100> <http://purl.org/dc/terms/subject> <http://data.open.ac.uk/topic/english_language> .
11. SPARQL
• ASK query: is this true?
ask {<http://data.open.ac.uk/course/aa100> a aiiso:Module} (is it a module?)
ask{<http://data.open.ac.uk/course/aa100> dc:subject ?x} (is there a subject to this
module?)
• Select query: Get me some data
select ?book ?title where {
?x a aiiso:Module. ?x dc:subject <http://data.open.ac.uk/topic/Music>.
?x courseware:setBook ?book. ?book dc:title ?title
filter( ?x != <http://data.open.ac.uk/course/aa100> )
} order by ?title limit 100
(get the books associated with courses in music which are not AA100)
• Construct query: Build a (sub) RDF graph
construct {?agent1 foaf:knows ?agent2} where s
{?x bibo:creator ?agent1. ?x bibo:creator ?agent2}
(Construct of graph of people knowing each-other because of being co-authors of at least one thing)
13. Example
select distinct ?course where {
?course
<http://data.open.ac.uk/saou/ontology#isAvailableIn>
<http://sws.geonames.org/2328926/>.
?course a <http://purl.org/vocab/aiiso/schema#Module>
}
Open University courses available in Nigeria
(http://sws.geonames.org/2328926/)on http://data.open.ac.uk/query
14. Example
select distinct ?q (count(distinct ?t) as ?n) where {
?q a <http://purl.org/net/mlo/qualification>.
?q <http://data.open.ac.uk/saou/ontology#hasPathway> ?p.
?p <http://data.open.ac.uk/saou/ontology#hasStage> ?s.
{{?s
<http://data.open.ac.uk/saou/ontology#includesCompulsoryCourse> ?c}
union
{?s <http://data.open.ac.uk/saou/ontology#includesOptionalCourse>
?c}}.
?c <http://purl.org/dc/terms/subject> ?t.
[] <http://www.w3.org/2004/02/skos/core#hasTopConcept> ?t.
} group by ?q order by desc(?n)
How many top level subjects are represented in individual Open
University qualifications on http://data.open.ac.uk/query
15. Example
select ?broader ?term ?narrower
where {
graph npgg:subjects {
?subject skos:prefLabel ?term .
?subject skos:broader [ skos:prefLabel ?broader ] .
?_ skos:broader ?subject ; skos:prefLabel ?narrower .
}
filter(regex(?term, "^Stem cells$", "i"))
}
order by ?broader ?narrower
Broader and narrower terms for "Stem cells“ on
http://data.nature.com/query
16. Example
select ?doi ?data
where {
?doi a npg:Article ;
npg:hasDataCitation [
npg:hasLink [ ?_ ?data ] ; npg:type ?type ] .
filter(regex(?type, "pdb"))
}
limit 25
Data citations to the Protein Database on
http://data.nature.com/query
18. What we will during the hands-on session
• Access URIs to get data in different forms – understand
how the HTTP protocol is used to access data
• Inspect RDF representations of objects – follow links to
others
• Write SPARQL query to retrieve specific information
• Create new data with SPARQL update – think about how
to model the data with RDF