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

Enable dataset queries in EVE framework #366

Open TomasKulhanek opened 5 years ago

TomasKulhanek commented 5 years ago

Query for existing annotation related to dataset and dataset elements This could be achieved by:

  1. Presuming [dataset_element_url] == [dataset url]/[dataset file]. Filtering annotation by target.source using regex to filter dataset url starting with specified string - dataset elements: https://b2note.bsc.es/api/annotations?where={%22target.source%22:{%22$regex%22:%20%22^https://trng-b2share.eudat.eu/api/files/44f3fc75-3f68-42c2-b537-ae0917ebcb44/.*%22}}

  2. Presuming dataset element annotation share same target.id. Filtering annotation by target.id - same value shared among dataset elements: https://b2note.bsc.es/api/annotations?where={%22target.id%22:%22http://hdl.handle.net/0000/810f3882fa0a4196aa9fd080de5f71c7%22}

TomasKulhanek commented 5 years ago

$regex and filtering by target.id is disabled by default. Query contains operators banned in MONGO_QUERY_BLACKLIST" - thus regex should be enabled in eve config https://docs.python-eve.org/en/stable/config.html "filter on 'target.id' not allowed" - again needs to be enabled in eve config

After enabling filter and regex in query