NHMDenmark / DaSSCo-asset-service

DaSSCo asset service is part of DaSSCo storage system
0 stars 0 forks source link

ARS Search Engine - Data structure updates #79

Closed mvb-nt closed 3 months ago

mvb-nt commented 3 months ago

The data structure needs to be changed.

Right now, each query is a number of where statements related to the individual nodes, e.g. "where Asset.name = 'test' and Institution.name = 'test' or Institution.name = 'testtest'".

It has to be changed so that it allows multiple unique FULL where statements like the above, in case the user wants to search for multiple specific assets. Therefore we also need to add an "and" or "or" function to the FULL statements, e.g.: e.g. "(where Asset.name = 'test' and Institution.name = 'test' or Institution.name = 'testtest') OR (where Asset.name = 'test2' and Institution.name = 'test2' or Institution.name = 'testtest2')".

How this exactly will look like in the Cypher part of this, I am unsure, and it is TBD. The object itself hopefully won't need too much work. Currently it looks like this, as an example:

[
    {
        "select": "Asset",
        "wheres": [
            {
                "type": "or",
                "operator": "=",
                "property": "name",
                "value": "test"
            },
            {
                "type": "or",
                "operator": "=",
                "property": "name",
                "value": "testtest"
            }
        ]
    },
    {
        "select": "Institution",
        "wheres": [
            {
                "type": "and",
                "operator": "=",
                "property": "name",
                "value": "inst"
            }
        ]
    },
]

And it will likely need to be changed to something like this instead (just an initial thought, nothing is decided):

"0": 
"type": "and",
"select": [
    {
        "select": "Asset",
        "wheres": [
            {
                "type": "or",
                "operator": "=",
                "property": "name",
                "value": "test"
            },
            {
                "type": "or",
                "operator": "=",
                "property": "name",
                "value": "testtest"
            }
        ]
    },
    {
        "select": "Institution",
        "wheres": [
            {
                "type": "and",
                "operator": "=",
                "property": "name",
                "value": "inst"
            }
        ]
    }
],
"1": 
"type": "or",
"select": [
    {
        "select": "Asset",
        "wheres": [
            {
                "type": "or",
                "operator": "=",
                "property": "name",
                "value": "test2"
            },
            {
                "type": "or",
                "operator": "=",
                "property": "name",
                "value": "testtest2"
            }
        ]
    },
    {
        "select": "Institution",
        "wheres": [
            {
                "type": "and",
                "operator": "=",
                "property": "name",
                "value": "inst2"
            }
        ]
    }
]

The query-creator and the cypher statement will need to be completely reworked as well as the way the components are put together in the frontend.

Notes after initial refinement meeting: