TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
271 stars 88 forks source link

no need to specify scheme when deleting a constraint specification #2261

Closed sydb closed 8 months ago

sydb commented 2 years ago

The @scheme attribute of <constraintSpec> is required. Seems to me it should not be required when the @mode is delete. (Why should I need to know what scheme it was in just to get rid of it?)

lb42 commented 2 years ago

Somewhat far-fetched, but might you not have a situation where you express your constraints using multiple @schemes, and then select which one to apply at runtime? in which case you might well need to specify which one you're trying to delete.

sydb commented 2 years ago

@scheme is defined as only 1 (enumerated) value, and thus cannot contain spaces; so there is not really any mechanism for saying you are using multiple schemes. Besides, <constraintSpec> has only 1 child <constraint>, so where would you put the constraint in scheme 2? I suppose someone could say

      <constraintSpec scheme="schematron_and_SPITBOL" ident="title_ne_author">
        <constraint>
          <sch:assert test="normalize-space(title) eq normalize-space(author)">
            title and author cannot be the same
          </sch:assert>
          (output = leq(title,author) "title and author cannot be the same")
        </constraint>
      </constraintSpec>

but I would want to actively discourage such a mash-up. (And we do: they would have to ignore the validation error “Rules in the ISO Schematron language must be inside a constraintSpec with the value 'schematron' on the scheme attribute”.)

sydb commented 2 years ago

@TEIC/tei-technical-council — Does anyone think this is a bad idea? If not, I can just “make it so” in a branch and issue a PR.[1] So I ask you each to post here whether you do or do not object to this idea.

Notes [1] My plan would be to make @scheme of <constraintSpec> optional, then to add a <constraintSpec> to the definition of <constraintSpec> that says “The @scheme attribute of <constraintSpec> is required when the @mode is XXXX.”. (And, obviously, XXXX is the <sch:value-of select="@mode"/> :-)

peterstadler commented 1 year ago

this looks like a showcase for an <attList org="choice"> construct (see #2140) rather than constraining via <constraintSpec>?!

martinascholger commented 1 year ago

Council F2F agrees that @scheme should not be required (and perhaps not allowed) if @mode is “delete”. @sydb is encouraged to move on with this.