Onto-Med / top-frontend

JavaScript based frontend of the TOP Framework
MIT License
0 stars 1 forks source link

Handle cases where abstract phenotype's datatype is changed #139

Closed AlexU75 closed 10 months ago

ChristophB commented 1 year ago

@AlexU75 Please describe further, how you have created the restrictions in the test repository [1]. Their type was set to number, thus you cannot enter string values in the form.

[1] https://top.imise.uni-leipzig.de/test/test-repo

AlexU75 commented 1 year ago

I probably first saved 'Geschlecht' as 'Number', then created the restrictions and then changed the data type of 'Geschlecht'.

ChristophB commented 1 year ago

OK, so we need to specify what should happen to existing restrictions, if the abstract datatype is changed by the user. Is this even allowed? The model will become inconsistent.

Maybe we should disable the datatype field after the phenotype has been created?

AlexU75 commented 1 year ago

Would it perhaps be possible to check whether the phenotype has already been referenced (by restrictions or composite phenotypes)?

ChristophB commented 1 year ago

That is possible, but might be an overkill to do it on the frontend. Especially, when there are many phenotypes in the repository and only a fraction of them are loaded from the backend.

AlexU75 commented 1 year ago

OK, then we can disable the field for now. We can think about it later. But I imagine the case that you have already defined several codes and also several restrictions (with codes) before you realized that you have a wrong data type.

When specifying the formulas, are the variables checked if they match the data type of the corresponding functions? If not, then the model could also be inconsistent.

ChristophB commented 1 year ago

Datatype of function arguments is already covered in https://github.com/Onto-Med/top-api/issues/31.

Can this information be retrieved from top-phenotypic-query?

AlexU75 commented 1 year ago

Currently not. But it would be possible, I think. We could define one datatype for all arguments of a function or one per argument. If a function can have unlimited number of arguments and the datatype is defined e.g. only for the first 2, then the last datatype is used for the remaining arguments.

ChristophB commented 1 year ago

Reopening for documentation