INCATools/dead_simple_owl_design_patterns

simple tester falsly fails on single quote

Closed this issue · 8 comments

  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)

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?

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

Agreed.

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.

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

Do we have an escape decided?

Would \be sufficient?

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).