{"id":111,"date":"2012-10-16T21:24:14","date_gmt":"2012-10-16T21:24:14","guid":{"rendered":"http:\/\/www.w3.org\/community\/openannotation\/?page_id=111"},"modified":"2013-01-14T16:41:41","modified_gmt":"2013-01-14T16:41:41","slug":"fragment-uris","status":"publish","type":"page","link":"https:\/\/www.w3.org\/community\/openannotation\/fragment-uris\/","title":{"rendered":"Fragment URIs versus Specific Resources"},"content":{"rendered":"<p>Two options, listed below, for annotating parts of resources were considered for the Open Annotation Data Model.  We decided on the more expressive but more verbose second option for a variety of reasons, that this page explains in more detail than in the specification.<\/p>\n<p><b>Option (1) Fragment URI as target<\/b><\/p>\n<hr>\n<pre>\r\n_:anno a oa:Annotation ;\r\n&nbsp;&nbsp;oa:hasTarget &lt;http:\/\/www.example.com\/example.ogv#t=10,20&gt;  ;\r\n&nbsp;&nbsp;oa:hasBody &lt;http:\/\/www.example.org\/comment1&gt; .\r\n<\/pre>\n<hr>\n<p><b>Option (2) Identity as target, description as a Selector<\/b><\/p>\n<hr>\n<pre>\r\n_:anno a oa:Annotation ;\r\n&nbsp;&nbsp;oa:hasTarget &lt;SpecificTarget1&gt; ;\r\n&nbsp;&nbsp;oa:hasBody &lt;http:\/\/www.example.org\/comment1&gt; .\r\n\r\n&lt;SpecificTarget1&gt; a oa:SpecificResource ;\r\n&nbsp;&nbsp;oa:hasSelector &lt;FragmentSelector1&gt; ;\r\n&nbsp;&nbsp;oa:hasSource &lt;http:\/\/www.example.com\/example.ogv&gt; .\r\n\r\n&lt;FragmentSelector1&gt; a oa:FragmentSelector ;\r\n&nbsp;&nbsp;rdf:value \"t=10,20\" .\r\n<\/pre>\n<hr>\n<p>To decompress the reasoning in the <a href=\"http:\/\/www.openannotation.org\/spec\/core\/#SelectorFragment\" target=\"_blank\" rel=\"nofollow\">specification<\/a>:<\/p>\n<ul>\n<li>\nYou can&#8217;t search for http:\/\/www.example.com\/example.ogv directly in<br \/>\nthe first model.  Remember that URIs are opaque, non-decomposable strings.  Regardless of whether that<br \/>\nstring may include human readable semantics or not, you can&#8217;t discover<br \/>\nannotations of form (1) with regular SPARQL constructions and you can discover them in form (2) by<br \/>\nquerying the object of oa:hasSource.  It is possible to discover them using regular expressions in SPARQL. <\/p>\n<li> While Style specifiers as a resource are going away, form (1) is not compatible<br \/>\nwith States.  If you need to refer to example.ogv at a particular<br \/>\npoint in time then you need a State which cannot be attached to the<br \/>\nFragment URI, as that would break the global scope of statements in<br \/>\nRDF.  In other words, you would be saying that for all uses of that<br \/>\ntime range within the video, it was always based on the video resource<br \/>\nas it was at a particular point in time (say at 2011-05-20), which<br \/>\nwould prevent other annotations from having a different point in time<br \/>\nfor that same time segment within the video.<\/p>\n<li> URIs provide identity. A URI with a fragment provides both identity<br \/>\nfor the segment, but also a description of how to resolve that segment<br \/>\ngiven a (particular) representation of the resource. This has several<br \/>\nissues:<\/p>\n<ul>\n<li>There may be many ways to describe the same segment, used by<br \/>\ndifferent communities.<\/p>\n<li>IETF Fragment specifications are tied to a specific mimetype.<br \/>\nPlain text fragments work only for text\/plain<br \/>\nresources, and no other, for example. Thus the identity of the segment is tied to a specific representation in a specific format<\/p>\n<li>As Jeni Tennison points out, the same fragment can identify<br \/>\ndifferent things within the same resource.  She gives the example of<br \/>\nan SVG document with embedded RDF in <a href=\"http:\/\/www.w3.org\/TR\/2012\/WD-fragid-best-practices-20120726\/\">Appendix B<\/a>.<br \/>\nSo we consider it safer to create a new node in the graph to provide<br \/>\nidentity, and a separate node to provide the description.  This<br \/>\nsafety, expressiveness and consistency comes at the expense of some<br \/>\nextra bytes, but that&#8217;s RDF for you.\n<\/ul>\n<li> Fragment URIs are not expressive enough to cover the use cases that<br \/>\ndrive the Open Annotation specification.  Non rectangular sections of<br \/>\nimages are very important to be able to identify and describe,<br \/>\nincluding simple circles as well as arbitrary paths.  The worst case<br \/>\nis annotating a diagonal road in a map from top left to bottom right<br \/>\nof the image, where a rectangular box would encompass the whole<br \/>\nimage&#8217;s content. Thus we need some other way to implement this, which<br \/>\nresults in form (2)<\/p>\n<li> Fragment URIs do not cover all media types, nor could they possibly<br \/>\nhope to.  If you wanted to annotate a selection of text within a MS<br \/>\nWord document, you would need Microsoft to register a fragment<br \/>\ndescription for .doc and .docx.  Given that this is a useful sort of<br \/>\nthing to do, and it can&#8217;t be done with fragment URIs, we need a<br \/>\nselector concept as in form (2)<\/p>\n<li> Media Fragments are not extensible by third parties in the current specification.<br \/>\nAs soon as anyone needed something slightly richer or more<br \/>\nexpressive &#8230; like a circular area rather than rectangular &#8230; then<br \/>\nwe would be back in the situation where we needed a selector again.\n<\/ul>\n<p>Thus, there is a need for a Selector that describes the segment of a<br \/>\nresource separately from its identity.  Given that this is required,<br \/>\nwe felt it most consistent to always use a Selector, but to import the<br \/>\nfragment description semantics into it.  This solves all of the issues<br \/>\nabove at the expense of being somewhat more verbose.<\/p>\n<ul>\n<li>You can always query oa:hasSource to find the URI of the target<br \/>\nresource, without any segment information<\/p>\n<li>You, or a third party, can always attach a State to give the time<br \/>\nfor the representation.  The failure to consider the dynamic nature of<br \/>\nweb resources has been the downfall of many annotation systems in the<br \/>\npast, and we fully intend to learn from their mistakes.<\/p>\n<li> Multiple descriptions are possible, and can work across mime types.<br \/>\n There is no confusion about what the Specific Resource identifies as<br \/>\nit does not also try to describe it.<\/p>\n<li> We can be as expressive as we like using a Selector, and remain<br \/>\nconsistent with a single model<\/p>\n<li> We can have selectors for new and old media types, without the<br \/>\nblessing of the IANA\/IETF registries<\/p>\n<li> Selectors are infinitely extensible\n<li> There is a single model, not two possibilities that everyone would<br \/>\nneed to implement both of or risk splitting their user base<\/p>\n<li> We import the semantics of the fragment definitions, so are not<br \/>\nre-inventing those.  We simply split the fragment away from the URI of<br \/>\nthe full resource to gain the benefits above.<\/p>\n<li> And finally we tried both ways and the consensus of the group was<br \/>\nthat the single selector model was the better approach\n<\/ul>\n<p>After all of that, if you&#8217;re still not convinced, then it&#8217;s only a recommendation to use this approach. If you feel that<br \/>\nsome additional bytes in an already extremely verbose format is too<br \/>\nhigh a cost for interoperability, expressiveness, consistency and the<br \/>\nunderstandability of your annotations, then it is not forbidden to<br \/>\nannotate a fragment URI directly. We hope, of course, that you&#8217;re<br \/>\nconvinced otherwise by the arguments above \ud83d\ude42<\/p>\n<p>(This page is taken from: <a href=\"http:\/\/lists.w3.org\/Archives\/Public\/public-openannotation\/2012Oct\/0008.html\" target=\"_blank\" rel=\"nofollow\">http:\/\/lists.w3.org\/Archives\/Public\/public-openannotation\/2012Oct\/0008.html<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two options, listed below, for annotating parts of resources were considered for the Open Annotation Data Model. We decided on the more expressive but more verbose second option for a variety of reasons, that this page explains in more detail &hellip; <a href=\"https:\/\/www.w3.org\/community\/openannotation\/fragment-uris\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":962,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_s2mail":"yes","footnotes":""},"class_list":["post-111","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/pages\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/users\/962"}],"replies":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":11,"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/pages\/111\/revisions"}],"predecessor-version":[{"id":123,"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/pages\/111\/revisions\/123"}],"wp:attachment":[{"href":"https:\/\/www.w3.org\/community\/openannotation\/wp-json\/wp\/v2\/media?parent=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}