Skip to content

edsilv/iiif-ecs-proposal

Repository files navigation

IIIF-ECS Extension Proposal

This is a proposal (work in progress) for an extension of the IIIF Presentation API to allow it to be used as an Entity Component System.

Canvas is equivalent to Entity.

Annotation is equivalent to Component.

IIIF viewers ('engines'?) contain the System logic to process the effects of components (annotations) on entities (canvases).

The IIIF-ECS Extension would permit an extra set of annotation motivations to be used.

These would allow annotations to specify behaviours, conferring display properties such as scale, position, rotation with their corresponding json values to canvases.

The proposed IIIF engines would prefer these to inline canvas properties of width, height, and duration.

Using the motivation of painting to annotate a 3D resource onto a canvas is permitted, shifting authority/responsibility for how media can be displayed from the annotated to the annotator.

To extend a IIIF manifest to allow ECS behaviour, include a custom jsonld context:

"@context": [
    "https://edsilv.github.io/iiif-ecs-proposal/ecs.json",
    "http://iiif.io/api/presentation/3/context.json"
]

Example Implementation

https://github.com/edsilv/iiiframe

Components

Scale
{
    "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/0",
    "type": "Annotation",
    "motivation": "scale",
    "target": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0",
    "body": {
        "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/0/body/0",
        "format": "application/json",
        "type": "DataSet",
        "value": {
            "x": 100,
            "y": 100
        }
    }
}

In the example above, the x and yvalues describe a flat plane with width and height of 100. z is also allowed, but can be omitted. This is equivalent to a conventional 2D image.

Position
{
    "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/1",
    "type": "Annotation",
    "motivation": "position",
    "target": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0",
    "body": {
        "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/1/body/0",
        "format": "application/json",
        "type": "DataSet",
        "value": {
            "x": 0,
            "y": 0,
            "z": -1
        }
    }
}

Defines the position of the canvas relative to the camera. In this example, centered and 1 unit's distance away.

Rotation
{
    "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/2",
    "type": "Annotation",
    "motivation": "rotation",
    "target": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0",
    "body": {
        "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/2/body/0",
        "format": "application/json",
        "type": "DataSet",
        "value": {
            "x": 45,
            "y": 90,
            "z": 180
        }
    }
}

Rotate 45 degrees about the x axis, 90 degrees about the y axis, and 180 degrees about the z axis.

Display
{
    "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/3",
    "type": "Annotation",
    "motivation": "display",
    "target": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0",
    "body": {
        "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/3/body/0",
        "format": "application/json",
        "type": "DataSet",
        "value": {
            "viewingDirection": "top-to-bottom",
            "continuous": true
        }
    }
}

The continuous viewingHint or behavior requires the presence of a viewingDirection in IIIF. I propose that these are consolidated into properties of a single display component per canvas.

Playback
{
    "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/4",
    "type": "Annotation",
    "motivation": "playback",
    "target": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0",
    "body": {
        "id": "https://edsilv.github.io/iiif-ecs-proposal/canvas/0/anno/4/body/0",
        "format": "application/json",
        "type": "DataSet",
        "value": {
            "duration": 3723.4,
            "continuous": true
        }
    }
}

The playback component adds duration and other temporal properties to a canvas.

The continuous property in this context instructs the playback system to advance to the next playable canvas when this canvas's playable duration ends.

Nested Entities

#2

References

https://www.slideshare.net/workergnome/extending-iiif-30

https://w3c.github.io/web-annotation/model/wd/#extending-motivations

About

IIIF-ECS Extension Proposal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published