W3C home > Mailing lists > Public > public-multilingualweb-lt@w3.org > June 2012

mlw-lt-track-ISSUE-30 (Maxime): yes and no, true and false ... [MLW-LT Standard Draft]

From: MultilingualWeb-LT Working Group Issue Tracker <sysbot+tracker@w3.org>
Date: Fri, 22 Jun 2012 16:38:16 +0000
Message-Id: <E1Si6sC-0004pp-0U@tibor.w3.org>
To: public-multilingualweb-lt@w3.org
mlw-lt-track-ISSUE-30 (Maxime): yes and no, true and false ... [MLW-LT Standard Draft]

http://www.w3.org/International/multilingualweb/lt/track/issues/30

Raised by: Maxime Lefran├žois
On product: MLW-LT Standard Draft

Hi all,

I'm writing the RDF equivalent vocabulary for ITS 2.0, I have a XSD feasibility question.

In ITS data categories, most attributes have 'yes' or 'no' as possible values. XSD defines xsd:boolean, but I guess you had reasons to chose yes or no instead... My feasibility question is not about switching to xsd:boolean.

I want to specify the range of my data categories properties, so I was looking in the http://www.w3.org/TR/its/its.xsd document, and the "yes or no" restriction of the xsd:token type is redefined for every attribute. 

for instance in term attribute:
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="yes">
            <xs:annotation>
              <xs:documentation>The value 'yes' means that this is a term.</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="no">
            <xs:annotation>
              <xs:documentation>The value 'no' means that this is not a term.</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>

I understand this enables editing tools to display specific documentation when needed. Would it be possible to keep the benefit of these documentation features while defining a new datatype, and thus having something like this:

      <xs:simpleType name="yesOrNo">
        <xs:restriction base="xs:token">
          <xs:enumeration value="yes" />
          <xs:enumeration value="no" />
        </xs:restriction>
      </xs:simpleType>

and then in term it would look nearly the same as before, except for the base that is "yesOrNo" :

      <xs:simpleType>
        <xs:restriction         base = "yesOrNo"  >
          <xs:enumeration value="yes">
            <xs:annotation>
              <xs:documentation>The value 'yes' means that this is a term.</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="no">
            <xs:annotation>
              <xs:documentation>The value 'no' means that this is not a term.</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>

So that I can use itsxsd:yesOrNo as the range of its:term for instance the RDF-based ITS 2.0 vocabulary.
If this method isn't correct or feasible (XSD experts will tell), is there any other method that would be a help ?

Kind regards,
Maxime Lefran├žois
Received on Friday, 22 June 2012 16:38:18 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 9 June 2013 00:24:56 UTC