Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle TextualBody and PaintingAnnotation with Body array #59

Merged
merged 9 commits into from
Feb 10, 2025

Conversation

JackLewis-digirati
Copy link
Collaborator

@JackLewis-digirati JackLewis-digirati commented Feb 6, 2025

Resolves #56

Gets TextualBody to work correctly within Annotation

Additionally, refactors body to work with all motivations rather than a select couple of motivations

NOTE: SupplementingAnnotation and TypeClassifyingAnnotation have been marked as obsolete due to being replaced in functionality by GeneralAnnotation, but have been left in for backwards compatibility

Finally, references to Nuget have bee n removed from the build due to this

This was also tested with IIIF Presentation using the following payload:

{
    "type": "Manifest",
    "behavior": [
        "public-iiif"
    ],
    "label": {
        "en": [
            "post testing"
        ]
    },
    "slug": "with-textual-body",
    "parent": "root",
     "items": [
    {
      "id": "https://test.example.com/canvas/1",
      "type": "Canvas",
      "width": 1000,
      "height": 1001,
      "thumbnail": [
        {
          "id": "https://test.image",
          "type": "Image",
          "format": "image/jpeg",
          "service": [
            {
              "@context": "http://iiif.io/api/image/2/context.json",
              "@id": "https://test.example.com/canvas/1/image",
              "@type": "ImageService2",
              "profile": "http://iiif.io/api/image/2/level1.json",
              "width": 200,
              "height": 200
            }
          ]
        }
      ],
      "items": [
        {
          "id": "https://test.example.com/canvas/1/page",
          "type": "AnnotationPage",
          "items": [
            {
              "id": "https://test.example.com/canvas/1/page/image",
              "type": "Annotation",
              "motivation": "painting",
              "body": {
                "id": "https://test.example.com/canvas/1/image/full/max/1000,1000/0/default.jpg",
                "type": "Image",
                "format": "image/jpeg",
                "service": [
                  {
                    "@context": "http://iiif.io/api/image/2/context.json",
                    "@id": "https://test.example.com/canvas/1/image",
                    "@type": "ImageService2",
                    "profile": "http://iiif.io/api/image/2/level1.json",
                    "width": 1000,
                    "height": 1001
                  },
                  {
                    "@context": "http://iiif.io/api/image/3/context.json",
                    "id": "https://test.example.com/canvas/1/image/3",
                    "type": "ImageService3",
                    "profile": "level2",
                    "width": 1000,
                    "height": 1001
                  }
                ]
              },
              "target": "https://test.example.com/canvas/1"
            }
          ]
        }
      ],
      "annotations": [
        {
          "id": "https://test.example.com/canvas/1/page",
          "type": "AnnotationPage",
          "items": [
            {
              "type": "Annotation",
              "motivation": "canvassing",
              "body": {
                "id": "https://test.example.com/canvas/1/page/textualBody",
                "type": "TextualBody",
                "rights": "some rights",
                "value": "Hello World!",
                "format": "text/plain",
                "purpose": "some purpose",
                "creator": "https://test.example.com/user",
                "created": "2025-02-07T15:08:59.762192Z",
                "modified": "2025-02-07T15:08:59.7622467Z",
                "generator": "https://test.example.com/user",
                "generated": "2025-02-07T15:08:59.7623402Z",
                "role": "https://test.example.com/user/role",
                "audience": "everyone",
                "accessibility": "public",
                "canonical": "true",
                "via": "somewhere"
              }
            }
          ]
        }
      ]
    }
  ]
}

Copy link
Member

@donaldgray donaldgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, simpler than it seemed at first

@JackLewis-digirati JackLewis-digirati merged commit a4bc210 into main Feb 10, 2025
1 check passed
@JackLewis-digirati JackLewis-digirati deleted the feature/supportAnnotationBody branch February 10, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support inline annotation body deserialisation
2 participants