INCATools / dead_simple_owl_design_patterns

A simple system for specifying OWL class design patterns for OBO-ish ontologies.
http://incatools.github.io/dead_simple_owl_design_patterns/
GNU General Public License v3.0
40 stars 5 forks source link

simple tester falsly fails on single quote #55

Closed matentzn closed 3 years ago

matentzn commented 3 years ago
  text: "An instance of %s that is caused by an inherited modification of the individual's genome."

causes the simple-tester validation script to fail with the remark:

warnings.warn("text field '%s' has an odd number of single quotes." % val)

dosumis commented 3 years ago

The test is required for Manchester syntax text fields, as single quotes are used to delimit/identify owl entities. It could potentially be dropped for fields with literal values like this, but that is not straightforward - the test currently runs on any field named 'text' and there is currently no simple way to identify Manchester Syntax fields (Might be possible to derive from schema with a better JSON schema lib; but can't be done with current one).

I suspect that the only viable solution is to add support for escaping (with backslash). Would that be OK?

matentzn commented 3 years ago

Yeah I think so! But if we do that, we should make respective warning in the simple tester (unescaped ')

dosumis commented 3 years ago

Agreed.

dosumis commented 3 years ago

I suspect that escapes will need support in dosdp tools if we want to avoid them ending up as literal text. @balhoff - is this correct?

Would prefer this to be in place before changing test.

matentzn commented 3 years ago

@balhoff @dosumis whats the status of this? causing some problems for me :)

balhoff commented 3 years ago

Do we have an escape decided?

dosumis commented 3 years ago

Would \be sufficient?

balhoff commented 3 years ago

Update—we had some discussion offline. I lean against adding escapes for this situation. Mainly because the text fields causing the errors don't have a meaning for balanced quotes, and shouldn't need to escape them. The text fields requiring balanced quotes (Manchester syntax) don't allow quotes for any other purpose (we recently tightened up the allowed regex for variable names), and so also don't need to escape them. That pushes back the issue to changing the validator (sorry @dosumis).