DASISH / dwan-backend

DASISH Task 5.6. Annotation framework backend
0 stars 1 forks source link

Include option for exact match query #13

Open andmor- opened 10 years ago

andmor- commented 10 years ago

When searching for annotations referring to a certain target link, one uses a request in the format: https:////webannotator/api/annotations?access=read&link=59d08e6a-5cd9-4aed-8aa4-7074c270e635 Which performs a full text search on the value of the XPath node 'annotation/targets/targetInfo/link/text()'.

This creates some complications:

  1. There is no reliable way to get a list containing just the annotations referring to an exact target URL. Any link that includes the searched link as substring, will also be displayed. e.g. if one annotates the address 'https://someserver.somedomain/products' and also 'https://someserver.somedomain/products/laptops', when requesting the list of annotations available for '/products', one will also get the annotations referring to '/products/laptops'. Suggestion: Allow differentiation between exact and partial match queries.
  2. The request parameter syntax ...'&link=59d08e6a-5cd9-4aed-8aa4-7074c270e635' actually suggests that an exact match query will be performed. Suggestion: Keep this syntax for exact match queries and create a new one for partial matches, e.g. '&linkFragment=59d08e6a-5cd9-4aed-8aa4-7074c270e635'
  3. Since it is a partial match query and the searched node 'annotation/targets/targetInfo/link/text()' is not included in the annotationInfoList result, it is not possible to know which kind of match made a certain result appear in the annotationInfoList result without further requesting that specific annotation in full. Suggestion: Include the searched node 'annotation/targets/targetInfo/link/text()' in the annotationInfoList result of partial match queries.
olhsha commented 10 years ago

Fixed partially by making filtered search on links an exact search. also added the parameter "matchMode", so the search request may looks like one of the follows:

GET api/annotations?link=Sagrada&matchMode=contains GET api/annotations?link=http://nl.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia&matchMode=exact GET api/annotations?link=http://nl.wikipedia.org/wiki&matchMode=starts_with GET api/annotations?link=_Fam%C3%ADlia&matchMode=ends_with GET api/annotations?link=http://nl.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia

The default mode (the very last example) is exact.

olhsha commented 10 years ago

fixing version deployed on lux16.