Skip to content

final report sketch

Emre SİN edited this page Dec 29, 2023 · 1 revision

Status:

  • Image annotation is implemented on the mobile only.
  • Text annotation is implemented on both mobile and web.

Compliance with W3C WADM:

  • The parts that we have implemented are fully complies with the W3C standarts.
  • Our implementation has subset of the futures that are described in W3C Annotation Data Model. This subset of futures are tailored specifically for our applications needs.
  • To make it more discrete by giving examples, we opted for having two selectors only, since the rest of the selectors defined in W3C Annotation Data Model had no meaningful use case in our implementation.
  • We made annotation consisting of multiple bodies possible but limited the number of target exactly to one. Though else is possible and implemented in the backend we created one annotation at a time for a pair of body and target (for our application that was the only meaningful use case).
  • Examples below demostrates the all possible fields in an annotation. In order to determine which fields to make required and which fields to make optional we followed the W3C annotation data model and made all fields indicated as 'must' which the meaning and scope of it described in rfc2129.

Implementation description

  • We have implemented our annotation server as a separate service which has its own docker image and database. Even though it runs on the same machine they are different application which listens to different ports.
  • For annotation service we utilized a postgresql db do model our annotation data model that complies with W3C standarts.
  • For both mobile and frontend no libraries are used directly to implement the annotations. Our team developed the necessary infrastructure to annotate contents for themselves.

API calls examples to annotation server:

Image annotation creation:

POST /annotation/create HTTP/1.1
Host: game-lounge.com:9091
Content-Type: application/json
Content-Length: 768

{
    "context": "http://www.w3.org/ns/anno.jsonld",
    "id": "YourAnnotationId",
    "type": "Annotation",
    "motivation": [
        "commenting",
        "annotating"
    ],
    "creator": "backendUser",
    "created": "2023-03-01T12:00:00",
    "body": [
        {
            "id": "YourBodyId",
            "type": "TextualBody",
            "value": "This is a post!",
            "format": "text/plain",
            "language": "en",
            "purpose": "commenting"
        }
    ],
    "target": {
        "id": "https://game-lounge-storage.s3.eu-north-1.amazonaws.com/game-pictures/7",
        "format": "text/html",
        "language": "tr",
        "selector": {
            "type": "Text",
            "value": "xywh=10,20,150,200"
        }
    }
}

Textual annotation creation:

POST /annotation/create HTTP/1.1
Host: game-lounge.com:9091
Content-Type: application/json
Content-Length: 742

{
    "context": "http://www.w3.org/ns/anno.jsonld",
    "id": "YourAnnotationId",
    "type": "Annotation",
    "motivation": [
        "commenting",
        "annotating"
    ],
    "creator": "backendUser",
    "created": "2023-03-01T12:00:00",
    "body": [
        {
            "id": "YourBodyId",
            "type": "TextualBody",
            "value": "This is a post!",
            "format": "text/plain",
            "language": "en",
            "purpose": "commenting"
        }
    ],
    "target": {
        "id": "http://167.99.242.175:8080/post/1",
        "format": "text/html",
        "language": "tr",
        "selector": {
            "type": "FragmentSelector",
            "value": "xywh=10,20,150,200"
        }
    }
}

Annotation retrieval by annotation id:

GET /annotation/your-annotation-id HTTP/1.1
Host: game-lounge.com:9091

Annotation retrieval by target id:

POST /annotation/get-annotations-by-target HTTP/1.1
Host: game-lounge.com:9091
Content-Type: application/json
Content-Length: 55

{
    "targetId": "http://167.99.242.175:8080/post/1"
}

image annotation creation & retrieval

Clone this wiki locally