Annotation Data Model - bounswe/bounswe2018group7 GitHub Wiki

This page contains the customization of The W3C Web Annotation Data Model for HiStory.

General Structure of an Annotation

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "type": "Annotation",
  "id": ...
  "creator": ...
  "generated": ...
  "body": {
    "type": ...
    "id" (or "value"): ...
  }
  "target": {
    "source": ...
    "selector": ...
  }
}

Descriptions for JSON Keys

id

The identity of the Annotation, e.g."https://history-backend.com/api/v1/annotations/2"


creator

A String of URL that identifies the creator of the annotation, e.g. "http://example.org/user1"


generated

A String of time at which the annotation was generated.


body

On HiStory, each Annotation can have exactly one body. body can be text, image, video or sound.

Text Body

{
  "type": "TextualBody",
  "value": <A String, e.g. "This this my first Annotation!">
}

Image Body

{
  "type": "Image",
  "id": <A String of URL, e.g. "http://somesite.com/someimage.png">
}

Video Body

{
  "type": "Video",
  "id": <A String of URL, e.g. "http://somesite.com/somevideo.mp4">
}

Sound Body

{
  "type": "Sound",
  "id": <A String of URL, e.g. "http://somesite.com/somesound.mp3">
}

target

On HiStory, each Annotation can have exactly one target. Targets are of type Specific Resource. Selectors are supported.

{
  "source": <A String of URL, e.g. "http://history-backend.herokuapp.com/api/v1/memory_posts/5">,
  "selector": <one of the Target Selectors stated below, not required>
}

Target Selectors

On HiStory, only Text Quote Selector and Fragment Selector are supported for targets.

Text Quote Selector

{
  "type": "TextQuoteSelector",
  "exact": <A String of selected text, e.g. "Üsküdar">,
  "prefix": <A String of text that comes immediately before the words contained in 'exact', e.g. "I went to ">,
  "suffix": <A String of text that comes immediately after the words contained in 'exact', e.g. " with my friend">
}

Fragment Selector

Only fragments for Images are supported as stated on http://www.w3.org/TR/media-frags/.

{
  "type": "FragmentSelector",
  "conformsTo": "http://www.w3.org/TR/media-frags/",
  "value": "xywh=<number>,<number>,<number>,<number>"
}
⚠️ **GitHub.com Fallback** ⚠️