EAFv2.7.xsd

Elan XML schema? - Jan Moringen, 12/22/2011 03:18 pm

Download (17.6 kB)

 
   1  <?xml version="1.0"?>
   2  <!--
   3  	VERSION 2.7
   4  	DATE December 2010
   5  	- new elements and attributes where added in relation to
   6  	  - support for externally defined controlled vocabularies. A new possible root element CV_RESOURCE 
   7  	    has been added for such vocabularies in an eaf like xml file. Annotations can hold a reference
   8  	    to the id of ean entry in an external CV.
   9  	- a new element for storing information about a lexicon and about a link to an entry or a field 
  10  	  in a lexicon has been added. A linguistic type can be associated with a lexicon or a field / 
  11  	  data category in a lexicon
  12  	
  13  	
  14  	VERSION 2.6
  15  	DATE May 2008
  16  	- added elements and attributes for references to concepts defined in the ISO Data Category Registry 
  17  	and possibly/eventually other external resources.
  18  	  - attribute EXT_REF added to type annotationAttribute, to elements CV_ENTRY and LINGUISTIC_TYPE
  19  	  - element EXTERNAL_REF with attributes EXT_REF_ID, TYPE and VALUE
  20  	
  21  	DATE November 2007
  22  	- added optional attributes: RELATIVE_MEDIA_URL to MEDIA_DESCRIPTOR and RELATIVE_LINK_URL to 
  23  	LINKED_FILE_DESCRIPTOR for storage of relative url's
  24  	- changed the FORMAT from fixed to default, and from 2.4. to 2.5
  25  	
  26  	DATE December 2006
  27  	- added attribute: ANNOTATOR to element TIER
  28  	- added element: PROPERTY to element HEADER
  29  	- changed the type of attribute SVG_REF of ALIGNABLE_ANNOTATION to xsd:string since 
  30  	it does not refer to an ID in the same file
  31  	- changed the type of the TIME_ALIGNABLE and GRAPHIC_REFERENCES attributes of the LINGUISTIC_TYPE
  32  	element to type="xsd:boolean" (was xsd:string)
  33  	- changed the ID/IDREF mechanism for the combinations of:
  34  	  - TIER/TIER_ID and TIER/PARENT_REF
  35  	  - LINGUISTIC_TYPE/LINGUISTIC_TYPE_ID and TIER/LINGUISTIC_TYPE_REF
  36  	  - CONTROLLED_VOCABULARY/CV_ID and LINGUISTIC_TYPE/CONTROLLED_VOCABULARY_REF
  37  	  into pairs of xsd:key and xsd:keyref elements.
  38  	  The advantage is that the ID's only have to be unique per element type (e.g. TIER_ID's
  39  	  should be unique within the TIER elements but can be the same as a LINGUISTIC_TYPE_ID) 
  40  	  and that there are no constraints on characters that can be used in id's/names.
  41  -->
  42  <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  43  	<xsd:annotation>
  44  		<xsd:documentation xml:lang="en">
  45  			Elan Annotation Format
  46  			version 2.7
  47  			December 2010
  48  			Schema by Alexander Klassmann 17/01/03
  49  			Adapted by Hennie Brugman, Han Sloetjes, Micha Hulsbosch
  50  		</xsd:documentation>
  51  	</xsd:annotation>
  52  	
  53  	<xsd:element name="ANNOTATION_DOCUMENT">
  54  		<xsd:complexType>
  55  			<xsd:sequence>
  56  				<xsd:element name="HEADER" type="headType"/>
  57  				<xsd:element name="TIME_ORDER" type="timeType"/>
  58  				<xsd:element name="TIER" type="tierType" minOccurs="0" maxOccurs="unbounded"/>
  59  				<xsd:element name="LINGUISTIC_TYPE" type="lingType" minOccurs="0" maxOccurs="unbounded"/>
  60  				<xsd:element name="LOCALE" type="localeType" minOccurs="0" maxOccurs="unbounded"/>
  61  				<xsd:element name="CONSTRAINT" type="constraintType" minOccurs="0" maxOccurs="unbounded"/>
  62  				<xsd:element name="CONTROLLED_VOCABULARY" type="convocType" minOccurs="0" maxOccurs="unbounded"/>
  63  				<xsd:element name="LEXICON_REF" type="lexRefType" minOccurs="0" maxOccurs="unbounded"/>
  64  				<xsd:element name="EXTERNAL_REF" type="extRefType" minOccurs="0" maxOccurs="unbounded"/>
  65  			</xsd:sequence>
  66  			<xsd:attribute name="DATE" type="xsd:dateTime" use="required"/>
  67  			<xsd:attribute name="AUTHOR" type="xsd:string" use="required"/>
  68  			<xsd:attribute name="VERSION" type="xsd:string" use="required"/>
  69  			<xsd:attribute name="FORMAT" type="xsd:string" use="optional" default="2.7"/>
  70  		</xsd:complexType>
  71  		
  72  		<!-- define key - keyref pairs -->
  73  		<xsd:key name="tierNameKey">
  74  			<xsd:annotation>
  75  				<xsd:documentation xml:lang="en">
  76  					The Tier name/id should be unique within the collection 
  77  					of Tier elements
  78  				</xsd:documentation>
  79  			</xsd:annotation>
  80  			<xsd:selector xpath="TIER"/>
  81  			<xsd:field xpath="@TIER_ID"/>
  82  		</xsd:key>
  83  		<xsd:keyref name="tierNameRef" refer="tierNameKey">
  84  			<xsd:annotation>
  85  				<xsd:documentation xml:lang="en">
  86  					A Tier can be associated with a parent Tier by referring to an existing Tier id.
  87  				</xsd:documentation>
  88  			</xsd:annotation>
  89  			<xsd:selector xpath="TIER"/>
  90  			<xsd:field xpath="@PARENT_REF"/>
  91  		</xsd:keyref>
  92  		
  93  		<xsd:key name="linTypeNameKey">
  94  			<xsd:annotation>
  95  				<xsd:documentation xml:lang="en">
  96  					The Linguistic Type name/id should be unique within the collection 
  97  					of Linguistic Type elements
  98  				</xsd:documentation>
  99  			</xsd:annotation>
 100  			<xsd:selector xpath="LINGUISTIC_TYPE"/>
 101  			<xsd:field xpath="@LINGUISTIC_TYPE_ID"/>
 102  		</xsd:key>
 103  		<xsd:keyref name="linTypeNameRef" refer="linTypeNameKey">
 104  			<xsd:annotation>
 105  				<xsd:documentation xml:lang="en">
 106  					A Tier must refer to an existing Linguistic Type id.
 107  				</xsd:documentation>
 108  			</xsd:annotation>
 109  			<xsd:selector xpath="TIER"/>
 110  			<xsd:field xpath="@LINGUISTIC_TYPE_REF"/>
 111  		</xsd:keyref>
 112  		
 113  		<xsd:key name="cvNameKey">
 114  			<xsd:annotation>
 115  				<xsd:documentation xml:lang="en">
 116  					The Controlled Vocabulary name/id should be unique within the  
 117  					collection of Controlled Vocabulary elements
 118  				</xsd:documentation>
 119  			</xsd:annotation>
 120  			<xsd:selector xpath="CONTROLLED_VOCABULARY"/>
 121  			<xsd:field xpath="@CV_ID"/>
 122  		</xsd:key>
 123  		<xsd:keyref name="cvNameRef" refer="cvNameKey">
 124  			<xsd:annotation>
 125  				<xsd:documentation xml:lang="en">
 126  					A Linguistic Type can be associated with a Controlled Vocabulary by 
 127  					referring to an existing Controlled Vocabulary id.
 128  				</xsd:documentation>
 129  			</xsd:annotation>
 130  			<xsd:selector xpath="LINGUISTIC_TYPE"/>
 131  			<xsd:field xpath="@CONTROLLED_VOCABULARY_REF"/>
 132  		</xsd:keyref>
 133  		<xsd:key name="lexNameKey">
 134  			<xsd:annotation>
 135  				<xsd:documentation xml:lang="en">
 136  					The Lexicon Service name/id should be unique within the  
 137  					collection of Lexicon Service elements
 138  				</xsd:documentation>
 139  			</xsd:annotation>
 140  			<xsd:selector xpath="LEXICON_REF"/>
 141  			<xsd:field xpath="@LEX_REF_ID"/>
 142  		</xsd:key>
 143  		<xsd:keyref name="lexNameRef" refer="lexNameKey">
 144  			<xsd:annotation>
 145  				<xsd:documentation xml:lang="en">
 146  					A Linguistic Type can be associated with a Lexicon Service by 
 147  					referring to an existing Lexicon Service id.
 148  				</xsd:documentation>
 149  			</xsd:annotation>
 150  			<xsd:selector xpath="LINGUISTIC_TYPE"/>
 151  			<xsd:field xpath="@LEXICON_REF"/>
 152  		</xsd:keyref>
 153  	</xsd:element>
 154  	
 155  	<xsd:complexType name="headType">
 156  		<xsd:sequence>
 157  			<xsd:element name="MEDIA_DESCRIPTOR" minOccurs="0" maxOccurs="unbounded">
 158  				<xsd:complexType>
 159  					<xsd:attribute name="MEDIA_URL" type="xsd:anyURI" use="required"/>
 160  					<xsd:attribute name="RELATIVE_MEDIA_URL" type="xsd:anyURI" use="optional"/>
 161  					<xsd:attribute name="MIME_TYPE" type="xsd:string" use="required"/>
 162  					<xsd:attribute name="TIME_ORIGIN" type="xsd:long" use="optional"/>
 163  					<xsd:attribute name="EXTRACTED_FROM" type="xsd:anyURI" use="optional"/>
 164  				</xsd:complexType>
 165  			</xsd:element>
 166  			<xsd:element name="LINKED_FILE_DESCRIPTOR" minOccurs="0" maxOccurs="unbounded">
 167  				<xsd:complexType>
 168  					<xsd:attribute name="LINK_URL" type="xsd:anyURI" use="required"/>
 169  					<xsd:attribute name="RELATIVE_LINK_URL" type="xsd:anyURI" use="optional"/>
 170  					<xsd:attribute name="MIME_TYPE" type="xsd:string" use="required"/>
 171  					<xsd:attribute name="TIME_ORIGIN" type="xsd:long" use="optional"/>
 172  					<xsd:attribute name="ASSOCIATED_WITH" type="xsd:anyURI" use="optional"/>
 173  				</xsd:complexType>
 174  			</xsd:element>
 175  		    <xsd:element name="PROPERTY" type="propType" minOccurs="0" maxOccurs="unbounded"/>
 176  		</xsd:sequence>
 177  		<xsd:attribute name="MEDIA_FILE" use="optional" type="xsd:string">
 178  			<xsd:annotation>
 179  				<xsd:documentation xml:lang="en">
 180  					This attribute is deprecated. Use MEDIA_DESCRIPTOR elements instead. 
 181  				</xsd:documentation>
 182  				<xsd:appinfo>Ignore</xsd:appinfo>
 183  			</xsd:annotation>
 184  		</xsd:attribute>
 185  		<xsd:attribute name="TIME_UNITS" use="optional" default="milliseconds">
 186  			<xsd:simpleType>
 187  				<xsd:restriction base="xsd:string">
 188  					<xsd:enumeration value="NTSC-frames"/>
 189  					<xsd:enumeration value="PAL-frames"/>
 190  					<xsd:enumeration value="milliseconds"/>
 191  				</xsd:restriction>
 192  			</xsd:simpleType>
 193  		</xsd:attribute>
 194  	</xsd:complexType>
 195  	
 196  	<xsd:complexType name="timeType">
 197  		<xsd:sequence>
 198  			<xsd:element name="TIME_SLOT" minOccurs="0" maxOccurs="unbounded">
 199  				<xsd:complexType>
 200  					<xsd:attribute name="TIME_SLOT_ID" type="xsd:ID" use="required"/>
 201  					<xsd:attribute name="TIME_VALUE" type="xsd:unsignedInt" use="optional"/>
 202  				</xsd:complexType>
 203  			</xsd:element>
 204  		</xsd:sequence>
 205  	</xsd:complexType>
 206  	
 207  	<xsd:complexType name="tierType">
 208  		<xsd:sequence>
 209  			<xsd:element name="ANNOTATION" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
 210  		</xsd:sequence>
 211  		<xsd:attribute name="TIER_ID" type="xsd:string" use="required"/>
 212  		<xsd:attribute name="PARTICIPANT" type="xsd:string" use="optional"/>
 213  		<xsd:attribute name="ANNOTATOR" type="xsd:string" use="optional"/>
 214  		<xsd:attribute name="LINGUISTIC_TYPE_REF" type="xsd:string" use="required"/>
 215  		<xsd:attribute name="DEFAULT_LOCALE" type="xsd:IDREF" use="optional"/>
 216  		<xsd:attribute name="PARENT_REF" type="xsd:string" use="optional"/>
 217  	</xsd:complexType>
 218  	
 219  	<xsd:complexType name="annotationType">
 220  		<xsd:choice>
 221  			<xsd:element name="ALIGNABLE_ANNOTATION" type="alignableType"/>
 222  			<xsd:element name="REF_ANNOTATION" type="refAnnoType"/>
 223  		</xsd:choice>
 224  	</xsd:complexType>
 225  	
 226  	<xsd:complexType name="alignableType">
 227  		<xsd:sequence>
 228  			<xsd:element name="ANNOTATION_VALUE" type="xsd:string"/>
 229  		</xsd:sequence>
 230  		<xsd:attributeGroup ref="annotationAttribute"/>
 231  		<xsd:attribute name="TIME_SLOT_REF1" type="xsd:IDREF" use="required"/>
 232  		<xsd:attribute name="TIME_SLOT_REF2" type="xsd:IDREF" use="required"/>
 233  		<xsd:attribute name="SVG_REF" type="xsd:string" use="optional"/>
 234  	</xsd:complexType>
 235  	
 236  	<xsd:complexType name="refAnnoType">
 237  		<xsd:sequence>
 238  			<xsd:element name="ANNOTATION_VALUE" type="xsd:string"/>
 239  		</xsd:sequence>
 240  		<xsd:attributeGroup ref="annotationAttribute"/>
 241  		<xsd:attribute name="ANNOTATION_REF" type="xsd:IDREF" use="required">
 242  			<xsd:annotation>
 243  				<xsd:documentation>
 244  					This is in fact a reference to the parent annotation.
 245  				</xsd:documentation>
 246  			</xsd:annotation>
 247  		</xsd:attribute>
 248  		<xsd:attribute name="PREVIOUS_ANNOTATION" type="xsd:IDREF" use="optional"/>
 249  	</xsd:complexType>
 250  	
 251  	<xsd:complexType name="lingType">
 252  		<xsd:attribute name="LINGUISTIC_TYPE_ID" type="xsd:string" use="required"/>
 253  		<xsd:attribute name="TIME_ALIGNABLE" type="xsd:boolean" use="optional"/>
 254  		<xsd:attribute name="CONSTRAINTS" type="xsd:IDREF" use="optional"/>
 255  		<xsd:attribute name="GRAPHIC_REFERENCES" type="xsd:boolean" use="optional"/>
 256  		<xsd:attribute name="CONTROLLED_VOCABULARY_REF" type="xsd:string" use="optional"/>
 257  		<xsd:attribute name="EXT_REF" type="xsd:IDREF" use="optional"/>
 258  		<xsd:attribute name="LEXICON_REF" type="xsd:IDREF" use="optional"/>
 259  	</xsd:complexType>
 260  	
 261  	<xsd:complexType name="localeType">
 262  		<xsd:attribute name="LANGUAGE_CODE" type="xsd:ID" use="required"/>
 263  		<xsd:attribute name="COUNTRY_CODE" type="xsd:string" use="optional"/>
 264  		<xsd:attribute name="VARIANT" type="xsd:string" use="optional"/>
 265  	</xsd:complexType>
 266  	
 267  	<xsd:complexType name="constraintType">
 268  		<xsd:attribute name="STEREOTYPE" type="xsd:ID" use="required"/>
 269  		<xsd:attribute name="DESCRIPTION" type="xsd:string" use="optional"/>
 270  	</xsd:complexType>
 271  	
 272  	<xsd:complexType name="convocType">
 273  		<xsd:sequence>
 274  			<xsd:element name="CV_ENTRY" type="cventryType" minOccurs="0" maxOccurs="unbounded"/>
 275  		</xsd:sequence>
 276  		<xsd:attribute name="CV_ID" type="xsd:string" use="required"/>
 277  		<xsd:attribute name="DESCRIPTION" type="xsd:string" use="optional"/>
 278  		<xsd:attribute name="EXT_REF" type="xsd:IDREF" use="optional">
 279  			<xsd:annotation>
 280  				<xsd:documentation>
 281  					A reference to an url of an external Controlled Vocabulary.
 282  					Is intended to be mutually exclusive with a sequence of CV_ENTRY elements. 
 283  				</xsd:documentation>
 284  			</xsd:annotation>
 285  		</xsd:attribute>
 286  	</xsd:complexType>
 287  	
 288  	<xsd:complexType name="cventryType">
 289  		<xsd:simpleContent>
 290  			<xsd:extension base="xsd:string">
 291  				<xsd:attribute name="DESCRIPTION" type="xsd:string" use="optional"/>
 292  				<xsd:attribute name="EXT_REF" type="xsd:IDREF" use="optional"/>
 293  			</xsd:extension>
 294  		</xsd:simpleContent>
 295  	</xsd:complexType>
 296  	
 297  	<xsd:complexType name="propType">
 298  		<xsd:simpleContent>
 299  			<xsd:extension base="xsd:string">
 300  				<xsd:attribute name="NAME" type="xsd:string" use="optional"/>
 301  			</xsd:extension>
 302  		</xsd:simpleContent>
 303  	</xsd:complexType>
 304  	
 305  	<xsd:complexType name="extRefType">
 306  		<xsd:attribute name="EXT_REF_ID" type="xsd:ID" use="required"/>
 307  		<xsd:attribute name="TYPE" use="required">
 308  			<xsd:simpleType>
 309  				<xsd:restriction base="xsd:string">
 310  					<xsd:enumeration value="iso12620">
 311  						<xsd:annotation>
 312  							<xsd:documentation>
 313  								A reference to the id of an ISO Data Category (url including id).
 314  							</xsd:documentation>
 315  						</xsd:annotation>
 316  					</xsd:enumeration>
 317  					<xsd:enumeration value="ecv">
 318  						<xsd:annotation>
 319  							<xsd:documentation>
 320  								A reference to an external (closed) Controlled Vocabulary (url).
 321  							</xsd:documentation>
 322  						</xsd:annotation>
 323  					</xsd:enumeration>
 324  					<xsd:enumeration value="cve_id">
 325  						<xsd:annotation>
 326  							<xsd:documentation>
 327  								A reference to the id of an Entry in an external Controlled Vocabulary (id).
 328  							</xsd:documentation>
 329  						</xsd:annotation>
 330  					</xsd:enumeration>
 331  					<xsd:enumeration value="lexen_id">
 332  						<xsd:annotation>
 333  							<xsd:documentation>
 334  								A reference to the id of an entry in a lexicon (url, url+id or id)
 335  							</xsd:documentation>
 336  						</xsd:annotation>
 337  					</xsd:enumeration>
 338  					<xsd:enumeration value="resource_url">
 339  						<xsd:annotation>
 340  							<xsd:documentation>
 341  								A reference or hyperlink to any type document (url)
 342  							</xsd:documentation>
 343  						</xsd:annotation>
 344  					</xsd:enumeration>
 345  					<!-- other external reference types can be added later -->
 346  				</xsd:restriction>
 347  			</xsd:simpleType>
 348  		</xsd:attribute>
 349  		<xsd:attribute name="VALUE" type="xsd:string" use="required"/>
 350  	</xsd:complexType>
 351  	
 352  	<xsd:complexType name="lexRefType">
 353  		<xsd:attribute name="LEX_REF_ID" type="xsd:ID" use="required"/>
 354  		<xsd:attribute name="NAME" type="xsd:string" use="required"/>
 355  		<xsd:attribute name="TYPE" type="xsd:string" use="required"/>
 356  		<xsd:attribute name="URL" type="xsd:string" use="required"/>
 357  		<xsd:attribute name="LEXICON_ID" type="xsd:string" use="required"/>
 358  		<xsd:attribute name="LEXICON_NAME" type="xsd:string" use="required"/>
 359  		<xsd:attribute name="DATCAT_ID" type="xsd:string" use="optional"/>
 360  		<xsd:attribute name="DATCAT_NAME" type="xsd:string" use="optional"/>
 361  	</xsd:complexType>
 362  	
 363  	<xsd:attributeGroup name="annotationAttribute">
 364  		<xsd:attribute name="ANNOTATION_ID" type="xsd:ID" use="required"/>
 365  		<xsd:attribute name="EXT_REF" type="xsd:IDREFS" use="optional"/>
 366  	</xsd:attributeGroup>
 367  	
 368  	<!-- Start of CV_RESOURCE part, an alternative root element -->
 369  	<xsd:element name="CV_RESOURCE">
 370  		<xsd:complexType>
 371  			<xsd:sequence>
 372  				<xsd:element name="CONTROLLED_VOCABULARY" type="ecvConvocType" minOccurs="1" maxOccurs="unbounded">
 373  					<xsd:key name="cvEntryKey">
 374  						<xsd:annotation>
 375  							<xsd:documentation xml:lang="en">
 376  								The entry id should be unique within the  
 377  								collection of entry elements
 378  							</xsd:documentation>
 379  						</xsd:annotation>
 380  						<xsd:selector xpath="CV_ENTRY"/>
 381  						<xsd:field xpath="@CVE_ID"/>
 382  					</xsd:key>
 383  				</xsd:element>
 384  				<xsd:element name="EXTERNAL_REF" type="extRefType" minOccurs="0" maxOccurs="unbounded"/>
 385  			</xsd:sequence>
 386  			<xsd:attribute name="DATE" type="xsd:dateTime" use="optional"/>
 387  			<xsd:attribute name="AUTHOR" type="xsd:string" use="optional"/>
 388  			<xsd:attribute name="VERSION" type="xsd:string" use="optional"/>
 389  		</xsd:complexType>
 390  		<!-- define key - keyref pairs -->
 391  				<!-- If not commented this is considered a double global definition of cvNameKey -->
 392  <!--			<xsd:key name="cvNameKey">
 393  				<xsd:annotation>
 394  					<xsd:documentation xml:lang="en">
 395  						The Controlled Vocabulary name/id should be unique within the  
 396  						collection of Controlled Vocabulary elements
 397  					</xsd:documentation>
 398  				</xsd:annotation>
 399  				<xsd:selector xpath="CONTROLLED_VOCABULARY"/>
 400  				<xsd:field xpath="@CV_ID"/>
 401  			</xsd:key>-->
 402  	</xsd:element>
 403  	<!-- Did not use extension here because it contains an other type of CVEntry elements -->
 404  	<xsd:complexType name="ecvConvocType">
 405  		<xsd:sequence>
 406  			<xsd:element name="CV_ENTRY" type="ecvEntryType" minOccurs="0" maxOccurs="unbounded"/>
 407  		</xsd:sequence>
 408  		<xsd:attribute name="CV_ID" type="xsd:string" use="required"/>
 409  		<xsd:attribute name="DESCRIPTION" type="xsd:string" use="optional"/>
 410  		<xsd:attribute name="EXT_REF" type="xsd:IDREF" use="optional">
 411  			<xsd:annotation>
 412  				<xsd:documentation>
 413  					A reference to an url of an external Controlled Vocabulary.
 414  					Is intended to be mutually exclusive with a sequence of CV_ENTRY elements. 
 415  				</xsd:documentation>
 416  			</xsd:annotation>
 417  		</xsd:attribute>
 418  	</xsd:complexType>
 419  	
 420  	<xsd:complexType name="ecvEntryType">
 421  		<xsd:complexContent>
 422  			<xsd:extension base="cventryType">
 423  				<xsd:attribute name="CVE_ID" type="xsd:string" use="required">
 424  					<xsd:annotation>
 425  						<xsd:documentation>
 426  							The id of the entry (intended for externally defined entries).
 427  						</xsd:documentation>
 428  					</xsd:annotation>
 429  				</xsd:attribute>
 430  			</xsd:extension>
 431  		</xsd:complexContent>
 432  	</xsd:complexType>
 433  	
 434  </xsd:schema>