SciCatProject / backend-v3

SciCat Data Catalogue Backend
https://scicatproject.github.io/documentation/
BSD 3-Clause "New" or "Revised" License
13 stars 17 forks source link

Partial matching of strings in generateScientificExpression #680

Closed linupi closed 1 year ago

linupi commented 2 years ago

Description

This PR adds an additional CONTAINS_STRING condition to the generateScientificExpression function to filter within strings in scientific metadata.

Motivation

When defining our meta data schemas we realized that it would be very helpful for us to also filter on partially matching strings in the scientific metadata. However, so far there is only EQUAL_TO_STRING for text based entries in scientific metadata so we propose an additional CONTAINS_STRING which should work on simple strings as well as on lists. Here is an example:

"scientificMetadata": {
        "localContact": "John Doe",
        "experimentalists": [
                "John Doe",
                "Max Mustermann"
         ]

The idea of the proposed CONTAINS_STRING is that it would match e.g. John in both cases (as localContact as well as in experimentalists)

Changes:

Tests included/Docs Updated?