|
Selectors
A Selector identifies a portion of a resource, and may work differently for different types of documents and content types. Also for a specific content type, multiple kind of selector can be defined to cover specific needs. The Selector instance for a specific Annotation instance is identified through the property ao:context. Every Selector is identified by a URI and we recommend the use of the same URI for identifying the same document fragment multiple times. As there is not current standard mechanism for defining every possible document fragment through URIs this has to be currently enforced at the application level.
Using XPointerThe aos:context property is sub-property of the Annotea property ann:context. Therefore, for those of you that want to use XPointer context definition it is still possible to do it directly - without using the Selectors - the way that Annotea was doing it: <ann:context>
http://serv1.example.com/some/page.html#xpointer(id("Main")/p[2])
</ann:context>the RDF of the annotation will look something like: <rdf:Description rdf:about="http://my.example.org/ann/29332">
<rdf:type rdf:resource="&aot;Qualifier"/>
<rdf:type rdf:resource="&ao;Annotation"/>
<rdf:type rdf:resource="&ann;Annotation"/>
<ann:context>http://serv1.example.com/some/page.html#xpointer(id("Main")/p[2])</ann:context>
<aof:annotatesDocument rdf:resource="http://tinyurl.com/ykjn87p"/>
<ao:hasTopic rdf:resource="http://purl.obolibrary.org/obo/PRO_000004615"/>
<pav:createdOn>2010-03-21</pav:createdOn>
<pav:createdBy rdf:resource="http://www.hcklab.org/foaf.rdf#me"/>
</rdf:Description> Using the pure XPointer approach is not always a good choice - when a document is changing, for instance going through revision, we may end up with orphan annotations or annotations pointing to wrong places. Also, we want to keep track of the Source Document or Document Provenance and we need to point to portion of documents that are not XML documents. For these reasons we introduced the Selector mechanism. Classes Of Selectors
Selector is a generic class that can be customized/sub-classed for the different kind of content types:
Examples
The text selector: <rdf:Description rdf:about="http://my.example.org/sel/10300">
<rdf:type rdf:resource="&ao;Selector"/>
<rdf:type rdf:resource="&aos;TextSelector"/>
<rdf:type rdf:resource="&aos;PrefixPostfixSelector"/>
<aos:exact>BACE1</aos:exact>
<aos:prefix>Cognitive and behavioral deficits related to</aos:prefix>
<aos:postfix>inhibition may be magnified in humans who</aos:postfix>
<aof:onDocument rdf:resource="http://tinyurl.com/ykjn87p"/>
<ao:onSourceDocument rdf:resource="http://my.example.org/sd/2332"/>
</rdf:Description>The source document: <rdf:Description rdf:about="http://my.example.org/sd/2332">
<rdf:type rdf:resource="&pav;SourceDocument"/>
<pav:retrievedFrom rdf:resource="http://tinyurl.com/ykjn87p"/>
<pav:sourceAccessedOn>2010-05-10</pav:sourceAccessedOn>
</rdf:Description>
The image selector: <rdf:Description rdf:about="http://my.example.org/sel/22300">
<rdf:type rdf:resource="&ao;Selector"/>
<rdf:type rdf:resource="&aos;ImageSelector"/>
<rdf:type rdf:resource="&aos;InitEndCornerSelector"/>
<aof:onDocument rdf:resource="http://tinyurl.com/35a6fnq"/>
<ao:onSourceDocument rdf:resource="http://my.example.org/sd/2339"/>
<aos:init>(280,30)</aos:init>
<aos:end>(380,120)</aos:end>
</rdf:Description>The source document: <rdf:Description rdf:about="http://my.example.org/sd/2339">
<rdf:type rdf:resource="&pav;SourceDocument"/>
<pav:retrievedFrom rdf:resource="http://tinyurl.com/35a6fnq"/>
<pav:sourceAccessedOn>2010-05-10</pav:sourceAccessedOn>
</rdf:Description> Define New SelectorsWe are not assuming we are able to provide every possible way to select any part of a any kind of document. Therefore, if the selector you have in mind is not yet existing, it is sufficient to define a new one sub-classing one of the existing Selector classes. --- | |||


