annotation / stam

Stand-off Text Annotation Model (STAM) is a data model for stand-off-text annotation where any information on a text is represented as an annotation. This repository contains the model's full specification, extensions, schemas, examples and documentation.
https://annotation.github.io/stam/
Creative Commons Attribution Share Alike 4.0 International
15 stars 2 forks source link

Not able to successfully able to retrieve annotations api from text selection. #33

Open tenzin3 opened 1 day ago

tenzin3 commented 1 day ago

@proycon . I recently face an issue retrieving annotations where its span are included in an particular TextSelection span. The api methods is retrieving annotations only if its offset is same to offset that of text selection. But i believe api TextSelection.annotations method also intends to returns annotations where its offset comes in between the text selection boundary.

proycon commented 7 hours ago

That is intended behaviour.

If you want to return annotations that may be anywhere in the text selection boundary then you should use:

textselection.related_text(TextSelectionOperator.embeds()).annotations()

Note that this will not return the textselection itself, so you might want to also do textselection.annotations() to capture those too.