Hi Syd,
This is a question about interleave `&` that I raised last week during our meeting, but I don’t remember the answer. You wrote in the last comment on the ticket a tidy explanation of RNG interleave `&` as: 

 (Reminder: using the ‘&’ means that each particle is required (although if it has a ‘?’ or a ‘*’ it may occur only 0 times), but that order is not important.)”

And you also (a little earlier) point out that perhaps what’s needed for this ticket is something like: 
( msContents? & physDesc? & history? & additional? & msPart* & msFrag)
Here is my question:  Is interleave necessary to express this if order does not matter? Can you express the above even more flexibly with just a single grouping and or-pipes and one repetition indicator:

( msContents | physDesc | history | additional | msPart | msFrag)*
The reason not to do that may be the need for `?` constraints on most of the items, but I did want to check to see if it might work to process paired with Schematron as discussed for the Takeda strategy.  I guess I am asking, what does interleave deliver, and if an even more flexible content model is appropriate?

Cheers,
Elisa


Typeset by hand on my iPhone

On May 14, 2023, at 8:44 AM, Bauman, Syd <s.bauman@northeastern.edu> wrote:


We have not heard from Torsten Schaßan or anyone else from the MS-SIG on 2214. I am going to suggest that we take the following actions.
  • Politely decline his PR — that content model will not do what anyone wants.
  • Merge sydb_2214 in. Even if it is not exactly what the MS-SIG wants, it is a step in the right direction.
    • IF the MS-SIG wants <msPart> and <msFrag> to intermingle with the other four elements (<msContents>, <physDesc>, <history>, and <additional>) we should push back against the idea. I am not saying we should not do it under any circumstances, but I honestly believe we (the MS description workgroup back in 2005) designed that part of the content model because, as JC affirmed in Guelph, it makes sense that way; whereas I think we designed the part of the content model for those other four elements that way because it was easy on us.
  • Develop a written policy for application of the Takeda Strategy that says, essentially, at 2–4 particles we simply expand the desired structure in PureODD [see below for what that looks like but in RNC, not PureODD], but at 5+ particles we loosen the grammar-based content model (RELAX NG) and add further constraints with the rule-based schema (ISO Schematron).
  • Note: The above policy need not be applied to an <interleave> with only 1 particle, as that is exactly the same as that 1 particle without an <interleave>. 🙂
  • This, of course, is applicable during the time period before we get <tei:interleave> working. (I think, BTW, that if we want to do this right the Stylesheets should generate proper DTD code, if possible, no matter how many particles there are. But that can be discussed later on the ticket(s) for <tei:interleave>.)
Seems to me writing the PureODD for 1–3 is pretty easy, and we already have an example of doing so for 4, so copying & modifying it should not be hard. But 5 is essentially unmanageable, and I don’t even want to consider 6+. (Note, BTW, that speed is not a concern — jing validates against the 5-element version in < 0.1 s. I compared running 100 iterations of jing using the 4-element version and the 5-element version. The change in real time was 5.2 s to 6.5 s; the change in user time was 7.8 s to 8.8 s. That was using RNC, so each iteration had to convert the compact syntax to XML syntax first.) Here is what an interleaves of 2–5 elements looks like expanded to be usable by XML DTD language. (To see what 4 look like in PureODD see macro.msDescpart or the file I attached to a comment on the ticket.) Note that when just a list of references to elements with parens, commas, and or bars like these, DTD syntax and RELAX NG Compact Syntax are the same.

one
As mentioned above, an interleave of one item is just that item:
  <rng:interleave>
     <rng:ref name="one"/>
  </rng:interleave>
is the same as just
  ( one )

two
  <rng:interleave>
     <rng:ref name="one"/>
     <rng:ref name="two"/>
  </rng:interleave>
is the same as
 ( one & two )
is the same as
 ( ( one, two ) | ( two, one ) )
Four particles, 3 pair parens, and three connectors instead of two particles, 1 pair parens, and a connector

three
 ( one & two & three )
is the same as
 (
    ( one, ( ( two, three ) | ( three, two ) ) )
    |
    ( two, ( ( one, three ) | ( three, one ) ) )
    |
    ( three, ( ( one, two ) | ( two, one ) ) )
 )
15 particles, 13 pair parens, and 14 connectors instead of three particles, 1 pair parens, and 2 connectors

four
 ( one & two & three & four )
is the same as
   (
      (
         one,
         (  ( two, ( ( three, four ) | ( four, three ) ) )
          | ( three, ( ( two, four ) | ( four, two ) ) )
          | ( four, ( ( two, three ) | ( three, two ) ) ) )
      )
      |
      (
         two,
         (  ( one, ( ( three, four ) | ( four, three ) ) )
          | ( three, ( ( one, four ) | ( four, one ) ) )
          | ( four, ( ( one, three ) | ( three, one ) ) ) )
      )
      |
      (
         three,
         (  ( one, ( ( two, four ) | ( four, two ) ) )
          | ( two, ( ( one, four ) | ( four, one ) ) )
          | ( four, ( ( one, two ) | ( two, one ) ) ) )
      )
      |
      (
         four,
         (  ( one, ( ( two, three ) | ( three, two ) ) )
          | ( two, ( ( one, three ) | ( three, one ) ) )
          | ( three, ( ( one, two ) | ( two, one ) ) ) )
      )
   )
64 particles, 57 pair parens, and 63 connectors instead of 4 particles, 1 pair parens, and 3 connectors

five
( one & two & three & four & five )
is the same as
  (
      (
         one,
         (
           ( two, ( ( three, ( ( four, five ) | ( five, four ) ) ) | ( four, ( ( three, five ) | ( five, three ) ) ) | ( five, ( ( three, four ) | ( four, three ) ) ) ) )
           |
           ( three, ( ( two, ( ( four, five ) | ( five, four ) ) ) | ( four, ( ( two, five ) | ( five, two ) ) ) | ( five, ( ( two, four ) | ( four, two ) ) ) ) )
           |
           ( four, ( ( three, ( ( two, five ) | ( five, two ) ) ) | ( two, ( ( three, five ) | ( five, three ) ) ) | ( five, ( ( three, two ) | ( two, three ) ) ) ) )
           |
           ( five, ( ( three, ( ( four, two ) | ( two, four ) ) ) | ( four, ( ( three, two ) | ( two, three ) ) ) | ( two, ( ( three, four ) | ( four, three ) ) ) ) )
         )
      )
      |
      (
         two,
         (
           ( one, ( ( three, ( ( four, five ) | ( five, four ) ) ) | ( four, ( ( three, five ) | ( five, three ) ) ) | ( five, ( ( three, four ) | ( four, three ) ) ) ) )
           |
           ( three, ( ( one, ( ( four, five ) | ( five, four ) ) ) | ( four, ( ( one, five ) | ( five, one ) ) ) | ( five, ( ( one, four ) | ( four, one ) ) ) ) )
           |
           ( four, ( ( three, ( ( one, five ) | ( five, one ) ) ) | ( one, ( ( three, five ) | ( five, three ) ) ) | ( five, ( ( three, one ) | ( one, three ) ) ) ) )
           |
           ( five, ( ( three, ( ( four, one ) | ( one, four ) ) ) | ( four, ( ( three, one ) | ( one, three ) ) ) | ( one, ( ( three, four ) | ( four, three ) ) ) ) )
         )
      )
      |
      (
         three,
         (
           ( one, ( ( two, ( ( four, five ) | ( five, four ) ) ) | ( four, ( ( two, five ) | ( five, two ) ) ) | ( five, ( ( two, four ) | ( four, two ) ) ) ) )
           |
           ( two, ( ( one, ( ( four, five ) | ( five, four ) ) ) | ( four, ( ( one, five ) | ( five, one ) ) ) | ( five, ( ( one, four ) | ( four, one ) ) ) ) )
           |
           ( four, ( ( one, ( ( two, five ) | ( five, two ) ) ) | ( two, ( ( one, five ) | ( five, one ) ) ) | ( five, ( ( one, two ) | ( two, one ) ) ) ) )
           |
           ( five, ( ( one, ( ( four, two ) | ( two, four ) ) ) | ( four, ( ( one, two ) | ( two, one ) ) ) | ( two, ( ( one, four ) | ( four, one ) ) ) ) )
         )
      )
      |
      (
         four,
         (
           ( one, ( ( three, ( ( two, five ) | ( five, two ) ) ) | ( two, ( ( three, five ) | ( five, three ) ) ) | ( five, ( ( three, two ) | ( two, three ) ) ) ) )
           |
           ( two, ( ( three, ( ( one, five ) | ( five, one ) ) ) | ( one, ( ( three, five ) | ( five, three ) ) ) | ( five, ( ( three, one ) | ( one, three ) ) ) ) )
           |
           ( three, ( ( two, ( ( one, five ) | ( five, one ) ) ) | ( one, ( ( two, five ) | ( five, two ) ) ) | ( five, ( ( two, one ) | ( one, two ) ) ) ) )
           |
           ( five, ( ( three, ( ( one, two ) | ( two, one ) ) ) | ( one, ( ( three, two ) | ( two, three ) ) ) | ( two, ( ( three, one ) | ( one, three ) ) ) ) )
         )
      )
      |
      (
         five,
         (
           ( one, ( ( three, ( ( four, two ) | ( two, four ) ) ) | ( four, ( ( three, two ) | ( two, three ) ) ) | ( two, ( ( three, four ) | ( four, three ) ) ) ) )
           |
           ( two, ( ( three, ( ( four, one ) | ( one, four ) ) ) | ( four, ( ( three, one ) | ( one, three ) ) ) | ( one, ( ( three, four ) | ( four, three ) ) ) ) )
           |
           ( three, ( ( two, ( ( four, one ) | ( one, four ) ) ) | ( four, ( ( two, one ) | ( one, two ) ) ) | ( one, ( ( two, four ) | ( four, two ) ) ) ) )
           |
           ( four, ( ( three, ( ( two, one ) | ( one, two ) ) ) | ( two, ( ( three, one ) | ( one, three ) ) ) | ( one, ( ( three, two ) | ( two, three ) ) ) ) )
         )
      )
   )
325 particles, 291 pair parens, and 324 connectors instead of 5 particles, 1 pair parens, and 4 connectors.
_______________________________________________
Tei-council mailing list
Tei-council@lists.tei-c.org
http://lists.lists.tei-c.org/mailman/listinfo/tei-council