knaw-huc / broccoli

Da Broker 🥦
MIT License
0 stars 1 forks source link

Add targetSource endpoint for fetching annotations based on targetSource #60

Open svandaalen opened 2 weeks ago

svandaalen commented 2 weeks ago

To integrate https://github.com/knaw-huc/textannoviz/issues/128 into TAV, TAV needs an endpoint in Broccoli that allows for fetching of annotations based on the target.source.

A quick recap of what we discussed yesterday:

The AR search query to fetch the Resolutions that belong to canvasId https://images.diginfra.net/api/pim/iiif/9c33830d-797f-4a14-a474-5017466700c7/canvas/93504486-522c-42f6-8001-d13829692f5c is:

{
  "target.type": "Canvas",
  "target.source": "https://images.diginfra.net/api/pim/iiif/9c33830d-797f-4a14-a474-5017466700c7/canvas/93504486-522c-42f6-8001-d13829692f5c",
  "body.type": "Resolution"
}

Bram noted that "target.type": "Canvas", could be left out. He also already created an index in AR to speed up this query.

hayco commented 2 weeks ago

@brambg mentioned that target.type is not even necessary in the query. This could mean that we can abstract from calling this 'get by canvasID' to 'get by targetSource' or something similar, allowing for more use cases to be handled by the same endpoint.

brambg commented 2 weeks ago

Met de huidige target.type lijkt me dat geen probleem: de target.source van het ene target.type wordt nooit bij een ander target.type gebruikt.