Closed AlexU75 closed 10 months ago
I probably first saved 'Geschlecht' as 'Number', then created the restrictions and then changed the data type of 'Geschlecht'.
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?
Would it perhaps be possible to check whether the phenotype has already been referenced (by restrictions or composite phenotypes)?
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.
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.
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?
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.
Reopening for documentation
@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