INCATools / dosdp-tools

Utility for working with DOSDP design patterns and OWL ontologies
MIT License
23 stars 5 forks source link

'terms' command fails if object property used as a variable #417

Closed Clare72 closed 2 years ago

Clare72 commented 2 years ago

My pattern works fine for term generation and passes validation, but 'terms' fails when I try to run my release (using ODK).

I know using an object property as a variable is an unusual use case (and perhaps only accidentally supported for term generation?), but thought I would flag it anyway. For now I think I can just avoid generating this particular seed file, since there are no classes/properties that are not also present in the main -edit file.

relevant part of makefile

relevant part of pattern - I am providing synapse_type as one of the four synapsed_via... relationships listed under relations

console output:

if [ true  = true ]; then dosdp-tools terms --infile=../patterns/data/all-axioms/larvalMotorNeuronBySegment.tsv --template=../patterns/dosdp-patterns/larvalMotorNeuronBySegment.yaml --obo-prefixes=true --outfile=../patterns/data/all-axioms/larvalMotorNeuronBySegment.txt; fi
2022-06-09 12:39:50.968Z error [] [context: command=terms;pattern=../patterns/dosdp-patterns/larvalMotorNeuronBySegment.yaml;input=../patterns/data/all-axioms/larvalMotorNeuronBySegment.tsv;output=../patterns/data/all-axioms/larvalMotorNeuronBySegment.txt] Failed to parse class expression: '$synapse_type' some '$muscle':
Encountered some at line 1 column 17. Expected one of:
    or
    and
    |EOF|

make: *** [Makefile:471: ../patterns/data/all-axioms/larvalMotorNeuronBySegment.txt] Error 1
balhoff commented 2 years ago

@Clare72 the spec doesn't allow variables for properties. I didn't realize it worked in some situations. @dosumis any comments? I think the reasoning was to enforce a level of simplicity with the patterns.

dosumis commented 2 years ago

Surprised that the validation passes. It is not allowed by the spec - for reasons on simplicity. The idea was that allowing property slots would make patterns too abstract. If we want to support, we would need to extend the spec, which won't be so quick. Probably best to go with 4 patterns for now.

Clare72 commented 2 years ago

OK, pattern will be less concise, but I will refactor if this is not supposed to be supported.

dosumis commented 2 years ago

Thinking about this some more, validation fail against DOSDP python checker is not suprising, as the Python step is just JSON schema + some syntactic checks. It knows nothing about OWL types & so could only be enforced by DOSDP-tools