Skip to content

LBRON-1364 smart search annotation datamodel#97

Open
tdn wants to merge 8 commits into
developmentfrom
feature/LBRON-1364-smart-search-datamodel
Open

LBRON-1364 smart search annotation datamodel#97
tdn wants to merge 8 commits into
developmentfrom
feature/LBRON-1364-smart-search-datamodel

Conversation

@tdn
Copy link
Copy Markdown
Contributor

@tdn tdn commented May 8, 2026

*** Do not merge yet***
Due to the extensions needed for this use case, we need to make a few changes to the HVT frontend and annotation-review service to make sure everything keeps working the way it does now.

To align with the way we store annotations (and reviews) in the HVT (see https://github.com/lblod/frontend-decide-human-validator and https://github.com/lblod/annotation-review-service), we choose to use the Web Annotation Ontology: http://www.w3.org/ns/oa#
In the HVT, oa:Annotation is used in 2 forms:

  1. to store the annotations the AI pipeline makes, as oa:Annotation with a nif:confidence score.
  2. to store the reviews of the annotations, also as oa:Annotation , with the added class of ext:ReviewAnnotation

Each annotation has a target, which in the HVT was limited to resources of class oa:SpecificResource. To accommodate other annotations/reviews though, we need to allow other resource types as target as well. Therefore, we introduce a parent class ext:AnnotationTarget, whch oa:SpecificResource can extend.

For the smart search (UC2), we need to store two types of user feedback:

  1. Feedback (thumbs up/down) on the answer as a whole.
  2. Feedback (thumbs up/down) on the decisions listed as sources for the answer.

To do this, we introduce two new classes to the model that extend ext:AnnotationTarget : schema:Answer and schema:Quotation .

The model for annotations is summarized in the following diagram:
image

notes:

@tdn tdn marked this pull request as draft May 12, 2026 08:27
@brechtvdv
Copy link
Copy Markdown
Contributor

brechtvdv commented May 13, 2026

Can you add the review result (http://mu.semte.ch/vocabularies/ext/annotation-review#approve and #reject) as subclasses of AnnotationBody?
Human validation tool still works with these changes

Copy link
Copy Markdown
Contributor

@Rahien Rahien left a comment

Choose a reason for hiding this comment

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

It seems that with the added superclass, the annotation-review service now returns duplicate results in the response when listing the annotations for an expression. could you have a look at that?

Copy link
Copy Markdown
Contributor

@Rahien Rahien left a comment

Choose a reason for hiding this comment

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

can't reproduce the issue i had with duplicate annotations

@tdn
Copy link
Copy Markdown
Contributor Author

tdn commented May 18, 2026

Can you add the review result (http://mu.semte.ch/vocabularies/ext/annotation-review#approve and #reject) as subclasses of AnnotationBody?

you mean just in the diagram? Or also in the resource config? Because the result is just a constant URI, right?

@tdn tdn marked this pull request as ready for review May 18, 2026 08:11
@brechtvdv
Copy link
Copy Markdown
Contributor

Fyi: the download script is using this datamodel for human validations: #105

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.

3 participants