The Web Annotation Vocabulary specifies the set of RDF classes, predicates and named entities that are used by the Web Annotation Data Model [[!annotation-model]]. It also lists recommended terms from other ontologies that are used in the model, and provides the JSON-LD Context and profile definitions needed to use the Web Annotation JSON serialization in a Linked Data context.

By publishing this Recommendation, W3C expects that the functionality specified in this Recommendation will not be affected by changes to the Activity Streams 2.0 [[!activitystreams-core]] and Activity Vocabulary [[!activitystreams-vocabulary]] as those specifications proceed to Recommendation.

Introduction

The specification is divided into two major sections: the terms defined in the Web Annotation ontology, and terms from other ontologies used in the model.

Each class lists the recommendations from the model for the REQUIRED, RECOMMENDED and OPTIONAL object and data properties for instances of the class. Instances may, of course, be the subject of any other triples that implementers find useful, however there is no expectation of interoperability in these cases.

Namespaces

PrefixNamespaceDescription
oahttp://www.w3.org/ns/oa# The Web Annotation Data Model
ashttp://www.w3.org/ns/activitystreams#[[!activitystreams-vocabulary]]
dchttp://purl.org/dc/elements/1.1/[[!DC11]]
dctermshttp://purl.org/dc/terms/[[!DC-TERMS]]
dctypeshttp://purl.org/dc/dcmitype/[[!DC-TERMS]]
foafhttp://xmlns.com/foaf/0.1/[[!FOAF]]
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#[[!rdf-schema]]
rdfshttp://www.w3.org/2000/01/rdf-schema#[[!rdf-schema]]
schemahttp://schema.org/schema.org
skoshttp://www.w3.org/2004/02/skos/core#[[!skos-reference]]
xsdhttp://www.w3.org/2001/XMLSchema#[[!xmlschema-2]]

Diagrams and Examples

The examples throughout the document are serialized as [[!Turtle]] with the prefixes taken from the namespace declarations given in Appendix A. The examples are informative only.

The diagrams use the following style

Terminology

IRI
An IRI, or Internationalized Resource Identifier, is an extension to the URI specification to allow characters from Unicode, whereas URIs must be made up of a subset of ASCII characters. There is a mapping algorithm for translating between IRIs and the equivalent encoded URI form. IRIs are defined by [[!rfc3987]].
Resource
An item of interest that MAY be identified by an IRI.
RDF [[rdf-concepts]] is fully internationalized and permits the use of IRIs for identifying resources. This specification uses the term IRI to make it clear that this is the case.

Web Annotation Ontology

The namespace used for the Web Annotation Ontology is: http://www.w3.org/ns/oa#

Classes

Annotation

The class for Web Annotations.

oa:Annotation with properties
<http://example.org/anno1> a oa:Annotation ;
    oa:hasBody <http://example.org/post1> ;
    oa:hasTarget <http://example.com/page1> ;
    oa:motivatedBy oa:commenting ;
    dcterms:creator <http://example.org/person1> ;
    dcterms:created "2015-11-18T12:00:00Z" .

Choice

A subClass of as:OrderedCollection that conveys to a consuming application that it should select one of the resources in the as:items list to use, rather than all of them. This is typically used to provide a choice of resources to render to the user, based on further supplied properties. If the consuming application cannot determine the user's preference, then it should use the first in the list.

oa:Choice with list of items
<http://example.org/anno2> a oa:Annotation ;
    oa:hasTarget <http://example.org/site1> ;
    oa:hasBody [
        a oa:Choice ;
        as:items (<http://example.org/note1> <http://example.org/note2>) ] .

<http://example.org/note1> dc:language "en" .
<http://example.org/note2> dc:language "fr" .

CssSelector

A CssSelector describes a Segment of interest in a representation that conforms to the Document Object Model through the use of the CSS selector specification.

oa:CssSelector
<http://example.org/anno3> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
            a oa:CssSelector ;
            rdf:value "#elemid > .elemclass + p" ] ] .

CssStyle

A resource which describes styles for resources participating in the Annotation using CSS.

  • IRI: http://www.w3.org/ns/oa#CssStyle
  • Sub Class Of: oa:Style
oa:CssStyle
<http://example.org/anno4> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:styledBy <http://example.org/style1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/document1> ;
        oa:styleClass "red" ] .

<http://example.org/style1> a oa:CssStyle .

DataPositionSelector

DataPositionSelector describes a range of data by recording the start and end positions of the selection in the stream. Position 0 would be immediately before the first byte, position 1 would be immediately before the second byte, and so on. The start byte is thus included in the list, but the end byte is not.

oa:DataPositionSelector
<http://example.org/anno5> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/diskimg1> ;
        oa:hasSelector [
            a oa:DataPositionSelector ;
            oa:start 4096 ;
            oa:end 4104 ] ] .

Direction

A class to encapsulate the different text directions that a textual resource might take. It is not used directly in the Annotation Model, only its three instances.

  • IRI: http://www.w3.org/ns/oa#Direction
oa:Direction
<http://example.org/anno6> a oa:Annotation ;
    oa:hasBody [
        rdf:value "This is a comment" ;
        dc:language "en" ;
        dc:format "text/plain" ;
        oa:textDirection oa:ltr ] ;
    oa:hasTarget <http://example.org/page1> .

FragmentSelector

The FragmentSelector class is used to record the segment of a representation using the IRI fragment specification defined by the representation's media type.

oa:FragmentSelector
<http://example.org/anno7> a oa:Annotation ;
    oa:hasBody <http://example.org/image1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/video1> ;
        oa:hasSelector [
            a oa:FragmentSelector ;
            dcterms:conformsTo <http://www.w3.org/TR/media-frags/> ;
            rdf:value "t=30,60" ] ] .

HttpRequestState

The HttpRequestState class is used to record the HTTP request headers that a client SHOULD use to request the correct representation from the resource.

oa:HttpRequestState
<http://example.org/anno8> a oa:Annotation ;
    oa:hasBody <http://example.org/description1> ;
    oa:hasTarget  [
        oa:hasSource <http://example.org/target1> ;
        oa:hasState [
            a oa:HttpRequestState ;
            rdf:value "Accept: application/pdf" ] ] .

Motivation

The Motivation class is used to record the user's intent or motivation for the creation of the Annotation, or the inclusion of the body or target, that it is associated with.

oa:Motivation
<http://example.org/anno9> a oa:Annotation ;
    oa:hasBody <http://example.org/description1> ;
    oa:hasTarget <http://example.com/resource1> ;
    oa:motivatedBy oa:describing .

RangeSelector

A Range Selector can be used to identify the beginning and the end of the selection by using other Selectors. The selection consists of everything from the beginning of the starting selector through to the beginning of the ending selector, but not including it.

oa:RangeSelector
<http://example.org/anno10> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
          a oa:RangeSelector ;
          oa:hasStartSelector [
            a oa:XPathSelector ;
            rdf:value "//table[1]/tr[1]/td[2]" ] ;
          oa:hasEndSelector [
            a oa:XPathSelector ;
            rdf:value "//table[1]/tr[1]/td[4]" ] ] ] .

ResourceSelection

Instances of the ResourceSelection class identify part (described by an oa:Selector) of another resource (referenced with oa:hasSource), possibly from a particular representation of a resource (described by an oa:State). Please note that ResourceSelection is not used directly in the Web Annotation model, but is provided as a separate class for further application profiles to use, separate from oa:SpecificResource which has many Annotation specific features.

No example is given. The class should not be used in the Web Annotation model directly.

Selector

A resource which describes the segment of interest in a representation of a Source resource, indicated with oa:hasSelector from the Specific Resource. This class is not used directly in the Annotation model, only its subclasses.

No example is given. The class should only be used to derive subClasses.

SpecificResource

Instances of the SpecificResource class identify part of another resource (referenced with oa:hasSource), a particular representation of a resource, a resource with styling hints for renders, or any combination of these, as used within an Annotation.

oa:SpecificResource
<http://example.org/anno11> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget <http://example.org/region1> .

<http://example.org/region1> a oa:SpecificResource ;
    oa:hasSource <http://example.org/image1> .

State

A State describes the intended state of a resource as applied to the particular Annotation, and thus provides the information needed to retrieve the correct representation of that resource.

No example is given. The class should only be used in further ontologies to derive subclasses.

Style

A Style describes the intended styling of a resource as applied to the particular Annotation, and thus provides the information to ensure that rendering is consistent across implementations.

No example is given. The class should only be used in further ontologies to derive subclasses.

SvgSelector

An SvgSelector defines an area through the use of the Scalable Vector Graphics [SVG] standard. This allows the user to select a non-rectangular area of the content, such as a circle or polygon by describing the region using SVG. The SVG may be either embedded within the Annotation or referenced as an External Resource.

oa:SvgSelector
<http://example.org/anno12> a oa:Annotation ;
    oa:hasBody <http://example.org/road1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/map1> ;
        oa:hasSelector [
            a oa:SvgSelector ;
            rdf:value "<svg:svg> ... </svg:svg>" ] ] .

TextPositionSelector

The TextPositionSelector describes a range of text by recording the start and end positions of the selection in the stream. Position 0 would be immediately before the first character, position 1 would be immediately before the second character, and so on.

oa:TextPositionSelector
<http://example.org/anno13> a oa:Annotation ;
    oa:hasBody <http://example.org/review1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/ebook1> ;
        oa:hasSelector [
            a oa:TextPositionSelector ;
            oa:start 412 ;
            oa:end 795 ] ] .

TextQuoteSelector

The TextQuoteSelector describes a range of text by copying it, and including some of the text immediately before (a prefix) and after (a suffix) it to distinguish between multiple copies of the same sequence of characters.

oa:TextQuoteSelector
<http://example.org/anno14> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
            a oa:TextQuoteSelector ;
            oa:exact "anotation" ;
            oa:prefix "this is an " ;
            oa:suffix " that has some" ] ] .

TextualBody

oa:TextualBody
<http://example.org/anno15> a oa:Annotation ;
    oa:hasTarget <http://example.org/photo1> ;
    oa:hasBody [
        a oa:TextualBody;
        rdf:value "<p>Comment text</p>" ;
        dc:language "en" ;
        dc:format "text/html" ] .

TimeState

A TimeState records the time at which the resource's state is appropriate for the Annotation, typically the time that the Annotation was created and/or a link to a persistent copy of the current version.

oa:TimeState
<http://example.org/anno16> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasState [
            a oa:TimeState ;
            oa:cachedSource <http://example.org/copy1> ;
            oa:sourceDate "2015-07-20T13:30:00Z" ] ] .

XPathSelector

An XPathSelector is used to select elements and content within a resource that supports the Document Object Model via a specified XPath value.

oa:XPathSelector
<http://example.org/anno17> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
          a oa:XPathSelector ;
          rdf:value "/html/body/p[2]/table/tr[2]/td[3]/span" ] ] .

Properties

annotationService

The object of the relationship is the end point of a service that conforms to the [[!annotation-protocol]], and it may be associated with any resource. The expectation of asserting the relationship is that the object is the preferred service for maintaining annotations about the subject resource, according to the publisher of the relationship.

This relationship is intended to be used both within Linked Data descriptions and as the rel type of a Link, via HTTP Link Headers [[!rfc5988]] for binary resources and in HTML <link> elements. For more information about these, please see the Annotation Protocol specification [[!annotation-protocol]].

  • IRI: http://www.w3.org/ns/oa#annotationService
<http://example.org/diagram.jpg> a dctypes:Image ;
    oa:annotationService <http://example.org/services/annotations/> .

bodyValue

The object of the predicate is a plain text string to be used as the content of the body of the Annotation. The value MUST be an xsd:string and that data type MUST NOT be expressed in the serialization. Note that language MUST NOT be associated with the value either as a language tag, as that is only available for rdf:langString.

  • IRI: http://www.w3.org/ns/oa#bodyValue
  • Domain: oa:Annotation
  • Range: xsd:string
oa:bodyValue
<http://example.org/anno18> a oa:Annotation ;
    oa:bodyValue "Comment text" ;
    oa:hasTarget <http://example.org/target1> .

cachedSource

A object of the relationship is a copy of the Source resource's representation, appropriate for the Annotation.

  • IRI: http://www.w3.org/ns/oa#cachedSource
  • Domain: oa:TimeState
oa:cachedSource
<http://example.org/anno19> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasState [
            a oa:TimeState ;
            oa:cachedSource <http://example.org/copy1> ;
            oa:sourceDate "2015-07-20T13:30:00Z" ] ] .

canonical

A object of the relationship is the canonical IRI that can always be used to deduplicate the Annotation, regardless of the current IRI used to access the representation.

  • IRI: http://www.w3.org/ns/oa#canonical
oa:canonical
<http://example.org/anno20> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget <http://example.org/page1> ;
    oa:canonical <urn:uuid:dbfb1861-0ecf-41ad-be94-a584e5c4f1df> .

end

The end property is used to convey the 0-based index of the end position of a range of content.

  • IRI: http://www.w3.org/ns/oa#end
  • Range: xsd:nonNegativeInteger
oa:end
<http://example.org/anno21> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/diskimg1> ;
        oa:hasSelector [
            a oa:DataPositionSelector ;
            oa:start 4096 ;
            oa:end 4104 ] ] .

exact

The object of the predicate is a copy of the text which is being selected, after normalization.

  • IRI: http://www.w3.org/ns/oa#exact
  • Range: xsd:string
oa:exact
<http://example.org/anno22> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
            a oa:TextQuoteSelector ;
            oa:exact "anotation" ;
            oa:prefix "this is an " ;
            oa:suffix " that has some" ] ] .

hasBody

The object of the relationship is a resource that is a body of the Annotation.

oa:hasBody
<http://example.org/anno23> a oa:Annotation ;
    oa:hasBody <http://example.org/post1> ;
    oa:hasTarget <http://example.com/page1> .

hasEndSelector

The relationship between a RangeSelector and the Selector that describes the end position of the range.

oa:hasEndSelector
<http://example.org/anno24> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
          a oa:RangeSelector ;
          oa:hasStartSelector [
            a oa:XPathSelector ;
            rdf:value "//table[1]/tr[1]/td[2]" ] ;
          oa:hasEndSelector [
            a oa:XPathSelector ;
            rdf:value "//table[1]/tr[1]/td[4]" ] ] ] .

hasPurpose

The purpose served by the resource in the Annotation.

oa:hasPurpose
<http://example.org/anno25> a oa:Annotation ;
    oa:motivatedBy oa:bookmarking ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "readme" ;
        oa:hasPurpose oa:tagging ] ;
    oa:hasTarget <http://example.org/page1> .

hasScope

The scope or context in which the resource is used within the Annotation.

oa:hasScope
<http://example.org/anno26> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/logo1.jpg> ;
        oa:hasScope <http://example.org/index.html> ] .

hasSelector

The object of the relationship is a Selector that describes the segment or region of interest within the source resource. Please note that the domain (oa:ResourceSelection) is not used directly in the Web Annotation model.

oa:hasSelector
<http://example.org/anno27> a oa:Annotation ;
    oa:hasBody [
      oa:hasSource <http://example.org/page1> ;
      oa:hasSelector <http://example.org/paraselector1> ] ;
    oa:hasTarget [
      oa:hasSource <http://example.com/dataset1> ;
      oa:hasSelector <http://example.org/dataselector1> ] .

hasSource

The resource that the ResourceSelection, or its subclass SpecificResource, is refined from, or more specific than. Please note that the domain (oa:ResourceSelection) is not used directly in the Web Annotation model.

oa:hasSource
<http://example.org/anno28> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget <http://example.org/region1> .

<http://example.org/region1> a oa:SpecificResource ;
    oa:hasSource <http://example.org/image1> .

hasStartSelector

The relationship between a RangeSelector and the Selector that describes the start position of the range.

oa:hasStartSelector
<http://example.org/anno29> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
          a oa:RangeSelector ;
          oa:hasStartSelector [
            a oa:XPathSelector ;
            rdf:value "//table[1]/tr[1]/td[2]" ] ;
          oa:hasEndSelector [
            a oa:XPathSelector ;
            rdf:value "//table[1]/tr[1]/td[4]" ] ] ] .

hasState

The relationship between the ResourceSelection, or its subclass SpecificResource, and a State resource. Please note that the domain (oa:ResourceSelection) is not used directly in the Web Annotation model.

oa:hasState
<http://example.org/anno30> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasState <http://example.org/state1> ;
        oa:hasSource <http://example.org/page1> ] .

hasTarget

The relationship between an Annotation and its Target.

oa:hasTarget
<http://example.org/anno31> a oa:Annotation ;
    oa:hasBody <http://example.org/post1> ;
    oa:hasTarget <http://example.com/page1> .

motivatedBy

The relationship between an Annotation and a Motivation that describes the reason for the Annotation's creation.

oa:motivatedBy
<http://example.org/anno32> a oa:Annotation ;
    oa:hasBody <http://example.org/description1> ;
    oa:hasTarget <http://example.com/resource1> ;
    oa:motivatedBy oa:describing .

prefix

The object of the property is a snippet of content that occurs immediately before the content which is being selected by the Selector.

  • IRI: http://www.w3.org/ns/oa#prefix
  • Range: xsd:string
oa:prefix
<http://example.org/anno33> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
            a oa:TextQuoteSelector ;
            oa:exact "anotation" ;
            oa:prefix "this is an " ;
            oa:suffix " that has some" ] ] .

processingLanguage

The object of the property is the language that should be used for textual processing algorithms when dealing with the content of the resource, including hyphenation, line breaking, which font to use for rendering and so forth. The value must follow the recommendations of [[!BCP47]].

  • IRI: http://www.w3.org/ns/oa#processingLanguage
  • Sub Property Of: dc:language
  • Range: xsd:string
oa:processingLanguage
<http://example.org/anno34> a oa:Annotation ;
    oa:hasBody [
      a oa:TextualBody ;
      rdf:value "<p>פעילו×Ŗ הבינאום, W3C</p>" ;
      dc:format "text/html" ;
      dc:language "en", "he" ;
      oa:processingLanguage "he" ] ;
    oa:hasTarget <http://example.org/page1> .

refinedBy

The relationship between a Selector and another Selector or a State and a Selector or State that should be applied to the results of the first to refine the processing of the source resource.

  • IRI: http://www.w3.org/ns/oa#refinedBy
oa:refinedBy
  <http://example.org/anno35> a oa:Annotation ;
      oa:hasBody <http://example.org/comment1> ;
      oa:hasTarget [
          a oa:SpecificResource ;
          oa:hasSource <http://example.org/page1> ;
          oa:hasSelector [
            a oa:FragmentSelector ;
            rdf:value "para5" ;
            oa:refinedBy [
              a oa:TextQuoteSelector ;
              oa:exact "selected text" ;
              oa:prefix "text before the " ;
              oa:suffix "and text after it" ] ] ] .

renderedVia

A system that was used by the application that created the Annotation to render the resource.

oa:renderedVia
<http://example.org/anno36> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget [
      a oa:SpecificResource ;
      oa:hasSource <http://example.org/page1> ;
      oa:renderedVia [
        a as:Application ;
        schema:softwareVersion "2.5" ] ] .

sourceDate

The timestamp at which the Source resource should be interpreted as being applicable to the Annotation.

  • IRI: http://www.w3.org/ns/oa#sourceDate
  • Domain: oa:TimeState
  • Range: xsd:dateTime
oa:sourceDate
<http://example.org/anno37> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasState [
            a oa:TimeState ;
            oa:sourceDate "2015-07-20T13:30:00Z" ] ] .

sourceDateEnd

The end timestamp of the interval over which the Source resource should be interpreted as being applicable to the Annotation.

  • IRI: http://www.w3.org/ns/oa#sourceDate
  • Domain: oa:TimeState
  • Range: xsd:dateTime
oa:sourceDateEnd
<http://example.org/anno38> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasState [
            a oa:TimeState ;
            oa:sourceDateStart "2015-07-20T13:30:00Z" ;
            oa:sourceDateEnd   "2015-07-21T19:45:00Z" ] ] .

sourceDateStart

The start timestamp of the interval over which the Source resource should be interpreted as being applicable to the Annotation.

  • IRI: http://www.w3.org/ns/oa#sourceDate
  • Domain: oa:TimeState
  • Range: xsd:dateTime
oa:sourceDateStart
<http://example.org/anno39> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasState [
            a oa:TimeState ;
            oa:sourceDateStart "2015-07-20T13:30:00Z" ;
            oa:sourceDateEnd   "2015-07-21T19:45:00Z" ] ] .

start

The start position in a 0-based index at which a range of content is selected from the data in the source resource.

  • IRI: http://www.w3.org/ns/oa#start
  • Range: xsd:nonNegativeInteger
oa:start
<http://example.org/anno40> a oa:Annotation ;
    oa:hasBody <http://example.org/review1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/ebook1> ;
        oa:hasSelector [
            a oa:TextPositionSelector ;
            oa:start 412 ;
            oa:end 795 ] ] .

styleClass

The name of the class used in the CSS description referenced from the Annotation that should be applied to the Specific Resource.

oa:styleClass
<http://example.org/anno41> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:styledBy <http://example.org/style1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/document1> ;
        oa:styleClass "red" ] .

<http://example.org/style1> a oa:CssStyle .

styledBy

A reference to a Stylesheet that should be used to apply styles to the Annotation rendering.

oa:styledBy
<http://example.org/anno42> a oa:Annotation ;
    oa:hasBody <http://example.org/body1> ;
    oa:styledBy [
        a oa:CssStyle ;
        rdf:value ".red { color: red }" ] ;
    oa:hasTarget [
        oa:hasSource <http://example.org/target1> ;
        oa:styleClass "red" ] .

suffix

The snippet of text that occurs immediately after the text which is being selected.

  • IRI: http://www.w3.org/ns/oa#suffix
  • Range: xsd:string
oa:suffix
<http://example.org/anno43> a oa:Annotation ;
    oa:hasBody <http://example.org/comment1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/page1> ;
        oa:hasSelector [
            a oa:TextQuoteSelector ;
            oa:exact "anotation" ;
            oa:prefix "this is an " ;
            oa:suffix " that has some" ] ] .

textDirection

The direction of the text of the subject resource. There MUST only be one text direction associated with any given resource.

  • IRI: http://www.w3.org/ns/oa#textDirection
  • Range: oa:Direction
oa:textDirection
<http://example.org/anno44> a oa:Annotation ;
    oa:hasBody [
        rdf:value "This is a comment" ;
        dc:language "en" ;
        dc:format "text/plain" ;
        oa:textDirection oa:ltr ] ;
    oa:hasTarget <http://example.org/page1> .

via

A object of the relationship is a resource from which the source resource was retrieved by the providing system.

  • IRI: http://www.w3.org/ns/oa#via
oa:via
<http://example.org/anno45> a oa:Annotation ;
    oa:hasBody <http://example.org/note1> ;
    oa:hasTarget <http://example.org/page1> ;
    oa:via <http://other.example.com/anno1b> .

Named Individuals

assessing

The motivation for when the user intends to provide an assessment about the Target resource.

  • IRI: http://www.w3.org/ns/oa#assessing
  • Instance Of: oa:Motivation
oa:assessing
<http://example.org/anno46> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "Very high quality" ] ;
    oa:hasTarget <http://example.com/resource1> ;
    oa:motivatedBy oa:assessing .

bookmarking

The motivation for when the user intends to create a bookmark to the Target or part thereof.

  • IRI: http://www.w3.org/ns/oa#bookmarking
  • Instance Of: oa:Motivation
oa:bookmarking
<http://example.org/anno47> a oa:Annotation ;
    oa:hasTarget <http://example.com/page1> ;
    oa:motivatedBy oa:bookmarking .

classifying

The motivation for when the user intends to that classify the Target as something.

  • IRI: http://www.w3.org/ns/oa#classifying
  • Instance Of: oa:Motivation
oa:classifying
<http://example.org/anno48> a oa:Annotation ;
    oa:hasBody <http://example.org/type1> ;
    oa:hasTarget <http://example.com/resource1> ;
    oa:motivatedBy oa:classifying .

commenting

The motivation for when the user intends to comment about the Target.

  • IRI: http://www.w3.org/ns/oa#commenting
  • Instance Of: oa:Motivation
oa:commenting
<http://example.org/anno49> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "A comment about the page" ] ;
    oa:hasTarget <http://example.com/page1> ;
    oa:motivatedBy oa:commenting .

describing

The motivation for when the user intends to describe the Target, as opposed to a comment about them.

  • IRI: http://www.w3.org/ns/oa#describing
  • Instance Of: oa:Motivation
oa:describing
<http://example.org/anno50> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "A description of the image" ] ;
    oa:hasTarget <http://example.com/image1> ;
    oa:motivatedBy oa:describing .

editing

The motivation for when the user intends to request a change or edit to the Target resource.

  • IRI: http://www.w3.org/ns/oa#editing
  • Instance Of: oa:Motivation
oa:editing
<http://example.org/anno51> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "Editorial suggestion" ] ;
    oa:hasTarget <http://example.com/text1> ;
    oa:motivatedBy oa:editing .

highlighting

The motivation for when the user intends to highlight the Target resource or segment of it.

  • IRI: http://www.w3.org/ns/oa#highlighting
  • Instance Of: oa:Motivation
oa:highlighting
<http://example.org/anno52> a oa:Annotation ;
    oa:hasTarget <http://example.com/region1> ;
    oa:motivatedBy oa:highlighting .

identifying

The motivation for when the user intends to assign an identity to the Target or identify what is being depicted or described in the Target.

  • IRI: http://www.w3.org/ns/oa#identifying
  • Instance Of: oa:Motivation
oa:identifying
<http://example.org/anno53> a oa:Annotation ;
    oa:hasBody <http://example.com/identities/object1> ;
    oa:hasTarget <http://example.com/image-of-object1> ;
    oa:motivatedBy oa:identifying .

linking

The motivation for when the user intends to link to a resource related to the Target.

  • IRI: http://www.w3.org/ns/oa#linking
  • Instance Of: oa:Motivation
oa:linking
<http://example.org/anno54> a oa:Annotation ;
    oa:hasBody <http://example.org/from1> ;
    oa:hasTarget <http://example.com/to1> ;
    oa:motivatedBy oa:linking .

moderating

The motivation for when the user intends to assign some value or quality to the Target.

  • IRI: http://www.w3.org/ns/oa#moderating
  • Instance Of: oa:Motivation
oa:moderating
<http://example.org/anno55> a oa:Annotation ;
    oa:hasBody <http://example.org/tags/approved1> ;
    oa:hasTarget <http://example.com/anno1> ;
    oa:motivatedBy oa:moderating .

questioning

The motivation for when the user intends to ask a question about the Target.

  • IRI: http://www.w3.org/ns/oa#questioning
  • Instance Of: oa:Motivation
oa:questioning
<http://example.org/anno56> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "A question about the resource" ] ;
    oa:hasTarget <http://example.com/resource1> ;
    oa:motivatedBy oa:questioning .

replying

The motivation for when the user intends to reply to a previous statement, either an Annotation or another resource.

  • IRI: http://www.w3.org/ns/oa#replying
  • Instance Of: oa:Motivation
oa:replying
<http://example.org/anno57> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "A reply to a question" ] ;
    oa:hasTarget <http://example.com/anno1> ;
    oa:motivatedBy oa:replying .

tagging

The motivation for when the user intends to associate a tag with the Target.

  • IRI: http://www.w3.org/ns/oa#tagging
  • Instance Of: oa:Motivation
oa:tagging
<http://example.org/anno58> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "tag" ] ;
    oa:hasTarget <http://example.com/thing1> ;
    oa:motivatedBy oa:tagging .

autoDirection

The direction of text that should be automatically determined from the content.

  • IRI: http://www.w3.org/ns/oa#autoDirection
  • Instance Of: oa:Direction
oa:autoDirection
<http://example.org/anno59> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "Some text" ;
        oa:textDirection oa:autoDirection ] ;
    oa:hasTarget <http://example.com/thing1>  .

ltrDirection

The direction of text that is read from left to right.

  • IRI: http://www.w3.org/ns/oa#ltrDirection
  • Instance Of: oa:Direction
oa:ltrDirection
<http://example.org/anno60> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "Left to Right text" ;
        oa:textDirection oa:ltrDirection ] ;
    oa:hasTarget <http://example.com/thing1>  .

rtlDirection

The direction of text that is read from right to left.

  • IRI: http://www.w3.org/ns/oa#rtlDirection
  • Instance Of: oa:Direction
oa:rtlDirection
<http://example.org/anno61> a oa:Annotation ;
    oa:hasBody <http://example.org/ar/comment1> ;
    oa:hasTarget <http://example.com/thing1>  .

<http://example.org/ar/comment1> a dctypes:Text ;
    oa:textDirection oa:rtlDirection .

PreferContainedDescriptions

An IRI to signal the client prefers to receive full descriptions of the Annotations from a container, not just their IRIs.

  • IRI: http://www.w3.org/ns/oa#PreferContainedDescriptions
  • Instance Of: rdfs:Resource
GET /annotations/ HTTP/1.1
Host: example.org
Accept: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
Prefer: return=representation;include="http://www.w3.org/ns/ldp#PreferContainedDescriptions"

PreferContainedIRIs

An IRI to signal that the client prefers to receive only the IRIs of the Annotations from a container, not their full descriptions.

  • IRI: http://www.w3.org/ns/oa#PreferContainedIRIs
  • Instance Of: rdfs:Resource
GET /annotations/ HTTP/1.1
Host: example.org
Accept: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
Prefer: return=representation;include="http://www.w3.org/ns/ldp#PreferContainedIRIs"

Recommended Ontologies

Classes

as:Application

as:Application
<http://example.org/anno62> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/restaurant1> ;
    as:generator <http://example.org/client1> .

<http://example.org/client1> a as:Application ;
    foaf:homepage <http://example.com/homepage1> ;
    foaf:name "Code v2.1" .

as:OrderedCollection

as:OrderedCollection
<http://example.org/collection1> a as:OrderedCollection ;
  rdfs:label "Example Collection" ;
  as:totalItems 42023 ;
  as:first <http://example.org/collection1/page1> ;
  as:last <http://example.org/collection1/page42> .

as:OrderedCollectionPage

as:OrderedCollectionPage
<http://example.org/collection1/page1> a as:OrderedCollectionPage ;
  as:partOf <http://example.org/collection1> ;
  as:next <http://example.org/collection1/page2> ;
  as:startIndex 0 ;
  as:items (
    <http://example.org/anno1>
    <http://example.org/anno2>
    <http://example.org/anno3> ) .

dctypes:Dataset

dctypes:Dataset
<http://example.org/anno63> a oa:Annotation ;
    oa:motivatedBy oa:commenting ;
    oa:hasBody <http://example.com/note1> ;
    oa:hasTarget <http://example.com/dataset1> .

<http://example.com/dataset1> a dctypes:Dataset ;
  dc:format "text/csv" .

dctypes:MovingImage

dctypes:MovingImage
<http://example.org/anno64> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "tag" ] ;
    oa:hasTarget <http://example.com/video1> ;
    oa:motivatedBy oa:tagging .

<http://example.org/video1> a dctypes:MovingImage .

dctypes:StillImage

dctypes:StillImage
<http://example.org/anno65> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "tag" ] ;
    oa:hasTarget <http://example.com/image1> ;
    oa:motivatedBy oa:tagging .

<http://example.org/image1> a dctypes:StillImage .

dctypes:Sound

dctypes:Sound
<http://example.org/anno66> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "tag" ] ;
    oa:hasTarget <http://example.com/audio1> ;
    oa:motivatedBy oa:tagging .

<http://example.org/audio1> a dctypes:Sound .

dctypes:Text

dctypes:Text
<http://example.org/anno67> a oa:Annotation ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "tag" ] ;
    oa:hasTarget <http://example.com/document1> ;
    oa:motivatedBy oa:tagging .

<http://example.org/document1> a dctypes:Text .

foaf:Organization

foaf:Organization
<http://example.org/anno68> a oa:Annotation ;
    oa:hasBody <http://example.net/comment1> ;
    oa:hasTarget <http://example.com/restaurant1> ;
    dcterms:creator <http://example.org/org1> .

<http://example.org/org1> a foaf:Organization ;
    foaf:name "Example Organization" .

foaf:Person

foaf:Person
<http://example.org/anno69> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/book1> ;
    dcterms:creator <http://example.org/user1> .

<http://example.org/user1> a foaf:Person ;
    foaf:nick "pseudo" ;
    foaf:name "My Pseudonym" .

schema:Audience

schema:Audience
<http://example.org/anno70> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/book1> ;
    schema:audience <http://example.net/roles/musician> .

<http://example.net/roles/musician> a schema:Audience ;
    schema:audienceType "musician" .

Properties

as:first

as:first
<http://example.org/collection1> a as:OrderedCollection ;
  rdfs:label "Example Collection" ;
  as:totalItems 42023 ;
  as:first <http://example.org/collection1/page1> ;
  as:last <http://example.org/collection1/page42> .

as:generator

as:generator
<http://example.org/anno71> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/restaurant1> ;
    as:generator <http://example.org/client1> .

<http://example.org/client1> a as:Application ;
    foaf:homepage <http://example.com/homepage1> ;
    foaf:name "Code v2.1" .

as:items

as:items
<http://example.org/collection1/page1> a as:OrderedCollectionPage ;
  as:partOf <http://example.org/collection1> ;
  as:next <http://example.org/collection1/page2> ;
  as:startIndex 0 ;
  as:items (
    <http://example.org/anno1>
    <http://example.org/anno2>
    # ...
    <http://example.org/anno1000> ) .

as:last

as:last
<http://example.org/collection1> a as:OrderedCollection ;
  rdfs:label "Example Collection" ;
  as:totalItems 42023 ;
  as:first <http://example.org/collection1/page1> ;
  as:last <http://example.org/collection1/page42> .

as:next

as:next
<http://example.org/collection1/page1> a as:OrderedCollectionPage ;
  as:partOf <http://example.org/collection1> ;
  as:next <http://example.org/collection1/page2> ;
  as:startIndex 0 ;
  as:items (
    <http://example.org/anno1>
    <http://example.org/anno2>
    # ...
    <http://example.org/anno1000> ) .

as:partOf

as:partOf
<http://example.org/collection1/page1> a as:OrderedCollectionPage ;
  as:partOf <http://example.org/collection1> ;
  as:next <http://example.org/collection1/page2> ;
  as:startIndex 0 ;
  as:items (
    <http://example.org/anno1>
    <http://example.org/anno2>
    # ...
    <http://example.org/anno1000> ) .

as:prev

as:prev
<http://example.org/collection1/page2> a as:OrderedCollectionPage ;
  as:partOf <http://example.org/collection1> ;
  as:prev <http://example.org/collection1/page1> ;
  as:next <http://example.org/collection1/page3> ;
  as:startIndex 1000 ;
  as:items (
    <http://example.org/anno1001>
    <http://example.org/anno1002>
    # ...
    <http://example.org/anno2000> ) .

as:startIndex

as:startIndex
<http://example.org/collection1/page2> a as:OrderedCollectionPage ;
  as:partOf <http://example.org/collection1> ;
  as:prev <http://example.org/collection1/page1> ;
  as:next <http://example.org/collection1/page3> ;
  as:startIndex 1000 ;
  as:items (
    <http://example.org/anno1001>
    <http://example.org/anno1002>
    # ...
    <http://example.org/anno2000> ) .

as:totalItems

as:totalItems
<http://example.org/collection1> a as:OrderedCollection ;
  rdfs:label "Example Collection" ;
  as:totalItems 42023 ;
  as:first <http://example.org/collection1/page1> ;
  as:last <http://example.org/collection1/page42> .

dc:format

dc:format
<http://example.org/anno72> a oa:Annotation ;
    oa:hasTarget <http://example.org/photo1> ;
    oa:hasBody [
        a oa:TextualBody;
        rdf:value "<p>Comment text</p>" ;
        dc:language "en" ;
        dc:format "text/html" ] .

dc:language

The dc:language predicate recommends the use of a controlled vocabulary. The use of dc:language in the Annotation model further specifies that the vocabulary to use is [[!BCP47]].

dc:language
<http://example.org/anno73> a oa:Annotation ;
    oa:hasTarget <http://example.org/photo1> ;
    oa:hasBody [
        a oa:TextualBody;
        rdf:value "<p>Comment text</p>" ;
        dc:language "en" ;
        dc:format "text/html" ] .

dcterms:conformsTo

dcterms:conformsTo
<http://example.org/anno74> a oa:Annotation ;
    oa:hasBody <http://example.org/image1> ;
    oa:hasTarget [
        oa:hasSource <http://example.org/video1> ;
        oa:hasSelector [
            a oa:FragmentSelector ;
            dcterms:conformsTo <http://www.w3.org/TR/media-frags/> ;
            rdf:value "t=30,60" ] ] .

dcterms:created

dcterms:created
<http://example.org/anno75> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/restaurant1> ;
    dcterms:created "2015-10-13T13:00:00Z" .

dcterms:creator

dcterms:creator
<http://example.org/anno76> a oa:Annotation ;
    oa:hasBody <http://example.net/post1> ;
    oa:hasTarget <http://example.com/page1> ;
    dcterms:creator <http://example.org/person1> .

dcterms:issued

dcterms:issued
<http://example.org/anno77> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/restaurant1> ;
    dcterms:issued "2015-10-14T15:13:28Z" ;
    as:generator <http://example.org/client1> .

<http://example.org/client1> a as:Application .

dcterms:modified

dcterms:modified
<http://example.org/anno78> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/restaurant1> ;
    dcterms:created "2015-10-13T13:00:00Z" ;
    dcterms:modified "2015-11-29T10:00:00Z" .

dcterms:rights

dcterms:rights
<http://example.org/anno79> a oa:Annotation ;
  dcterms:rights <https://creativecommons.org/publicdomain/zero/1.0/> ;
  oa:hasBody <http://example.net/review1> ;
  oa:hasTarget <http://example.com/product1> .

<http://example.net/review1> a dctypes:Text ;
  dcterms:rights <http://creativecommons.org/licenses/by-nc/4.0/> .

foaf:homepage

foaf:homepage
<http://example.org/anno80> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/restaurant1> ;
    as:generator <http://example.org/client1> .

<http://example.org/client1> a as:Application ;
    foaf:homepage <HomePage1> ;
    foaf:name "Code v2.1" .

foaf:mbox

foaf:mbox
<http://example.org/anno81> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/book1> ;
    dcterms:creator <http://example.org/user1> .

<http://example.org/user1> a foaf:Person ;
    foaf:mbox <mailto:user1@example.org> .

foaf:mbox_sha1sum

foaf:mbox_sha1sum
<http://example.org/anno82> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/book1> ;
    dcterms:creator <http://example.org/user1> .

<http://example.org/user1> a foaf:Person ;
    foaf:mbox_sha1sum "7d97e98f8af710c7e7fe703abc8f639e0ee507c4" .

foaf:name

foaf:name
<http://example.org/anno83> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/book1> ;
    dcterms:creator <http://example.org/user1> .

<http://example.org/user1> a foaf:Person ;
    foaf:nick "pseudo" ;
    foaf:name "My Pseudonym" .

foaf:nick

foaf:nick
<http://example.org/anno84> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/book1> ;
    dcterms:creator <http://example.org/user1> .

<http://example.org/user1> a foaf:Person ;
    foaf:nick "pseudo" ;
    foaf:name "My Pseudonym" .

rdf:type

rdf:type
<http://example.org/anno85> a oa:Annotation ;
    oa:hasBody <http://example.org/post1> ;
    oa:hasTarget <http://example.com/page1> ;
    oa:motivatedBy oa:commenting ;
    dcterms:creator <http://example.org/person1> ;
    dcterms:created "2015-11-18T12:00:00Z" .

rdf:value

rdf:value
<http://example.org/anno86> a oa:Annotation ;
    oa:hasTarget <http://example.org/photo1> ;
    oa:hasBody [
        a oa:TextualBody;
        rdf:value "<p>Comment text</p>" ;
        dc:language "en" ;
        dc:format "text/html" ] .

rdfs:label

rdfs:label
<http://example.org/collection1> a as:OrderedCollection ;
  rdfs:label "Example Collection" ;
  as:totalItems 42023 ;
  as:first <http://example.org/collection1/page1> ;
  as:last <http://example.org/collection1/page42> .

schema:accessibilityFeature

schema:accessibilityFeature
<http://example.org/anno87> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/video1> .

<http://example.com/video1> a dctypes:MovingImage ;
    schema:accessibilityFeature "captions" .

schema:audience

schema:audience
<http://example.org/anno88> a oa:Annotation ;
    oa:hasBody <http://example.net/review1> ;
    oa:hasTarget <http://example.com/book1> ;
    schema:audience <http://example.net/roles/musician> .

<http://example.net/roles/musician> a schema:Audience ;
    schema:audienceType "musician" .

Extensions

This vocabulary may be extended in the regular way, by creating new or importing existing predicates and classes from other RDF based ontologies. Extensions may be made to any resource, including adding new objects as well as properties. If there is a property in one of the ontologies that are already included in the context, then it is RECOMMENDED to use a CURIE, the namespace and property name separated by a : character, as the JSON-LD key rather than creating a new context.

For example, it is easier to add skos:prefLabel to the Annotation rather than requiring clients to download a new context document to discover the mapping.

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "id": "http://example.org/anno89",
  "type": "Annotation",
  "skos:prefLabel": "Picture Annotation",
  "body": {
    "type": "TextualBody",
    "value": "I love this picture!"
  },
  "target": {
    "id": "http://example.com/images/picture1",
    "type": "Image"
  }
}
  

In order to ensure a lack of collision between key names, a JSON-LD context document SHOULD be made available when the term is not from an ontology that is already in the Web Annotation context. Extension contexts MUST NOT redefine existing JSON-LD keys from the Web Annotation context. Implementations MUST ignore unfamiliar properties when processing the data, but servers SHOULD preserve them if they are part of a valid and included context.

The context SHOULD be associated with the resource that most closely encapsulates the extension properties. This is to try to ensure that extensions which define the same key do not collide unexpectedly. If there is more than one context document for a particular resource, then they must be included in an array.

For example, adding height and width for the target image using the EXIF vocabulary [[exif]] could be done by defining a JSON-LD context, including the height and width properties, and linking to the newly defined context in the target resource.

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "id": "http://example.org/anno90",
  "type": "Annotation",
  "skos:prefLabel": "Picture Annotation",
  "body": {
    "type": "TextualBody",
    "value": "I love this picture!"
  },
  "target": {
    "@context": "http://example.org/images/ns/extension.jsonld",
    "id": "http://example.com/images/picture1",
    "type": "Image",
    "height": 768,
    "width": 1024
  }
}
  

Note that the current JSON-LD [[!JSON-LD]] specification does not allow arrays to contain other arrays directly. As JSON-LD is the RECOMMENDED serialization format, extensions SHOULD avoid the use of this pattern.

Finally, new classes can be defined to further extend the model for specific communities and use cases. New Selectors and States are particularly valuable for extension for new ways of defining representations, and for selecting segments of those representations.

For example, an annotation on a three dimensional model would require the addition of depth and the starting position on the z axis, along with x, y, width, and height. These might be kept together in a new ThreeDSelector resource.

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "id": "http://example.org/anno91",
  "type": "Annotation",
  "skos:prefLabel": "3d Annotation",
  "body": {
    "type": "TextualBody",
    "value": "I love this part of the model!"
  },
  "target": {
    "source": "http://example.org/models/robot.3d",
    "selector": {
      "@context": "http://example.org/3d/ns/extension.jsonld",
      "type": "ThreeDSelector",
      "x": 1035,
      "y": 245,
      "z": 782,
      "w": 120,
      "h": 180,
      "d": 90
    }
  }
}
  

JSON-LD Context

The RECOMMENDED serialization format is [[!JSON-LD]]. The JSON-LD context presented below is RECOMMENDED to ensure consistency between implementations, and SHOULD be referenced as http://www.w3.org/ns/anno.jsonld. The same IRI SHOULD be used as the profile IRI for representations that conform to the model and context.

{
 "@context": {
    "oa":      "http://www.w3.org/ns/oa#",
    "dc":      "http://purl.org/dc/elements/1.1/",
    "dcterms": "http://purl.org/dc/terms/",
    "dctypes": "http://purl.org/dc/dcmitype/",
    "foaf":    "http://xmlns.com/foaf/0.1/",
    "rdf":     "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs":    "http://www.w3.org/2000/01/rdf-schema#",
    "skos":    "http://www.w3.org/2004/02/skos/core#",
    "xsd":     "http://www.w3.org/2001/XMLSchema#",
    "iana":    "http://www.iana.org/assignments/relation/",
    "owl":     "http://www.w3.org/2002/07/owl#",
    "as":      "http://www.w3.org/ns/activitystreams#",
    "schema":  "http://schema.org/",

    "id":      {"@type": "@id", "@id": "@id"},
    "type":    {"@type": "@id", "@id": "@type"},

    "Annotation":           "oa:Annotation",
    "Dataset":              "dctypes:Dataset",
    "Image":                "dctypes:StillImage",
    "Video":                "dctypes:MovingImage",
    "Audio":                "dctypes:Sound",
    "Text":                 "dctypes:Text",
    "TextualBody":          "oa:TextualBody",
    "ResourceSelection":    "oa:ResourceSelection",
    "SpecificResource":     "oa:SpecificResource",
    "FragmentSelector":     "oa:FragmentSelector",
    "CssSelector":          "oa:CssSelector",
    "XPathSelector":        "oa:XPathSelector",
    "TextQuoteSelector":    "oa:TextQuoteSelector",
    "TextPositionSelector": "oa:TextPositionSelector",
    "DataPositionSelector": "oa:DataPositionSelector",
    "SvgSelector":          "oa:SvgSelector",
    "RangeSelector":        "oa:RangeSelector",
    "TimeState":            "oa:TimeState",
    "HttpRequestState":     "oa:HttpRequestState",
    "CssStylesheet":        "oa:CssStyle",
    "Choice":               "oa:Choice",
    "Person":               "foaf:Person",
    "Software":             "as:Application",
    "Organization":         "foaf:Organization",
    "AnnotationCollection": "as:OrderedCollection",
    "AnnotationPage":       "as:OrderedCollectionPage",
    "Audience":             "schema:Audience", 

    "Motivation":    "oa:Motivation",
    "bookmarking":   "oa:bookmarking",
    "classifying":   "oa:classifying",
    "commenting":    "oa:commenting",
    "describing":    "oa:describing",
    "editing":       "oa:editing",
    "highlighting":  "oa:highlighting",
    "identifying":   "oa:identifying",
    "linking":       "oa:linking",
    "moderating":    "oa:moderating",
    "questioning":   "oa:questioning",
    "replying":      "oa:replying",
    "reviewing":     "oa:reviewing",
    "tagging":       "oa:tagging",

    "auto":          "oa:autoDirection",
    "ltr":           "oa:ltrDirection",
    "rtl":           "oa:rtlDirection",

    "body":          {"@type": "@id", "@id": "oa:hasBody"},
    "target":        {"@type": "@id", "@id": "oa:hasTarget"},
    "source":        {"@type": "@id", "@id": "oa:hasSource"},
    "selector":      {"@type": "@id", "@id": "oa:hasSelector"},
    "state":         {"@type": "@id", "@id": "oa:hasState"},
    "scope":         {"@type": "@id", "@id": "oa:hasScope"},
    "refinedBy":     {"@type": "@id", "@id": "oa:refinedBy"},
    "startSelector": {"@type": "@id", "@id": "oa:hasStartSelector"},
    "endSelector":   {"@type": "@id", "@id": "oa:hasEndSelector"},
    "renderedVia":   {"@type": "@id", "@id": "oa:renderedVia"},
    "creator":       {"@type": "@id", "@id": "dcterms:creator"},
    "generator":     {"@type": "@id", "@id": "as:generator"},
    "rights":        {"@type": "@id", "@id": "dcterms:rights"},
    "homepage":      {"@type": "@id", "@id": "foaf:homepage"},
    "via":           {"@type": "@id", "@id": "oa:via"},
    "canonical":     {"@type": "@id", "@id": "oa:canonical"},
    "stylesheet":    {"@type": "@id", "@id": "oa:styledBy"},
    "cached":        {"@type": "@id", "@id": "oa:cachedSource"},
    "conformsTo":    {"@type": "@id", "@id": "dcterms:conformsTo"},
    "items":         {"@type": "@id", "@id": "as:items", "@container": "@list"},
    "partOf":        {"@type": "@id", "@id": "as:partOf"},
    "first":         {"@type": "@id", "@id": "as:first"},
    "last":          {"@type": "@id", "@id": "as:last"},
    "next":          {"@type": "@id", "@id": "as:next"},
    "prev":          {"@type": "@id", "@id": "as:prev"},
    "audience":      {"@type": "@id", "@id": "schema:audience"},
    "motivation":    {"@type": "@vocab", "@id": "oa:motivatedBy"},
    "purpose":       {"@type": "@vocab", "@id": "oa:hasPurpose"},
    "textDirection": {"@type": "@vocab", "@id": "oa:textDirection"},

    "accessibility": "schema:accessibilityFeature",
    "bodyValue":     "oa:bodyValue",
    "format":        "dc:format",
    "language":      "dc:language",
    "processingLanguage": "oa:processingLanguage",
    "value":         "rdf:value",
    "exact":         "oa:exact",
    "prefix":        "oa:prefix",
    "suffix":        "oa:suffix",
    "styleClass":    "oa:styleClass",
    "name":          "foaf:name",
    "email":         "foaf:mbox",
    "email_sha1":    "foaf:mbox_sha1sum",
    "nickname":      "foaf:nick",
    "label":         "rdfs:label",

    "created":       {"@id": "dcterms:created", "@type": "xsd:dateTime"},
    "modified":      {"@id": "dcterms:modified", "@type": "xsd:dateTime"},
    "generated":     {"@id": "dcterms:issued", "@type": "xsd:dateTime"},
    "sourceDate":    {"@id": "oa:sourceDate", "@type": "xsd:dateTime"},
    "sourceDateStart": {"@id": "oa:sourceDateStart", "@type": "xsd:dateTime"},
    "sourceDateEnd": {"@id": "oa:sourceDateEnd", "@type": "xsd:dateTime"},

    "start":         {"@id": "oa:start", "@type": "xsd:nonNegativeInteger"},
    "end":           {"@id": "oa:end", "@type": "xsd:nonNegativeInteger"},
    "total":         {"@id": "as:totalItems", "@type": "xsd:nonNegativeInteger"},
    "startIndex":    {"@id": "as:startIndex", "@type": "xsd:nonNegativeInteger"}
  }
}

JSON-LD Frames

There is an unofficial, yet well implemented, JSON-LD specification [[json-ld-framing]] that describes a deterministic layout for serializing an RDF graph into a particular JSON-LD document layout. Applying the following frames to the graph of information will generate JSON as close as possible to the serialization recommended by the Web Annotation Data Model.

Annotation Frame

A Frame for serializing a single Annotation.

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "@omitDefault": true,
  "type": "Annotation",
  "via": {"@embed": false},
  "canonical": {"@embed": false},
  "rights": {"@embed": false},
  "motivation": {"@embed": false},
  "body": {"@embed": true},
  "target": {"@embed": true},
  "creator": {"@embed": true},
  "generator": {"@embed": true},
  "audience": {"@embed": true}
}

Annotation Collection Frame

A Frame for serializing a Collection of Annotations.

{
    "@context" : [
    	"http://www.w3.org/ns/anno.jsonld",
    	"http://www.w3.org/ns/ldp.jsonld"
  	],
    "type": "Collection",
    "first": [{"@embed": "False"}],
    "last": [{"@embed": "False"}]
}

If it is instead desirable to embed the first page of the Collection, change the false for first to true.

Annotation Page Frame

A Frame for serializing a Page from a Collection of Annotations.

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "@omitDefault": true,
  "type": "AnnotationPage",
  "next": {"@embed": false},
  "prev": {"@embed": false},
  "partOf": {"@embed": false},
  "items": {"@embed": true}
}

Extending Motivations

Although the list of Motivations in the specification is derived from an extensive survey of the annotation landscape, there are many situations where more precise definitions are required or desirable. In these cases it is RECOMMENDED to create a new Motivation resource and relate it to one or more that already exist.

New Motivations MUST be instances of oa:Motivation, which is a subClass of skos:Concept. The skos:broader relationship SHOULD be asserted between the new Motivation and at least one existing Motivation, if there are any that are broader in scope. Other relationships, such as skos:relatedMatch, skos:exactMatch and skos:closeMatch, SHOULD also be asserted to concepts created by other communities.

Model

Use of SKOS to extend motivations
Extending Motivations

Proposed Definitions

The following classes were proposed for the ontology, but did not have the necessary implementations and were consequently removed.

Composite

A subClass of as:OrderedCollection that conveys to a consuming application that it should use all of the resources in the as:items list, but that order is not important.

oa:Composite with list of items
<http://example.org/anno92> a oa:Annotation ;
    oa:motivatedBy oa:commenting ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "These pages together provide evidence of the conspiracy" ] ;
    oa:hasTarget [
        a oa:Composite ;
        as:items ( <http://example.org/page1> <http://example.org/page6> <http://example.org/page4> ) ] .

Independents

A subClass of as:OrderedCollection that conveys to a consuming application that each of the resources in the as:items list are independently associated with all of the other bodies or targets.

oa:Independents with list of items
<http://example.org/anno93> a oa:Annotation ;
    oa:motivatedBy oa:classifying ;
    oa:hasBody <http://example.org/vocab/art/portrait> ;
    oa:hasTarget [
        a oa:Independents ;
        as:items (
          <http://example.com/image1>
          <http://example.net/image2>
          <http://example.com/image4>
          <http://example.org/image9>
        ) ] .

List

A subClass of as:OrderedCollection that conveys to a consuming application that it should use each of the resources in the as:items list, and that their order is important.

oa:List with list of items
<http://example.org/anno94> a oa:Annotation ;
    oa:motivatedBy oa:tagging ;
    oa:hasBody [
        a oa:TextualBody ;
        rdf:value "important" ] ;
    oa:hasTarget [
        a oa:List ;
        as:items (
          <http://example.com/book/page1>
          <http://example.net/book/page2>
          <http://example.com/book/page3>
          <http://example.org/book/page4>
        ) ] .

Candidate Recommendation Exit Criteria

For this specification to be advanced to Proposed Recommendation, there must be at least two independent implementations that demonstrate the validity of the vocabulary. The vocabulary will be considered valid when the following conditions have been demonstrated:

The recommended pattern for extensions in JSON-LD of including the extension context document in the serialization of the resource that uses the extension predicates and/or classes is not able to be round-tripped, as JSON-LD does not maintain the alignment between context and resource once transformed into a graph. The order and exact naming of the JSON keys in the JSON-LD serialization resulting from a graph is not considered a feature of the Vocabulary, and thus not required for demonstrating its validity. The naming of the keys is instead a feature of the Annotation Model and verified by its exit criteria.

Changed from Previous Versions

Changes from the Proposed Recommendation of 2017-01-17

No significant changes.

Changes from the Candidate Recommendation of 2016-11-22

Changes from the Candidate Recommendation of 2016-09-06

Changes from the Candidate Recommendation of 2016-07-05

Changes from the Working Draft of 2016-03-31

Significant technical changes in this specification from the Working Draft Published of 2016-03-31 are:

Acknowledgments

The Web Annotation Working Group gratefully acknowledges the contributions of the Open Annotation Community Group. The output of the Community Group was fundamental to the current data model.

The following people have been instrumental in providing thoughts, feedback, reviews, content, criticism and input in the creation of this specification:

Vladimir Alexiev, Art Barstow, Tim Berners-Lee, Chris Birk, Dan Brickley, Sarven Capadisli, Paolo Ciccarese, Tim Cole, Ray Denenberg, TB Dinesh, Sergiu Gordea, Benjamin Goering, Amy Guy, Ivan Herman, Frederick Hirsch, Antoine Isaac, Jacob Jett, Takeshi Kanai, Gregg Kellogg, Andreas Kuckartz, Randall Leeds, Hugo Manguinhas, Shane McCarron, Ben De Meester, Luc Moreau, Addison Phillips, Davis Salisbury, Robert Sanderson, Felix Sasaki, Doug Schepers, Tzviya Siegman, Stian Soiland-Reyes, Manu Sporny, Nick Stenning, Jon Stroop, Lutz Suhrbier, Kyrce Swenson, Raphaƫl Troncy, Simeon Warner, Erik Wilde, Dan Whaley, Benjamin Young