Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Sample Datastream Content

kstapelfeldt edited this page Jun 28, 2017 · 2 revisions

The following page will give you examples of the types of content created in datastreams by the annotation module. Two types of objects are created: Annotation Container objects, and Annotation objects. Annotation Container objects are associated with an object being annotated. Annotations are associated with the Annotation Container.

RDF in the Annotation Container

Annotation Containers adhering to the annotation container content model (WADMContainerCModel) is associated with the object being annotated through RDF relationships defined in the default RELS-EXT datastream. Here is an example of the RDF datastream for an annotation container, which is associated with a simple image object that is being annotated.

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:fedora="info:fedora/fedora-system:def/relations-            external#" xmlns:fedora-model="info:fedora/fedora-system:def/model#"     xmlns:islandora="http://islandora.ca/ontology/relsext#">
  <rdf:Description rdf:about="info:fedora/annotation:1">
    <fedora-model:hasModel rdf:resource="info:fedora/islandora:WADMContainerCModel"></fedora-model:hasModel>
    <fedora:isMemberOfCollection rdf:resource="info:fedora/islandora:WADMContainerCModel"></fedora:isMemberOfCollection>
    <fedora:isAnnotationContainerOf rdf:resource="info:fedora/doug-sundseth"></fedora:isAnnotationContainerOf>
</rdf:Description>
    </rdf:RDF>

JSON in the Annotation Container

JSON in the Annotation Container object (WADMContainer datastream) contains metadata about the container and information about the annotations associated with the container. Here is an example of the JSON datastream for an annotation container.

{
    "@context": [
        "http://www.w3.org/ns/anno.jsonld",
        "http://www.w3.org/ns/ldp.jsonld"
    ],
    "@id": "06ECD72C-26C3-4E97-8D3E-89A7E370832B",
    "@type": [
        "BasicContainer",
        "AnnotationCollection"
    ],
    "total": "0",
    "label": "annotationContainer for doug-sundseth",
    "first": {
        "id": "http://localhost:8000/woods/doug-sundseth/annotations/?page=0",
        "type": "AnnotationPage",
        "items": [
            "annotation:2",
            "annotation:3",
            "annotation:4",
            "annotation:5",
            "annotation:6"
        ]
    }
}

RDF in Annotations

Annotations adhering to the annotation content model (WADMCModel) are associated with the annotation container through RDF relationships defined in the default RELS-EXT datastream. Here is an example of the RDF datastream for an annotation.

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:fedora="info:fedora/fedora-system:def/relations-external#" xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:islandora="http://islandora.ca/ontology/relsext#">
  <rdf:Description rdf:about="info:fedora/annotation:4">
    <fedora-model:hasModel rdf:resource="info:fedora/islandora:WADMCModel"></fedora-model:hasModel>
    <fedora:isMemberOfCollection rdf:resource="info:fedora/islandora:WADMCModel"></fedora:isMemberOfCollection>
    <fedora:isMemberOfAnnotationContainer rdf:resource="info:fedora/annotation:1"></fedora:isMemberOfAnnotationContainer>
  </rdf:Description>
</rdf:RDF>

JSON in Annotations

JSON in Annotations (WADM datastream) contain metadata and the text content of the annotation. Here is an example of the JSON datastream for an annotation.

{
    "@context": [
        "http://www.w3.org/ns/anno.jsonld"
    ],
    "@id": "D94FF59F-BD53-41AC-BC51-BFE835D4EBCB",
    "@type": "Annotation",
    "body": {
        "src": "http://localhost:8000/islandora/object/islandora%3A32/datastream/MEDIUM_SIZE/view",
        "text": "3",
        "shapes": [
            {
                "type": "rect",
                "geometry": {
                    "x": "0.058",
                    "y": "0.156",
                    "width": "0.102",
                    "height": "0.052"
                }
            }
        ],
        "context": "http://localhost:8000/woods/doug-sundseth"
    },
    "target": "http://localhost:8000/woods/doug-sundseth",
    "pid": "New",
    "creator": "admin",
    "created": "2017-04-03 20:46:23"
}

XML in Annotations

In order to ensure that the content of annotations is properly indexed in Gsearch/Solr, an XML representation of the annotation JSON is created. Here is an example of the XML representation of the content in the JSON datastream.

`<?xml version="1.0" encoding="utf-8"?>`
`<annotation><title>Annotation for doug-sundseth</title><target>doug-sundseth</target><creator>admin</creator><textvalue>3</textvalue></annotation>`

Clone this wiki locally