9. johannes keizerhttp://aims.fao.org
From AGRIS to DBPedia
AGRIS
URI
AGROV
OC URI
dcterms:subject
DBPedia
URI
skos:closeMatch
skos:exactMatch
DBPedia
Abstract
Wikipedia
URL
DBPedia
Picture
foaf:isPrimaryTopicOfdbpedia-owl:abstract
foaf:depiction
Entry
point!
AGROVOC
is the
backbone
10. johannes keizerhttp://aims.fao.org
SPARQL in action!
1. From an AGRIS URI, get the list of the AGROVOC URIs
(dcterms:subject)
PREFIX dct: <http://purl.org/dc/terms/>
SELECT ?agr
WHERE {
<AGRIS_Uri> dct:subject ?agr .
}
2. For each AGROVOC URI
2.1. Get skos:closeMatch and skos:exactMatch (formal alignments to other
thesauri)
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT?em ?cm {
OPTIONAL { <AGROVOC_Uri> skos:exactMatch ?em } .
OPTIONAL { <AGROVOC_Uri> skos:closeMatch ?cm } .
}
11. johannes keizerhttp://aims.fao.org
Get DBPedia
2.2. The JAVA code filters DBPedia URIs, to avoid adding a new FILTER in
the SPARQL query (it’s heavy…)
2.3. For each DBPedia URI, query the DBPedia SPARQL endpoint to get
information to display in an AGRIS widget
SELECT ?abs ?img ?wiki
WHERE {
OPTIONAL {<DBP_Uri> dbpedia-owl:abstract ?abs} .
OPTIONAL {<DBP_Uri> foaf:depiction ?img} .
OPTIONAL {<DBP_Uri> foaf:isPrimaryTopicOf ?wiki} .
FILTER ( (lang(?abs ) ="en") || (!bound(?abs)) )
}
13. johannes keizerhttp://aims.fao.org
The RING machine interface – SPARQL
An RDF store is a way of storing data using a
machine-readable "grammar" (the Resource
Description Framework) and documented semantics
(RDF vocabularies).
URIs
The URI for each service / dataset is built as follows:
[RING-domain]/node/[service-ID].
For example: http://ring.ciard.net/node/2417
The RING database is an publicly
accessible RDF store of datasets.
SPARQL endpoint
http://ring.ciard.net/sparql1
14. johannes keizerhttp://aims.fao.org
SPARQL how to: vocabularies used in the RING
The vocabularies used in the RDF store are:
RDF: http://www.w3.org/1999/02/22-rdf-syntax-ns#
RDFS: http://www.w3.org/2000/01/rdf-schema#
DC: http://purl.org/dc/terms/
DCAT: http://www.w3.org/ns/dcat#
ADMS: http://www.w3.org/ns/adms#
FOAF: http://xmlns.com/foaf/0.1/
DOAP: http://usefulinc.com/ns/doap#
SKOS: http://www.w3.org/2004/02/skos/core#
VCARD: http://www.w3.org/2006/vcard/ns#
The data model chosen to describe datasets is the
W3C Data Catalog Vocabulary (DCAT)
designed to describe datasets
and the forms in which they are exposed, their "distributions"
15. johannes keizerhttp://aims.fao.org
SPARQL how to: URIs?
All the URIs that you may need in queries are listed on
the RING web site
A list of the URIs of all the RING
entities (services/datasets, organizations, KOSs etc.):
http://ring.ciard.net/entity-uris
A list of the URIs of all RING concepts (countries,
topics, regions, protocols etc.):
http://ring.ciard.net/concept-uris
16. johannes keizerhttp://aims.fao.org
Sample query using AGROVOC
To get all datasets on topic "Livestock" using the
AGROVOC URI for "Livestock"
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX
rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc:
<http://purl.org/dc/terms/> PREFIX dcat:
<http://www.w3.org/ns/dcat#> PREFIX adms:
<http://www.w3.org/ns/adms#> PREFIX doap:
<http://usefulinc.com/ns/doap#> PREFIX owl:
<http://www.w3.org/2002/07/owl#> PREFIX skos:
<http://www.w3.org/2004/02/skos/core#> DESCRIBE ?dataset ?distro
?owner ?contact ?topic ?standard ?format ?protocol WHERE { ?dataset
rdf:type dcat:Dataset . ?dataset dc:title ?title . ?dataset
dcat:distribution ?distro . ?dataset dc:publisher ?owner . ?distro
dcat:accessURL ?url . ?dataset dcat:theme ?topic . ?topic
owl:sameAs <http://aims.fao.org/aos/agrovoc/c_4397> . OPTIONAL {
?dataset doap:maintainer ?contact } OPTIONAL { ?distro
dc:conformsTo ?standard } OPTIONAL { ?distro dc:format ?format }
OPTIONAL { ?distro adms:representationTechnique ?protocol } }
URI of the “Livestock”
concept in AGROVOC
17. johannes keizerhttp://aims.fao.org
Example of use: AGRIS RING
1. How AGRIS uses the RING Linked Data
AGRIS (http://agris.fao.org): database of more than 7 million
bibliographic references on agricultural research and technology
and links to related data resources on the Web.
AGRIS retrieves information on AGRIS centers through a
SPARQL query run against the RING.
<http://ring.ciard.net/node/10687> is the uRI of the AGRIS
network in the RING
------------------------------
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dc: <http://purl.org/dc/terms/>
PREFIX dcat: <http://www.w3.org/ns/dcat#> DESCRIBE ?dataset WHERE { ?dataset rdf:type
dcat:Dataset . ?dataset dc:partOf <http://ring.ciard.net/node/10687> }
------------------------------
18. johannes keizerhttp://aims.fao.org
Example of use: AGRIS RING
2. How to get AGRIS Linked Data bibliographic records for each AGRIS
center
In the AGRIS RDF store, all bibliographic records are
associated to the corresponding AGRIS center through the
dcterms:source property: the URI used to identify the
AGRIS center is the RING URI.
Any application can therefore retrieve all records belonging
to an AGRIS center by running a query against the AGRIS
SPARQL endpoint
(http://202.45.139.84:10035/catalogs/fao/repositories/agris)
.
------------------------------------
PREFIX dcterms: <http://purl.org/terms> DESCRIBE ?rec WHERE { ?rec dcterms:source <http://ring.ciard.net/node/2754> . }
-----------------------------------