SE Multiple Semantic Tags an Image

From Open Annotation Community Group
Jump to: navigation, search

Multiple Semantic Tags an Image

A Tag is a label attached to someone or something for identification or other information. Typically tags are created attaching a free text label to a resource. With the emergence of the Linked Open Data method, semantic tagging or tagging through URIs is gaining popularity.

<< Back to the Cookbook

Example of Multiple Semantic Tags on Image

We here represent the semantic tagging of a Wikipedia image of the APP (Amyloid Precursor Protein) Protein with two entries - identified by URIs - from two different databases/ontologies.

Open Annotation Smantic Tags of Image Intro.png


Open Annotation Representation

The Target of the annotation is a Wikipedia image. The Bodies of the annotation consist to two entries identified by URIs. Such entries are classified as oa:SemanticTag, the motivation driving the creation of the annotation is oa:tagging.

The Annotation instance exhibits an oa:annotatedBy - the agent responsible for entering the information that is used to generate the Annotation - and a oa:serializedBy - the agent, likely software, generating the serialization of the Annotation's graph. Annotation and generation dates are also associated.

Open Annotation - Semantic Tags of Image - In OA format.png

In RDF format:

ex:anno a oa:Annotation ;
   oa:hasTarget <http://alturl.com/wxidq> ;
   oa:motivatedBy oa:tagging ;
   oa:hasBody  ex:semtag1;
   oa:hasBody ex:semtag2;
   oa:annotatedBy ex:person1 ;
   oa:annotatedAt "2012-02-12T15:02:14Z" ;
   oa:serializedBy ex:software1 ;
   oa:serializedAt "2012-02-12T15:02:14Z" .
 
ex:semtag1 a oa:SemanticTag ;
   foaf:page MGI:88059 .
 
MGI:88059 rdfs:label "amyloid beta (A4) precursor protein" .
 
ex:semtag2 a oa:SemanticTag ;
   foaf:page OMIM:104760 .
 
OMIM:104760 rdfs:label "AMYLOID BETA A4 PRECURSOR PROTEIN; APP" .
 
<http://alturl.com/wxidq> a dctypes:Image ;
   dc:format "image/jpeg" .
 
ex:person1 a foaf:Person ;
   foaf:mbox <mailto:john.doe@example.org> ;
   foaf:name "John Doe" .
 
ex:software1 a prov:SoftwareAgent, foaf:Agent ;
   foaf:name "ExAnnotator" .

Some SPARQL queries

Select all the annotations for the target http://alturl.com/wxidq

SELECT ?anno WHERE { 
   ?anno oa:hasTarget <http://alturl.com/wxidq> . 
}
=> ex:anno

or

SELECT ?anno WHERE { 
   ?anno rdf:type oa:Annotation .
   ?anno oa:hasTarget <http://alturl.com/wxidq> . 
}
=> ex:anno

Select all the annotations by ex:person1 for the target http://alturl.com/wxidq

SELECT ?anno WHERE { 
   ?anno oa:hasTarget <http://alturl.com/wxidq> . 
   ?anno oa:annotatedBy ex:person1 . 
}
=> ex:anno

Select all the annotations by ex:person1 that include semantic tags

SELECT ?anno WHERE { 
   ?anno oa:annotatedBy ex:person1 . 
   ?anno oa:hasBody ?tag .
   ?tag rdf:type oa:SemanticTag. 
}
=> ex:anno

Select all the semantic tags for the target http://alturl.com/wxidq

SELECT ?tag WHERE { 
   ?anno a oa:Annotation .
   ?anno oa:hasTarget <http://alturl.com/wxidq> . 
   ?anno oa:hasBody ?tag .
   ?tag rdf:type oa:SemanticTag .
}
=> ex:semTag1, ex:semTag2

Select all the associated pages to semantic tags for the target http://alturl.com/wxidq

SELECT ?page WHERE { 
   ?anno a oa:Annotation .
   ?anno oa:hasTarget <http://alturl.com/wxidq> . 
   ?anno oa:hasBody ?tag .
   ?tag rdf:type oa:SemanticTag .
   ?tag foaf:page ?page .
}
=> MGI:88059, OMIM:104760

Select all the annotation targets tagged with a semantic tag associated to a page OMIM:104760

SELECT ?target WHERE {  
   ?anno oa:hasTarget ?target .
   ?anno oa:hasBody ?tag .
   ?tag rdf:type oa:SemanticTag.
   ?tag foaf:page OMIM:104760 . 
}
=> <http://alturl.com/wxidq>

Select semantic tags used together with a page OMIM:104760

SELECT ?tag WHERE {  
   ?anno oa:hasBody ?tag .
   ?tag rdf:type oa:SemanticTag.
   ?tag foaf:page ?page .
   ?tag foaf:page OMIM:104760 . 
}
=> ex:semTag1, ex:semTag2


CREATOR: Paolo Ciccarese
LAST UPDATED: February 6, 2013

<< Back to the Cookbook