Ignore:
Timestamp:
09/15/14 10:21:49 (10 years ago)
Author:
Menzo Windhouwer
Message:

Refactoring the toolkit to support CMDI 1.2

File:
1 moved

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/xsd/cmd-component.xsd

    r5617 r5628  
    1111
    1212    <!-- root element -->
    13     <xs:element name="CMD_ComponentSpec">
     13    <xs:element name="ComponentSpec">
     14        <xs:annotation>
     15            <xs:appinfo>
     16                <sch:pattern id="h_succ">
     17                    <sch:title>Check successor</sch:title>
     18                    <sch:rule context="Header/Successor">
     19                        <sch:assert test="../Status='deprecated'">There can only be a successor component/profile if the status of this component/profile is deprecated!</sch:assert>
     20                    </sch:rule>
     21                </sch:pattern>
     22                <sch:pattern id="r_card">
     23                    <sch:title>Cardinality root component</sch:title>
     24                    <sch:rule context="ComponentSpec/Component">
     25                        <sch:assert test="empty(@CardinalityMin) or @CardinalityMin='1'">The minimum cardinality of the root component should be 1!</sch:assert>
     26                        <sch:assert test="empty(@CardinalityMax) or @CardinalityMax='1'">The maximum cardinality of the root component should be 1!</sch:assert>
     27                    </sch:rule>
     28                </sch:pattern>
     29            </xs:appinfo>
     30        </xs:annotation>
    1431        <xs:complexType>
    1532            <xs:sequence>
     
    2037                            <xs:element name="Name" type="xs:string" minOccurs="0"/>
    2138                            <xs:element name="Description" type="xs:string" minOccurs="0"/>
     39                            <!-- status information -->
     40                            <xs:element name="Status" minOccurs="1" maxOccurs="1">
     41                                <xs:simpleType>
     42                                    <xs:restriction base="xs:string">
     43                                        <xs:enumeration value="development"/>
     44                                        <xs:enumeration value="production"/>
     45                                        <xs:enumeration value="deprecated"/>
     46                                    </xs:restriction>
     47                                </xs:simpleType>
     48                            </xs:element>
     49                            <xs:element name="StatusComment" type="xs:string" minOccurs="0" maxOccurs="1"/>
     50                            <xs:element name="Successor" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>
    2251                        </xs:sequence>
    2352                    </xs:complexType>
    2453                </xs:element>
    25                 <xs:element name="CMD_Component" type="CMD_Component_type">
     54                <xs:element name="Component" type="Component_type">
    2655                    <xs:annotation>
    2756                        <xs:documentation>At the root level there should always be a
     
    4069                <sch:pattern id="c_sibs">
    4170                    <sch:title>Check siblings</sch:title>
    42                     <sch:rule context="CMD_Component|CMD_Element">
     71                    <sch:rule context="Component|Element">
    4372                        <sch:assert test="empty(preceding-sibling::*[@name=current()/@name])">Sibling components or elements should all have a different name. Found multiple components or elements named '<sch:value-of select="@name"/>'!</sch:assert>
    4473                    </sch:rule>
     
    4675                <sch:pattern id="c_csibs">
    4776                    <sch:title>Check component siblings</sch:title>
    48                     <sch:rule context="CMD_Component">
    49                         <sch:assert test="empty(preceding-sibling::CMD_Component[@ComponentId=current()/@ComponentId])">Sibling components should all be different. Found multiple components with id '<sch:value-of select="@ComponentId"/>'!</sch:assert>
    50                     </sch:rule>
    51                 </sch:pattern>
    52                 <!-- TODO: the names of referenced external components are not known, so we can't currently check two or more of them use the same name -->
     77                    <sch:rule context="Component">
     78                        <sch:assert test="empty(preceding-sibling::Component[@ComponentId=current()/@ComponentId])">Sibling components should all be different. Found multiple components with id '<sch:value-of select="@ComponentId"/>'!</sch:assert>
     79                    </sch:rule>
     80                </sch:pattern>
     81                <!-- TODO: check: the names of referenced external components are not known, so we can't currently check if two or more of them use the same name -->
    5382                <sch:pattern id="c_nest">
    5483                    <sch:title>Check nesting</sch:title>
    55                     <sch:rule context="CMD_Component[exists(CMD_Component|CMD_Element)]" role="warning">
    56                         <sch:assert test="empty((CMD_Component|CMD_Element)[@name=current()/@name])">A nested component or element has the same name ('<sch:value-of select="@name"/>') as this component! Please, consider to rename one of them.</sch:assert>
    57                     </sch:rule>
    58                 </sch:pattern>
    59             </xs:appinfo>           
     84                    <sch:rule context="Component[exists(Component|Element)]" role="warning">
     85                        <sch:assert test="empty((Component|Element)[@name=current()/@name])">A nested component or element has the same name ('<sch:value-of select="@name"/>') as this component! Please, consider to rename one of them.</sch:assert>
     86                    </sch:rule>
     87                </sch:pattern>
     88            </xs:appinfo>
    6089        </xs:annotation>
    6190        <xs:sequence>
     91            <xs:element name="Documentation" type="Documentation_type" minOccurs="0" maxOccurs="unbounded"/>
    6292            <!-- from small (attribute) to big (component) -->
    6393            <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"/>
    64             <xs:element name="CMD_Element" type="CMD_Element_type" minOccurs="0"
     94            <xs:element name="Element" type="Element_type" minOccurs="0"
    6595                maxOccurs="unbounded"> </xs:element>
    66             <xs:element name="CMD_Component" type="CMD_Component_type" minOccurs="0"
     96            <xs:element name="Component" type="Component_type" minOccurs="0"
    6797                maxOccurs="unbounded"/>
    6898        </xs:sequence>
     
    70100
    71101    <!-- type definitions -->
    72     <xs:complexType name="CMD_Element_type">
     102    <xs:complexType name="Documentation_type">
     103        <xs:annotation>
     104            <xs:documentation>Some information an application (eg Arbil) can display to give
     105                guidance to the user when entering metadata.</xs:documentation>
     106            <xs:appinfo>
     107                <sch:pattern id="d_dsibs">
     108                    <sch:title>Check Documentation siblings</sch:title>
     109                    <sch:rule context="Documentation">
     110                        <sch:assert test="empty(preceding-sibling::Documentation[@xml:lang=current()/@xml:lang])">Sibling Documentation elements should all be for different languages. Found multiple Documentation elements with xml:lang '<sch:value-of select="@xml:lang"/>'!</sch:assert>
     111                    </sch:rule>
     112                </sch:pattern>
     113            </xs:appinfo>
     114        </xs:annotation>
     115        <xs:simpleContent>
     116            <xs:extension base="xs:string">
     117                <xs:attribute ref="xml:lang" use="optional"/>
     118            </xs:extension>
     119        </xs:simpleContent>
     120    </xs:complexType>
     121   
     122    <xs:complexType name="Element_type">
     123        <xs:annotation>
     124            <xs:appinfo>
     125                <sch:pattern id="e_vs">
     126                    <sch:title>Check Element ValueScheme</sch:title>
     127                    <sch:rule context="Element">
     128                        <sch:assert test="exists(@ValueScheme) or exists(ValueScheme)">An Element must have either a @ValueScheme or a ./ValueScheme!</sch:assert>
     129                    </sch:rule>
     130                </sch:pattern>
     131            </xs:appinfo>
     132        </xs:annotation>
    73133        <xs:sequence>
     134            <xs:element name="Documentation" type="Documentation_type" minOccurs="0" maxOccurs="unbounded"/>
    74135            <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1">
    75136                <xs:annotation>
     
    85146                </xs:annotation>
    86147            </xs:element>
     148            <xs:element name="AutoValue" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    87149        </xs:sequence>
    88         <xs:attributeGroup ref="clarin_element_attributes"/>
    89     </xs:complexType>
    90 
     150        <xs:attributeGroup ref="element_attributes"/>
     151    </xs:complexType>
    91152
    92153    <xs:complexType name="ValueScheme_type">
     154        <xs:annotation>
     155            <xs:appinfo>
     156                <sch:pattern id="v_uri">
     157                    <sch:title>Check Vocabulary URI</sch:title>
     158                    <sch:rule context="Vocabulary[exists(@URI)]">
     159                        <sch:assert test="exists(@ValueProperty)">When an external vocabulary (identified by the @URI) a @ValueProperty has to be specified!</sch:assert>
     160                    </sch:rule>
     161                </sch:pattern>
     162            </xs:appinfo>
     163        </xs:annotation>
    93164        <xs:choice>
    94165            <xs:element name="pattern" type="xs:string" maxOccurs="1">
     
    98169                </xs:annotation>
    99170            </xs:element>
    100             <xs:element name="enumeration" type="enumeration_type">
    101                 <xs:annotation>
    102                     <xs:documentation>A list of the allowed values of a controlled
    103                     vocabulary.</xs:documentation>
     171            <xs:element name="Vocabulary" type="Vocabulary_type">
     172                <xs:annotation>
     173                    <xs:documentation>Specification of an open or closed vocabulary</xs:documentation>
    104174                </xs:annotation>
    105175            </xs:element>
     
    107177    </xs:complexType>
    108178
     179    <xs:complexType name="Vocabulary_type">
     180        <xs:sequence>
     181            <xs:element name="enumeration" type="enumeration_type" minOccurs="0" maxOccurs="1">
     182                <xs:annotation>
     183                    <xs:documentation>A list of the allowed values of a controlled vocabulary.</xs:documentation>
     184                </xs:annotation>
     185            </xs:element>
     186        </xs:sequence>
     187        <xs:attribute name="URI" type="xs:anyURI"/>
     188        <!-- optionally selects a label -->
     189        <xs:attribute name="ValueProperty" type="xs:string"/>
     190        <!-- optionally selects a language -->
     191        <xs:attribute name="ValueLanguage" type="xs:language"/>
     192    </xs:complexType>
    109193
    110194    <xs:complexType name="AttributeList_type">
     195        <xs:annotation>
     196            <xs:appinfo>
     197                <sch:pattern id="a_vs">
     198                    <sch:title>Check Attribute ValueScheme</sch:title>
     199                    <sch:rule context="Attribute">
     200                        <sch:assert test="exists(@ValueScheme) or exists(ValueScheme)">An Attribute must have either a @ValueScheme or a ./ValueScheme!</sch:assert>
     201                    </sch:rule>
     202                </sch:pattern>
     203            </xs:appinfo>
     204        </xs:annotation>
    111205        <xs:sequence>
    112206            <xs:element name="Attribute" minOccurs="1" maxOccurs="unbounded">
     
    116210                            <sch:title>Check reserved attribute names</sch:title>
    117211                            <sch:rule context="Attribute">
    118                                 <sch:assert test="not(Name=('ref','ComponentId'))">Attribute name shouldn't be 'ref' or 'ComponentId', as these are used internally by CMD!</sch:assert>
     212                                <sch:assert test="not(@name=('ref','ComponentId'))">Attribute name shouldn't be 'ref' or 'ComponentId', as these are used internally by CMD!</sch:assert>
    119213                            </sch:rule>
    120214                        </sch:pattern>
     
    122216                            <sch:title>Check attribute siblings</sch:title>
    123217                            <sch:rule context="Attribute">
    124                                 <sch:assert test="empty(preceding-sibling::Attribute[Name=current()/Name])">All attributes in an attribute list should have a different name. Found multiple attributes named '<sch:value-of select="Name"/>'!</sch:assert>
     218                                <sch:assert test="empty(preceding-sibling::Attribute[@name=current()/@name])">All attributes in an attribute list should have a different name. Found multiple attributes named '<sch:value-of select="Name"/>'!</sch:assert>
    125219                            </sch:rule>
    126220                        </sch:pattern>
     
    128222                            <sch:title>Check attribute nesting</sch:title>
    129223                            <sch:rule context="Attribute" role="warning">
    130                                 <sch:assert test="empty((ancestor::CMD_Component|ancestor::CMD_Element)[1][@name=current()/Name])">An attribute has the same name ('<sch:value-of select="Name"/>') as its element or component! Please, consider to rename one of them.</sch:assert>
     224                                <sch:assert test="empty((ancestor::Component|ancestor::Element)[1][@name=current()/@ame])">An attribute has the same name ('<sch:value-of select="@name"/>') as its element or component! Please, consider to rename one of them.</sch:assert>
    131225                            </sch:rule>
    132226                        </sch:pattern>
    133                     </xs:appinfo>           
     227                    </xs:appinfo>
    134228                </xs:annotation>
    135229                <xs:complexType>
    136230                    <xs:sequence>
    137                         <xs:element name="Name" type="xs:string">
     231                        <xs:element name="Documentation" type="Documentation_type" minOccurs="0" maxOccurs="unbounded"/>
     232                        <xs:element name="ValueScheme" type="ValueScheme_type" minOccurs="0">
    138233                            <xs:annotation>
    139                                 <xs:documentation>The name of the attribute.</xs:documentation>
     234                                <xs:documentation>For the use of a regular expression or a
     235                                    controlled vocabulary as the type of the
     236                                    attribute.</xs:documentation>
    140237                            </xs:annotation>
    141238                        </xs:element>
    142                         <xs:element name="ConceptLink" type="xs:anyURI" minOccurs="0">
    143                             <xs:annotation>
    144                                 <xs:documentation>A link to the ISOcat data category registry (or any other concept registry).</xs:documentation>
    145                             </xs:annotation>
    146                         </xs:element>
    147                         <xs:choice>
    148                             <xs:element name="Type" type="allowed_attributetypes_type">
    149                                 <xs:annotation>
    150                                     <xs:documentation>For the use of simple XML types as the type of
    151                                         the attribute.</xs:documentation>
    152                                 </xs:annotation>
    153                             </xs:element>
    154                             <xs:element name="ValueScheme" type="ValueScheme_type">
    155                                 <xs:annotation>
    156                                     <xs:documentation>For the use of a regular expression or a
    157                                         controlled vocabulary as the type of the
    158                                     attribute.</xs:documentation>
    159                                 </xs:annotation>
    160                             </xs:element>
    161                         </xs:choice>
     239                        <xs:element name="AutoValue" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    162240                    </xs:sequence>
     241                    <xs:attributeGroup ref="attribute_attributes"/>
    163242                </xs:complexType>
    164243            </xs:element>
     
    166245    </xs:complexType>
    167246
    168     <xs:complexType name="CMD_Component_type">
     247    <xs:complexType name="Component_type">
    169248        <xs:group ref="group" minOccurs="0"/>
    170         <xs:attributeGroup ref="clarin_component_attributes"/>
    171     </xs:complexType>
    172 
    173 
    174     <!-- list of all attributes that can be bound to a cl_el -->
    175     <xs:attributeGroup name="clarin_element_attributes">
     249        <xs:attributeGroup ref="component_attributes"/>
     250    </xs:complexType>
     251
     252    <xs:attributeGroup name="attribute_attributes">
    176253        <xs:attribute name="name" type="xs:Name" use="required">
    177254            <xs:annotation>
    178                 <xs:documentation>The name of the element.</xs:documentation>
     255                <xs:documentation>The name of the attribute.</xs:documentation>
    179256            </xs:annotation>
    180257        </xs:attribute>
     
    187264        <xs:attribute name="ValueScheme" type="allowed_attributetypes_type">
    188265            <xs:annotation>
     266                <xs:documentation>For the use of simple XML types as the type of
     267                    the attribute.</xs:documentation>
     268            </xs:annotation>
     269        </xs:attribute>
     270        <xs:attribute name="Required" type="xs:boolean">
     271            <xs:annotation>
     272                <xs:documentation>Is the attribute required or not?</xs:documentation>
     273            </xs:annotation>
     274        </xs:attribute>
     275        <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/>
     276    </xs:attributeGroup>
     277   
     278    <xs:attributeGroup name="element_attributes">
     279        <xs:attribute name="name" type="xs:Name" use="required">
     280            <xs:annotation>
     281                <xs:documentation>The name of the element.</xs:documentation>
     282            </xs:annotation>
     283        </xs:attribute>
     284        <xs:attribute name="ConceptLink" type="xs:anyURI">
     285            <xs:annotation>
     286                <xs:documentation>A link to the ISOcat data category registry (or any other concept
     287                    registry).</xs:documentation>
     288            </xs:annotation>
     289        </xs:attribute>
     290        <xs:attribute name="ValueScheme" type="allowed_attributetypes_type">
     291            <xs:annotation>
    189292                <xs:documentation>Used to specify that an element has a simple XML type (string,
    190293                    integer, etc)</xs:documentation>
     
    199302            <xs:annotation>
    200303                <xs:documentation>Maximal number of occurrences.</xs:documentation>
    201             </xs:annotation>
    202         </xs:attribute>
    203         <xs:attribute name="Documentation" type="xs:string">
    204             <xs:annotation>
    205                 <xs:documentation>Some information an application (eg Arbil) can display to give
    206                     guidance to the user when entering metadata.</xs:documentation>
    207             </xs:annotation>
    208         </xs:attribute>
    209         <xs:attribute name="DisplayPriority" type="xs:integer">
    210             <xs:annotation>
    211                 <xs:documentation>The element with the highest priority will be displayed as the
    212                     label for a metadata file (eg in Arbil)</xs:documentation>
    213304            </xs:annotation>
    214305        </xs:attribute>
     
    221312            </xs:annotation>
    222313        </xs:attribute>
     314        <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/>
    223315    </xs:attributeGroup>
    224316
    225     <!-- list of all attributes that can be bound to a cl_comp -->
    226     <xs:attributeGroup name="clarin_component_attributes">
     317    <xs:attributeGroup name="component_attributes">
    227318        <xs:attribute name="name" type="xs:Name"/>
    228319        <xs:attribute name="ComponentId" type="xs:anyURI">
     
    238329            </xs:annotation>
    239330        </xs:attribute>
    240         <xs:attribute name="filename" type="xs:anyURI">
    241             <xs:annotation>
    242                 <xs:documentation>Outdated way of including an external component. Here for backward
    243                     compatibility with the XML-cmdi-toolkit.</xs:documentation>
    244             </xs:annotation>
    245         </xs:attribute>
    246 
    247         <!-- (components cannot have a ValueScheme attribute) -->
    248 
    249331        <xs:attribute name="CardinalityMin" type="cardinality_type"/>
    250332        <xs:attribute name="CardinalityMax" type="cardinality_type"/>
    251333        <xs:attribute ref="xml:base"/>
     334        <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/>
    252335    </xs:attributeGroup>
    253336
     
    381464                    </xs:annotation>
    382465                </xs:attribute>
     466                <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/>
    383467            </xs:extension>
    384468        </xs:simpleContent>
Note: See TracChangeset for help on using the changeset viewer.