ODD: allowing <a:documentation> in <datatype>

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ODD: allowing <a:documentation> in <datatype>

Diehr, Franziska
Dear list-members,

I have a question concerning the schema specification with odd, more explicit the element <datatype>.
In my schema I want to define a list of fixed values for an attribute. But the list has also one item, that needs to be described with an regular expression. So far, no problem. My solution is to define a rng:list with rng:values and one rng:param element for the regular expression, like this:

<attDef ident="rend" mode="replace" usage="opt">
   <datatype>
       <rng:list>
             <rng:zeroOrMore>
                    <rng:choice>
              <rng:value>number</rng:value>
              <rng:data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
                                   <rng:param name="pattern">\d+</rng:param>
                           </rng:data>
         </rng:choice>
             </rng:zeroOrMore>
        </rng:list>
   </datatype>
</attDef>

But I also want to give a description for each value. I cannot use <desc> of the TEI-namespace. That is why I like to use <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">. But this is also not possible, because it is not exactly RNG but the Namespace of "RELAX NG DTD Compatibility". When using the "a" namespace under <datatype>, of course I get the error, that it cannot be used for it is not part of TEI and RNG namespace.
For the example given above, my invalid odd with <a:documentation> looks like this:

<rng:value>number</rng:value>
        <a:documentation>Some description.</a:documentation>
 <rng:data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
         <rng:param name="pattern">-idiom-graph-size:\d+</rng:param>
</rng:data>

Now comes the crucial point: When transforming my odd with Roma into RNG, the <a:documentation> elements are simply adopted and my RNG schema is valid! So my problem is, that I have an invalid odd, but a valid RNG-schema.

I would like to hear your opinions on allowing the TEI <datatype> element to accept elements from namespace "a" (for it is part of RNG Compatibility and compatibility is what I want also for TEI).
Or was there already a discussion on this topic or is there another solution? Am I missing something?

Thank you all for your help,
Franziska

--
Franziska Diehr
Gruppe Metadaten und Datenkonversion

Georg-August-Universität Göttingen
Niedersächsische Staats- und Universitätsbibliothek Göttingen
Platz der Göttinger Sieben 1
37073 Göttingen

Kontakt:
Papendiek 14 (Historisches Gebäude, Raum 1.206)
+49 551 39- 14070
[hidden email]
http://www.sub.uni-goettingen.de
Reply | Threaded
Open this post in threaded view
|

Re: ODD: allowing <a:documentation> in <datatype>

Lou Burnard-6
If you use (as you should) the new ODD features for documenting
datatypes, you can add tei:desc elements to most components, and these
components will then be transformed automatically to a:documentation
elements by the TEI ODD processing stylesheets. For example,  the
following ODD fragment

<elementSpec ident="p" mode="change">
                <attList>
                   <attDef ident="rend" mode="replace" usage="opt">
                      <desc>Zero or more instances of the FRANZISKA
datatype which can have one of a list of special values or any sequence of
                         digits</desc>
                      <datatype minOccurs="0" maxOccurs="unbounded">
                         <dataRef key="franziska"/>
                      </datatype>
                   </attDef>
                </attList>
             </elementSpec>

             <dataSpec ident="franziska">
                <desc>Franziska datatype </desc>
                <content>
                   <alternate>
                      <valList>
                         <valItem ident="number">
                            <desc>description of what "number" means</desc>
                         </valItem>
                         <valItem ident="thing">
                            <desc>description of what "thing" means</desc>
                         </valItem>
                      </valList>
                      <dataRef name="token">
                         <dataFacet name="pattern" value="-string\d+"/>
                      </dataRef>
                   </alternate>
                </content>
             </dataSpec>

will generate the following RelaxNG compact


     ## Zero or more instances of the FRANZISKA datatype which can have
one of a list of special values or any sequence of digits
     attribute rend {
       list {
         ((
           ## description of what "number" means
           "number"
           |
             ## description of what "thing" means
             "thing")
          | xsd:token { pattern = "-string\d+" })*
       }
     }?

Note that <dataRef> should be used to indicate a predefined TEI
datatype, or one you have defined yourself as above. It cannot itself
contain a <desc> though, which is maybe something to reconsider.


On 19/09/17 15:58, Diehr, Franziska wrote:

> Dear list-members,
>
> I have a question concerning the schema specification with odd, more explicit the element <datatype>.
> In my schema I want to define a list of fixed values for an attribute. But the list has also one item, that needs to be described with an regular expression. So far, no problem. My solution is to define a rng:list with rng:values and one rng:param element for the regular expression, like this:
>
> <attDef ident="rend" mode="replace" usage="opt">
>     <datatype>
>         <rng:list>
>               <rng:zeroOrMore>
>                      <rng:choice>
>                <rng:value>number</rng:value>
>                <rng:data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
>                                     <rng:param name="pattern">\d+</rng:param>
>                             </rng:data>
>           </rng:choice>
>               </rng:zeroOrMore>
>          </rng:list>
>     </datatype>
> </attDef>
>
> But I also want to give a description for each value. I cannot use <desc> of the TEI-namespace. That is why I like to use <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">. But this is also not possible, because it is not exactly RNG but the Namespace of "RELAX NG DTD Compatibility". When using the "a" namespace under <datatype>, of course I get the error, that it cannot be used for it is not part of TEI and RNG namespace.
> For the example given above, my invalid odd with <a:documentation> looks like this:
>
> <rng:value>number</rng:value>
>          <a:documentation>Some description.</a:documentation>
>   <rng:data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
>           <rng:param name="pattern">-idiom-graph-size:\d+</rng:param>
> </rng:data>
>
> Now comes the crucial point: When transforming my odd with Roma into RNG, the <a:documentation> elements are simply adopted and my RNG schema is valid! So my problem is, that I have an invalid odd, but a valid RNG-schema.
>
> I would like to hear your opinions on allowing the TEI <datatype> element to accept elements from namespace "a" (for it is part of RNG Compatibility and compatibility is what I want also for TEI).
> Or was there already a discussion on this topic or is there another solution? Am I missing something?
>
> Thank you all for your help,
> Franziska
>
> --
> Franziska Diehr
> Gruppe Metadaten und Datenkonversion
>
> Georg-August-Universität Göttingen
> Niedersächsische Staats- und Universitätsbibliothek Göttingen
> Platz der Göttinger Sieben 1
> 37073 Göttingen
>
> Kontakt:
> Papendiek 14 (Historisches Gebäude, Raum 1.206)
> +49 551 39- 14070
> [hidden email]
> http://www.sub.uni-goettingen.de
Reply | Threaded
Open this post in threaded view
|

AW: ODD: allowing <a:documentation> in <datatype>

Diehr, Franziska
Dear Lou,

thank you for your super-fast answer. This solves all my problems :) I applied it in my ODD and RNG Schema and everything works as it should.

Thank you very much!

Best wishes
Franziska

--
Franziska Diehr
Gruppe Metadaten und Datenkonversion

Georg-August-Universität Göttingen
Niedersächsische Staats- und Universitätsbibliothek Göttingen
Platz der Göttinger Sieben 1
37073 Göttingen

Kontakt:
Papendiek 14 (Historisches Gebäude, Raum 1.206)
+49 551 39- 14070
[hidden email]
http://www.sub.uni-goettingen.de


-----Ursprüngliche Nachricht-----
Von: Lou Burnard [mailto:[hidden email]]
Gesendet: Dienstag, 19. September 2017 18:58
An: Diehr, Franziska; [hidden email]
Betreff: Re: ODD: allowing <a:documentation> in <datatype>

If you use (as you should) the new ODD features for documenting datatypes, you can add tei:desc elements to most components, and these components will then be transformed automatically to a:documentation elements by the TEI ODD processing stylesheets. For example,  the following ODD fragment

<elementSpec ident="p" mode="change">
                <attList>
                   <attDef ident="rend" mode="replace" usage="opt">
                      <desc>Zero or more instances of the FRANZISKA datatype which can have one of a list of special values or any sequence of
                         digits</desc>
                      <datatype minOccurs="0" maxOccurs="unbounded">
                         <dataRef key="franziska"/>
                      </datatype>
                   </attDef>
                </attList>
             </elementSpec>

             <dataSpec ident="franziska">
                <desc>Franziska datatype </desc>
                <content>
                   <alternate>
                      <valList>
                         <valItem ident="number">
                            <desc>description of what "number" means</desc>
                         </valItem>
                         <valItem ident="thing">
                            <desc>description of what "thing" means</desc>
                         </valItem>
                      </valList>
                      <dataRef name="token">
                         <dataFacet name="pattern" value="-string\d+"/>
                      </dataRef>
                   </alternate>
                </content>
             </dataSpec>

will generate the following RelaxNG compact


     ## Zero or more instances of the FRANZISKA datatype which can have one of a list of special values or any sequence of digits
     attribute rend {
       list {
         ((
           ## description of what "number" means
           "number"
           |
             ## description of what "thing" means
             "thing")
          | xsd:token { pattern = "-string\d+" })*
       }
     }?

Note that <dataRef> should be used to indicate a predefined TEI datatype, or one you have defined yourself as above. It cannot itself contain a <desc> though, which is maybe something to reconsider.


On 19/09/17 15:58, Diehr, Franziska wrote:

> Dear list-members,
>
> I have a question concerning the schema specification with odd, more explicit the element <datatype>.
> In my schema I want to define a list of fixed values for an attribute. But the list has also one item, that needs to be described with an regular expression. So far, no problem. My solution is to define a rng:list with rng:values and one rng:param element for the regular expression, like this:
>
> <attDef ident="rend" mode="replace" usage="opt">
>     <datatype>
>         <rng:list>
>               <rng:zeroOrMore>
>                      <rng:choice>
>                <rng:value>number</rng:value>
>                <rng:data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
>                                     <rng:param name="pattern">\d+</rng:param>
>                             </rng:data>
>           </rng:choice>
>               </rng:zeroOrMore>
>          </rng:list>
>     </datatype>
> </attDef>
>
> But I also want to give a description for each value. I cannot use <desc> of the TEI-namespace. That is why I like to use <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">. But this is also not possible, because it is not exactly RNG but the Namespace of "RELAX NG DTD Compatibility". When using the "a" namespace under <datatype>, of course I get the error, that it cannot be used for it is not part of TEI and RNG namespace.
> For the example given above, my invalid odd with <a:documentation> looks like this:
>
> <rng:value>number</rng:value>
>          <a:documentation>Some description.</a:documentation>
>   <rng:data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
>           <rng:param name="pattern">-idiom-graph-size:\d+</rng:param>
> </rng:data>
>
> Now comes the crucial point: When transforming my odd with Roma into RNG, the <a:documentation> elements are simply adopted and my RNG schema is valid! So my problem is, that I have an invalid odd, but a valid RNG-schema.
>
> I would like to hear your opinions on allowing the TEI <datatype> element to accept elements from namespace "a" (for it is part of RNG Compatibility and compatibility is what I want also for TEI).
> Or was there already a discussion on this topic or is there another solution? Am I missing something?
>
> Thank you all for your help,
> Franziska
>
> --
> Franziska Diehr
> Gruppe Metadaten und Datenkonversion
>
> Georg-August-Universität Göttingen
> Niedersächsische Staats- und Universitätsbibliothek Göttingen Platz
> der Göttinger Sieben 1
> 37073 Göttingen
>
> Kontakt:
> Papendiek 14 (Historisches Gebäude, Raum 1.206)
> +49 551 39- 14070
> [hidden email]
> http://www.sub.uni-goettingen.de