Project

General

Profile

Actions

Feature #2434

closed

API: Text annotation for presentation view

Added by Alexander Watzinger about 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
Start date:
2024-12-24
Estimated time:

Description

Now that we implemented text annotation we should also provide annotated HTML text via the API to e.g., also use it in presentation sites.

Some thoughts:
  • Currently this would be needed for the description of source and source_translation
  • There is already functionality for this in the backend. We can look together how to adapt it for that purpose too.
  • When using existing functionality we have to change the URLs for provided links. Maybe this can be a generic relative path to not have to deal with individual domain names.
  • Not sure if this should be an extra API endpoint because this could get expensive. Maybe more like a flag to provide also the annotated (description) text?

Related issues 5 (0 open5 closed)

Related to OpenAtlas Discovery - Feature #2429: List related texts below listed sourceClosed2024-12-12Actions
Related to OpenAtlas - Feature #2562: API: 4.9.0ClosedBernhard Koschiček-Krombholz2025-06-10Actions
Related to OpenAtlas - Feature #2563: API: Presentation view improvementsClosedBernhard Koschiček-Krombholz2025-06-10Actions
Follows OpenAtlas - Feature #2079: Text annotationClosedAlexander Watzinger2024-12-23Actions
Precedes OpenAtlas Discovery - Feature #2435: Display annotated textClosedOlivia Reichl2024-12-25Actions
Actions #1

Updated by Alexander Watzinger about 1 year ago

  • Start date changed from 2024-12-17 to 2023-09-26
  • Follows Feature #2079: Text annotation added
Actions #2

Updated by Alexander Watzinger about 1 year ago

Actions #3

Updated by Alexander Watzinger about 1 year ago

  • Start date changed from 2023-09-26 to 2024-12-24
Actions #4

Updated by Bernhard Koschiček-Krombholz about 1 year ago

  • When using existing functionality we have to change the URLs for provided links. Maybe this can be a generic relative path to not have to deal with individual domain names.

We can use the same url parameter, which we use for IIIF. That means the basic URL would be the API representation of the entity. If a presentation site URL is available, it would overwrite the API link. And if the url parameter is used, it overwrites everything with this URL.

  • Not sure if this should be an extra API endpoint because this could get expensive. Maybe more like a flag to provide also the annotated (description) text?

I would make a parameter like ?annotation=<false, html>, which can be extended later. It will be available at every Entity Endpoint. The description text will be transformed into HTML. To discuss is, if also non annotated description text will be surrounded with a <p></p> tag, so the data handling will be the same as with annotated text.

One thing is important for the frontend strategy: The source translation (aka Text in the backend GUI) is also a single entity. So they need to be fetched extra, either with /linked_entities_by_properties_recursive/{entityId}?properties=P73 or asynchronously later (which will be better suited for Discovery).

Actions #5

Updated by Alexander Watzinger about 1 year ago

Thanks Bernhard for your feedback.
  • Adding an option to provide annotated text with default false sounds good and should also be backwards compatible.
  • The URL solution sounds fine too but I don't have enough insight there and just trust you :)
  • I wouldn't include surrounding <p> tags. We don't know where this will be used so I would opt to do without it.
  • About an extra call for texts of sources: there is a related issue in discovery which I linked to this issue -> #2429: List related texts below listed source
Actions #6

Updated by Alexander Watzinger about 1 year ago

  • Related to Feature #2429: List related texts below listed source added
Actions #7

Updated by Bernhard Koschiček-Krombholz 11 months ago

  • Target version changed from 8.10.0 to 8.12.0

Made a branch with where two options are available. But for now moving this issue behind, because of more pressing issues.

Actions #8

Updated by Alexander Watzinger 11 months ago

  • Subject changed from API: Make annotated HTML available to API: Make annotation available
Actions #9

Updated by Bernhard Koschiček-Krombholz 11 months ago

  • Status changed from Assigned to Acknowledged
  • Assignee deleted (Bernhard Koschiček-Krombholz)
  • Target version changed from 8.12.0 to 8.15.0

The two options are either a tagged text (annotation_text) or the postions where the annotation starts and end, with all information (annotations).

"descriptions": [
        {
          "value": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \n\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \n\nUt wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. ",
          "annotation_text": "Lorem ipsu<mark meta=\"{&quot;annotationId&quot;: &quot;a-1&quot;, &quot;entityId&quot;: 81721, &quot;comment&quot;: &quot;Codex &quot;}\">m dolor sit amet, conset</mark>etur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut<mark meta=\"{&quot;annotationId&quot;: &quot;a-2&quot;, &quot;entityId&quot;: 163, &quot;comment&quot;: &quot;Trento&quot;}\"> labore et dolore </mark>magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum <mark meta=\"{&quot;annotationId&quot;: &quot;a-3&quot;, &quot;comment&quot;: &quot;Only comment&quot;}\">dolor sit amet, </mark>consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit<mark meta=\"{&quot;annotationId&quot;: &quot;a-4&quot;, &quot;entityId&quot;: 155, &quot;comment&quot;: &quot;Freising&quot;}\"> amet. </mark><br><br><mark meta=\"{&quot;annotationId&quot;: &quot;a-5&quot;, &quot;entityId&quot;: 155, &quot;comment&quot;: &quot;Freising&quot;}\">Duis autem</mark> vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla <mark meta=\"{&quot;annotationId&quot;: &quot;a-6&quot;, &quot;entityId&quot;: 204645}\">facilisis</mark> at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. <br><br><mark meta=\"{&quot;annotationId&quot;: &quot;a-7&quot;, &quot;entityId&quot;: 81725, &quot;comment&quot;: &quot;Artifact?&quot;}\">Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla</mark> facilisi. ",
          "annotations": [
            {
              "source_id": 233634,
              "entity_id": 81721,
              "link_start": 10,
              "link_end": 34,
              "text": "Codex " 
            },
            {
              "source_id": 233634,
              "entity_id": 163,
              "link_start": 98,
              "link_end": 116,
              "text": "Trento" 
            },
            {
              "source_id": 233634,
              "entity_id": null,
              "link_start": 604,
              "link_end": 620,
              "text": "Only comment" 
            },
            {
              "source_id": 233634,
              "entity_id": 155,
              "link_start": 881,
              "link_end": 888,
              "text": "Freising" 
            },
            {
              "source_id": 233634,
              "entity_id": 155,
              "link_start": 890,
              "link_end": 900,
              "text": "Freising" 
            },
            {
              "source_id": 233634,
              "entity_id": 204645,
              "link_start": 1013,
              "link_end": 1022,
              "text": "" 
            },
            {
              "source_id": 233634,
              "entity_id": 81725,
              "link_start": 1308,
              "link_end": 1696,
              "text": "Artifact?" 
            }
          ]
        }
      ]

@Olivia Reichl and @Katharina Wünsche please tell me, when you have time for it and we discuss further details.

Actions #11

Updated by Bernhard Koschiček-Krombholz 6 months ago

Actions #12

Updated by Bernhard Koschiček-Krombholz 6 months ago

  • Related to Feature #2563: API: Presentation view improvements added
Actions #13

Updated by Bernhard Koschiček-Krombholz 6 months ago

  • Subject changed from API: Make annotation available to API: Text annotation for presentation view
  • Status changed from Acknowledged to Closed
  • Assignee set to Bernhard Koschiček-Krombholz

Changes in develop.

For now, I added it to presentation view to automatically show the annotation if the entity is a source. For the other formats and Endpoints, another solution will be implemented when needed.

Actions #14

Updated by Alexander Watzinger 5 months ago

  • Target version changed from 8.15.0 to 8.13.0
Actions

Also available in: Atom PDF