EUDAT-B2NOTE / b2note

B2NOTE is a EUDAT pilot service allowing users to "annotate" semantically a document.
https://b2note.bsc.es
MIT License
4 stars 9 forks source link

Function checking duplicate annotation #109

Open ant1b opened 7 years ago

ant1b commented 7 years ago

Will be used to send feedback message to user in case they attempt to create an annotation with a body that is a duplicate of a previously existing annotation for the same target file.

Output: boolean duplicate True/False

Inputs: target_url (str), intended (new) annotation body (dict).

Process: 1) Retrieve all annotations with target jsonld_id that of the target file. 2a) New annotation to be semantic tag: check whether any of the retrieved annotations uses the same jsonld_id as the intended new one (exclude checking free-text). 2b) New annotation to be free-text: check whether any of the retrieved annotations uses the same body.value as the intended new one (includes either semantic-tag or free-text). 3) Return boolean result of check.

ant1b commented 7 years ago

Change: output the would_be_duplicated annotation document, instead of True.

Output: QuerySet/False.