Wednesday 23 March 2011

Pelagios Workshop SPARQL Demo & RDFa

Note: The following post is heavily based on notes by Mathieu D’Aquin and Sebastian Heath.

Prior to the workshop we have made a test SPARQL endpoint available for anyone who wants to test our approach and see what might be possible. The Demonstrator was built by Mathieu D’Aquin based on our weekly Skype meetings and discussion list (which you can follow at our Google Group). The endpoint is available at:
using the OWLIM triple store with a Sesame interface.

Test with DME data
We have loaded the store with test data from the OAC descriptions available at:

For example, is described with the following triples (see

<>     rdf:type       dfs:Resource           
<>     rdf:type       oac:Annotation           
<>     dc:title       "Algier"           
<>     j.1:created    "2011-03-17 15:14:17.899"
<>     j.1:modified   "2011-03-17 15:14:17.899"
<>     dc:creator     "guest"           
<>     oac:hasBody            <>
<>     oac:hasTarget  _:node341

_:node341            rdf:type            rdfs:Resource           
_:node341            rdf:type            oac:ConstrainedTarget
_:node341            oac:constrainedBy   _:node342           
_:node341            oac:constrains      ""           

<>   rdf:type   rdfs:Resource           
<>   rdf:type   oac:Body
<>   rdfs:label "Control Point for 'Algier' (36.752887, 3.042048)"

Example queries:
select distinct ?x where {
     ?x a oac:Annotation

gives the list of available annotations. (see{%3Fx%20a%20oac:Annotation}&limit=0&infer=true)

select distinct ?lab where {
    ?x a oac:Annotation.
    ?x oac:hasBody ?b.
    ?b rdfs:label ?lab.
    ?x oac:hasTarget ?t.
    ?t oac:constrains ""

gives the list of texts associated to the document

Added Pleiades links:
A simple association based on similarity was applied to detect when the annotation related to a place known to Pleiades. For each of such annotations (e.g., about “Corsica”, which is, triples similar to the following were added:

oac:hasBody <>
rdf:type wgs84_pos:SpatialThing

Small extension of the Ontology:
A new class was created called GeoAnnotation. Intuitively, this class represent the oac:Annnotation(s) that point to (oac:hasBody) geographical objects (wgs84_pos:SpatialThing).
It is therefore defined in abstract OWL syntax as 

class (GeoAnnotation partial oac:Annotation)
class (GeoAnnotation complete restriction(oac:hasBody someValuesFrom(wgs84_pos:SpatialThing))

In other words, GeoAnnotation is the class of annotations that have a body which is a SpatialThing. In triple form:

  rdf:type        owl:Class
<>  rdfs:subClassOf oac:Annotation
<>  owl:equivalentClass _:node417
_:node417            rdf:type                 owl:Restriction
_:node417            owl:onProperty           oac:hasBody
_:node417            owl:someValuesFrom       wgs84_pos:SpatialThing           

Based on this definition, the system is able to infer that the annotations that have been connected to Pleiades objects are GeoAnnotation. The query:

select distinct ?x where {
  ?x a <>
gives the corresponding results (see{%3Fx%20a%20%3C}&limit=100&infer=true )

The query:
select distinct ?d ?b ?l where {
  ?x a <>.
  ?x oac:hasBody ?b.
  ?x oac:hasTarget ?t.
  ?t oac:constrains ?d.
  ?b a wgs84_pos:SpatialThing.         
  ?b rdfs:label ?l
gives the list of relationships between documents and Pleiades places (see{%3Fx%20a%20%3C}%0A&limit=100&infer=true )

Test with Arachne Data

Using the following query:*:*&fq=kategorie:topographie&start=0&rows=10000&fl=+Pfad,+id,+kurzbeschreibung,+antikeRoemProvinzTopographie,+ort,+Genauigkeit+Ort_antik,+antikeGriechLandschaftTopographie,+Geonamesid&qt=standard&wt=json&explainOther=&hl.fl=

we can obtain a list of potential annotations from Arachne, with information about images relating to places, that can have modern and ancient names.

There are (apparently) a bit more than 5000 items in this list, running the same similarity-based process as above, we could relate a bit more than 2000 of them to Pleiades URIs.

They all appear, with the previous queries, as Annotations and GeoAnnotation. With this dataset, there are now many documents refering to the same place. We can for example obtain the list of documents referring to “” with the query:

select distinct ?x where {
     ?y oac:hasBody <> . 
     ?y oac:hasTarget ?x

The list of all the (geo)annotations relating to it can be retrieved through the query:

PREFIX oac:<>
select ?x where {
  ?x a <>.
  ?x oac:hasBody <>

Other possible extensions
There are different kinds of GeoAnnotation (and different types of documents considered). For example, some data would mention both documents about the location, and documents that cite the location, but are about something else. Maps of particular locations might have a specific status, as well. We could add sub-properties of oac:hasTarget for example or subclasses of GeoAnnotation.

Using html link element to indicate presence of Pelagios ingestible RDF

In addition Mathieu’s work, Sebastian Heath has been considering implmentations in RDFa. It is common to use the html element ‘link’ within an html ‘head’ to indicate the location of alternate versions of web resource. The most common application of this convention is to indicate the presence of Atom or RSS feeds.

E.g. <link rel="alternate" type="application/atom+xml" title="Atom feed" href="<URI Here>" />

Resource authors/publishers can use the following convention to indicate the location of RDF-serialized Pelagios-compatible oac:Annotations.

 <link rel=”x-pelagios-oac-serialization” title=”Pelagios compatible version” type=”<mime-type>” href=”<URI>”/>

  • The @rel MUST be equal to "x-pelagios-oac-serialization".
  • The @type SHOULD match the mime type of the resource pointed to by @href.
  • The @type SHOULD be one of:
  • The value of the title attribute is not significant. Authors MUST NOT use it to communicate any information to the Pelagios crawler.

No comments:

Post a Comment