| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
| 3 |
xmlns="http://www.ivoa.net/xml/VODML/v1" |
| 4 |
targetNamespace="http://www.ivoa.net/xml/VODML/v1" |
| 5 |
attributeFormDefault="unqualified" elementFormDefault="unqualified" |
| 6 |
version="1.0"> |
| 7 |
<!-- Change log: |
| 8 |
2017-09-23: |
| 9 |
- added version attribute in schema |
| 10 |
- removed minor version from targetNamespace and default xmlns declaration |
| 11 |
|
| 12 |
--> |
| 13 |
<xsd:annotation> |
| 14 |
<xsd:documentation> |
| 15 |
|
| 16 |
This schema defines the "vo-dml meta model", a modeling language used to define the concepts |
| 17 |
and structures that describe data models. It is proposed as the common language for |
| 18 |
defining data models in the IVOA. |
| 19 |
TBD continue based on VO-DML specification document. |
| 20 |
</xsd:documentation> |
| 21 |
<xsd:documentation> |
| 22 |
Look at SVN versions 2129 and earlier for more extensive model. |
| 23 |
</xsd:documentation> |
| 24 |
</xsd:annotation> |
| 25 |
|
| 26 |
<!-- +++++++++++++++++++ Begin of 'Identifier section' +++++++++++++++++++ --> |
| 27 |
<xsd:simpleType name="VODMLID" > |
| 28 |
<xsd:annotation> |
| 29 |
<xsd:documentation> |
| 30 |
Type representing the way referable elements are identified uniquely in VO-DML. |
| 31 |
</xsd:documentation> |
| 32 |
</xsd:annotation> |
| 33 |
<xsd:restriction base="xsd:string"> |
| 34 |
<xsd:annotation> |
| 35 |
<xsd:documentation> |
| 36 |
A restriction on the valid strings that make this a VO-DML Identifier. |
| 37 |
Requirements on the format are: 1) use in XML document 2) use as fragment in URI |
| 38 |
</xsd:documentation> |
| 39 |
</xsd:annotation> |
| 40 |
<xsd:pattern value="[a-zA-Z][a-zA-Z0-9\._]*"/> |
| 41 |
</xsd:restriction> |
| 42 |
</xsd:simpleType> |
| 43 |
|
| 44 |
<xsd:simpleType name="ModelName"> |
| 45 |
<xsd:annotation> |
| 46 |
<xsd:documentation> |
| 47 |
Type used to restrict valid values for prefixes. |
| 48 |
TBD We could use an xsd:NCName for this. |
| 49 |
</xsd:documentation> |
| 50 |
</xsd:annotation> |
| 51 |
<xsd:restriction base="xsd:string"> <!-- xsd:NCName ? --> |
| 52 |
<xsd:pattern value="[a-zA-Z][a-zA-Z0-9_\-]*"> |
| 53 |
<xsd:annotation> |
| 54 |
<xsd:documentation> |
| 55 |
A model name MUST NOT contain a semicolon. |
| 56 |
</xsd:documentation> |
| 57 |
</xsd:annotation> |
| 58 |
</xsd:pattern> |
| 59 |
</xsd:restriction> |
| 60 |
</xsd:simpleType> |
| 61 |
|
| 62 |
<xsd:simpleType name="VODMLREF"> |
| 63 |
<xsd:annotation> |
| 64 |
<xsd:documentation> |
| 65 |
Class representing the way ReferencableElements can be referenced in VO-DML. |
| 66 |
It must be possible to refer to elements in other, imported data models as well as in the current model. |
| 67 |
Hence the VODMLREF must identify both model and element. |
| 68 |
The element is identified by the VO-DML ID in the model, the model is identified using a |
| 69 |
prefix that MUST correspond to the vodml-id element of the current or an imported model. |
| 70 |
Note, references to element sin the current model MUST also have a prefix, there is no default model! |
| 71 |
TBD We could use an xsd:QName where VODMLREF is used, but that may have somewhat more sever syntax constraints than desired. |
| 72 |
</xsd:documentation> |
| 73 |
</xsd:annotation> |
| 74 |
<xsd:restriction base="xsd:string"> <!-- xsd:QName ? --> |
| 75 |
<xsd:annotation> |
| 76 |
<xsd:documentation> |
| 77 |
A restriction on the valid strings that make this a valid reference to a referenceable element. |
| 78 |
Consists of a prefix that should follow the ModelPrefix restriction |
| 79 |
and a identifier that should follow the VODMLID restriction, |
| 80 |
separated from each other by a colon. |
| 81 |
</xsd:documentation> |
| 82 |
<xsd:documentation> |
| 83 |
TODO define the restriction pattern properly. |
| 84 |
MUST be [Prefix ':' VODMLID]. |
| 85 |
</xsd:documentation> |
| 86 |
</xsd:annotation> |
| 87 |
<xsd:pattern value="[a-zA-Z][a-zA-Z0-9\._\-]+:[a-zA-Z][a-zA-Z0-9\._]*"/> |
| 88 |
</xsd:restriction> |
| 89 |
</xsd:simpleType> |
| 90 |
|
| 91 |
<xsd:simpleType name="VODMLName"> |
| 92 |
<xsd:annotation> |
| 93 |
<xsd:documentation> |
| 94 |
Type used to restrict valid values for prefixes. |
| 95 |
TBD We could use an xsd:NCName for this. |
| 96 |
</xsd:documentation> |
| 97 |
</xsd:annotation> |
| 98 |
<xsd:restriction base="xsd:string"> <!-- xsd:NCName ? --> |
| 99 |
<xsd:pattern value="[a-zA-Z_][a-zA-Z0-9_]*"> |
| 100 |
<xsd:annotation> |
| 101 |
<xsd:documentation> |
| 102 |
A model name MUST NOT contain a semicolon. |
| 103 |
</xsd:documentation> |
| 104 |
</xsd:annotation> |
| 105 |
</xsd:pattern> |
| 106 |
</xsd:restriction> |
| 107 |
</xsd:simpleType> |
| 108 |
|
| 109 |
|
| 110 |
<xsd:complexType name="ReferableElement" abstract="true"> |
| 111 |
<xsd:annotation> |
| 112 |
<xsd:documentation> |
| 113 |
This is the base type for all types whose elements can be explicitly referenced. |
| 114 |
To this end it has a 'vodml-id' element of type VODMLID that allows explicit and unique identification of |
| 115 |
these elements within the context of the model. |
| 116 |
Generally these are also elements that can be |
| 117 |
represented explicitly in alternative serialisations of |
| 118 |
a data model, such as a VOTable or a relational model. |
| 119 |
These should use the value of the utype element to "point into a data model" and identify a |
| 120 |
model element. VO-DML itself also has needs of pointing to other elements, sometimes in another model. |
| 121 |
The VODMLREF type is used for such references, which will always be named 'vodml-ref'. |
| 122 |
</xsd:documentation> |
| 123 |
</xsd:annotation> |
| 124 |
<xsd:sequence> |
| 125 |
<xsd:element name="vodml-id" type="VODMLID" minOccurs="1"> |
| 126 |
<xsd:annotation> |
| 127 |
<xsd:documentation> |
| 128 |
Identifier for its containing element. |
| 129 |
Extracted as a separate type so that we can easily adapt to a different identifier design. |
| 130 |
</xsd:documentation> |
| 131 |
</xsd:annotation> |
| 132 |
</xsd:element> |
| 133 |
<xsd:element name="name" type="VODMLName" minOccurs="1" > |
| 134 |
<xsd:annotation> |
| 135 |
<xsd:documentation> |
| 136 |
The name of the model element. |
| 137 |
MUST NOT be an empty string. |
| 138 |
</xsd:documentation> |
| 139 |
</xsd:annotation> |
| 140 |
</xsd:element> |
| 141 |
<xsd:element name="description" type="xsd:string" minOccurs="0"> |
| 142 |
<xsd:annotation> |
| 143 |
<xsd:documentation> |
| 144 |
Human readable description of the model element. |
| 145 |
</xsd:documentation> |
| 146 |
</xsd:annotation> |
| 147 |
</xsd:element> |
| 148 |
</xsd:sequence> |
| 149 |
|
| 150 |
<xsd:attribute name="id" type="xsd:string" use="optional"> |
| 151 |
<xsd:annotation> |
| 152 |
<xsd:documentation> |
| 153 |
A referenceable element may be given an @id attribute to reflect an identifier |
| 154 |
defined in some source document form which a VO-DML model may have been derived. |
| 155 |
</xsd:documentation> |
| 156 |
</xsd:annotation> |
| 157 |
</xsd:attribute> |
| 158 |
</xsd:complexType> |
| 159 |
|
| 160 |
|
| 161 |
<xsd:complexType name="ElementRef"> |
| 162 |
<xsd:annotation> |
| 163 |
<xsd:documentation> |
| 164 |
This type represents how to reference a ReferencableElement. |
| 165 |
It can serve as base class to those types that explicitly reference another type, such as relations and roles. |
| 166 |
It provides for a uniform way to represent the reference to |
| 167 |
the target element using the 'utyperef' element. |
| 168 |
An important design choice is that we wish to allow references to elements in remote models. |
| 169 |
For that reasons we can not use an ID/IDREF or key/keyref pattern. |
| 170 |
Instead we define various constraints on |
| 171 |
this type and its usage in various contexts using |
| 172 |
the Schematron file in vo-dml.sch.xml. |
| 173 |
</xsd:documentation> |
| 174 |
</xsd:annotation> |
| 175 |
<xsd:sequence> |
| 176 |
<xsd:element name="vodml-ref" type="VODMLREF"> |
| 177 |
<xsd:annotation> |
| 178 |
<xsd:documentation> |
| 179 |
The element identifying the referenced target element. |
| 180 |
See the documentation for the VODMLREF type. |
| 181 |
</xsd:documentation> |
| 182 |
</xsd:annotation> |
| 183 |
</xsd:element> |
| 184 |
</xsd:sequence> |
| 185 |
</xsd:complexType> |
| 186 |
|
| 187 |
|
| 188 |
<!-- +++++++++++++++++++ End of 'ReferencableElement section' +++++++++++++++++++ --> |
| 189 |
|
| 190 |
<!-- +++++++++++++++++++ Begin of Model elements section +++++++++++++++++++ --> |
| 191 |
<xsd:complexType name="Model"> |
| 192 |
<xsd:annotation> |
| 193 |
<xsd:documentation> |
| 194 |
Represents a complete data model and is the type of the (single) declared root element for |
| 195 |
VO-DML/XML representation documents. |
| 196 |
</xsd:documentation> |
| 197 |
</xsd:annotation> |
| 198 |
<xsd:sequence> |
| 199 |
<xsd:element name="name" type="ModelName" minOccurs="1" maxOccurs="1"> |
| 200 |
<xsd:annotation> |
| 201 |
<xsd:documentation> |
| 202 |
Short name of the model. |
| 203 |
NOTE this name MUST be used as prefix in any utype reference to elements in this model. |
| 204 |
</xsd:documentation> |
| 205 |
</xsd:annotation> |
| 206 |
</xsd:element> |
| 207 |
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"> |
| 208 |
<xsd:annotation> |
| 209 |
<xsd:documentation> |
| 210 |
The description of the model. |
| 211 |
</xsd:documentation> |
| 212 |
</xsd:annotation> |
| 213 |
</xsd:element> |
| 214 |
<xsd:element name="identifier" type="xsd:string" minOccurs="0" maxOccurs="1"> |
| 215 |
<xsd:annotation> |
| 216 |
<xsd:documentation> |
| 217 |
A string holding the identifier by which the model is registered in an |
| 218 |
IVOA compatible registry. Its structure must therefore conform to the IVOA Identifier |
| 219 |
specification in http://www.ivoa.net/documents/IVOAIdentifiers/. |
| 220 |
If the model is an IVOA standard, the naming authority for the identifier should be the |
| 221 |
IVOA DM working group. |
| 222 |
|
| 223 |
</xsd:documentation> |
| 224 |
</xsd:annotation> |
| 225 |
</xsd:element> |
| 226 |
<xsd:element name="uri" type="xsd:anyURI" minOccurs="1" maxOccurs="1"> |
| 227 |
<xsd:annotation> |
| 228 |
<xsd:documentation> |
| 229 |
Each model has an associated model URI that MUST be used to reference it, for example in ModelImports |
| 230 |
or in VOTable annotations. |
| 231 |
Dereferencing the model URI and following redirects yields the latest VO-DML for the data model |
| 232 |
</xsd:documentation> |
| 233 |
</xsd:annotation> |
| 234 |
</xsd:element> |
| 235 |
<xsd:element name="title" type="xsd:string" minOccurs="1" maxOccurs="1"> |
| 236 |
<xsd:annotation> |
| 237 |
<xsd:documentation> |
| 238 |
The title of the model by which it is officially known. |
| 239 |
</xsd:documentation> |
| 240 |
</xsd:annotation> |
| 241 |
</xsd:element> |
| 242 |
<xsd:element name="author" type="xsd:string" minOccurs="0" maxOccurs="unbounded"> |
| 243 |
<xsd:annotation> |
| 244 |
<xsd:documentation> |
| 245 |
List of authors of the model, only defined by name so far. |
| 246 |
TBD could be expanded with email, affiliation and so on. |
| 247 |
</xsd:documentation> |
| 248 |
</xsd:annotation> |
| 249 |
</xsd:element> |
| 250 |
<xsd:element name="version" type="xsd:string" minOccurs="1"> |
| 251 |
<xsd:annotation> |
| 252 |
<xsd:documentation> |
| 253 |
Label giving the version of the model. |
| 254 |
</xsd:documentation> |
| 255 |
</xsd:annotation> |
| 256 |
</xsd:element> |
| 257 |
<xsd:element name="previousVersion" type="xsd:anyURI" minOccurs="0"> |
| 258 |
<xsd:annotation> |
| 259 |
<xsd:documentation> |
| 260 |
URI identifying a VO-DML model that is the version from which the current version of model is derived. |
| 261 |
TBD could be an IVO Identifier once models get properly registered? |
| 262 |
</xsd:documentation> |
| 263 |
</xsd:annotation> |
| 264 |
</xsd:element> |
| 265 |
<xsd:element name="lastModified" type="xsd:dateTime"> |
| 266 |
<xsd:annotation> |
| 267 |
<xsd:documentation> |
| 268 |
Timestamp when the last change to the current model was made. |
| 269 |
</xsd:documentation> |
| 270 |
</xsd:annotation> |
| 271 |
</xsd:element> |
| 272 |
<xsd:element name="import" type="ModelImport" minOccurs="0" maxOccurs="unbounded"> |
| 273 |
<xsd:annotation> |
| 274 |
<xsd:documentation> |
| 275 |
An 'import' element indicates a dependency on an external, predefined VO-DML data model. |
| 276 |
Types from that model may be used for referencing, extension and assignment to |
| 277 |
attributes. |
| 278 |
Types from the external model MUST NOT be used for |
| 279 |
composition relationships. |
| 280 |
'identification' relations to elements from that model may be used to indicate some kind of |
| 281 |
equivalence between |
| 282 |
elements in the current model and the external elements. |
| 283 |
</xsd:documentation> |
| 284 |
<xsd:documentation> |
| 285 |
TBD We might require that every data model MUST include a version of the IVOA data model |
| 286 |
to gain access to the standard |
| 287 |
primitive types and some other types. |
| 288 |
We may require that that standard model should be included *completely*, |
| 289 |
i.e. including all its type definitions explicitly. |
| 290 |
This would be similar to treating it as a UML Profile, rather than an import. |
| 291 |
This would mean that the most common type assignments for attributes |
| 292 |
can be checked within the model and not require |
| 293 |
importing the remote model during validation. |
| 294 |
</xsd:documentation> |
| 295 |
</xsd:annotation> |
| 296 |
</xsd:element> |
| 297 |
<xsd:element name="primitiveType" type="PrimitiveType" minOccurs="0" maxOccurs="unbounded"> |
| 298 |
<xsd:annotation> |
| 299 |
<xsd:documentation> |
| 300 |
Collection of PrimitiveType definitions directly under the model, i.e. not contained in a |
| 301 |
Package. |
| 302 |
</xsd:documentation> |
| 303 |
</xsd:annotation> |
| 304 |
</xsd:element> |
| 305 |
<xsd:element name="enumeration" type="Enumeration" minOccurs="0" maxOccurs="unbounded"> |
| 306 |
<xsd:annotation> |
| 307 |
<xsd:documentation> |
| 308 |
Collection of Enumeration definitions directly under the model, i.e. not contained in a Package. |
| 309 |
</xsd:documentation> |
| 310 |
</xsd:annotation> |
| 311 |
</xsd:element> |
| 312 |
<xsd:element name="dataType" type="DataType" minOccurs="0" maxOccurs="unbounded"> |
| 313 |
<xsd:annotation> |
| 314 |
<xsd:documentation> |
| 315 |
Collection of DataType definitions directly under the model, i.e. not contained in a Package. |
| 316 |
</xsd:documentation> |
| 317 |
</xsd:annotation> |
| 318 |
</xsd:element> |
| 319 |
<xsd:element name="objectType" type="ObjectType" minOccurs="0" maxOccurs="unbounded"> |
| 320 |
<xsd:annotation> |
| 321 |
<xsd:documentation> |
| 322 |
Collection of ObjectType definitions directly under the model, i.e. not contained in a Package. |
| 323 |
</xsd:documentation> |
| 324 |
</xsd:annotation> |
| 325 |
</xsd:element> |
| 326 |
<xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"> |
| 327 |
<xsd:annotation> |
| 328 |
<xsd:documentation> |
| 329 |
The collection of packages which can contain further detailed name spacing to |
| 330 |
the type definitions in the model. |
| 331 |
</xsd:documentation> |
| 332 |
</xsd:annotation> |
| 333 |
</xsd:element> |
| 334 |
</xsd:sequence> |
| 335 |
</xsd:complexType> |
| 336 |
|
| 337 |
|
| 338 |
<xsd:complexType name="ModelImport"> |
| 339 |
<xsd:annotation> |
| 340 |
<xsd:documentation> |
| 341 |
A "proxy" for an external model that is being used by the current model. |
| 342 |
Defines the url where the VO-DML representation of that model can be retrieved, and |
| 343 |
replicates its name that MUST be used when making references to |
| 344 |
elements in that model using a VODMLREF element. |
| 345 |
</xsd:documentation> |
| 346 |
</xsd:annotation> |
| 347 |
<xsd:sequence> |
| 348 |
<xsd:element name="name" type="ModelName" minOccurs="1"> |
| 349 |
<xsd:annotation> |
| 350 |
<xsd:documentation> |
| 351 |
Name by which imported model is used in the current model and its documentation. |
| 352 |
This name MUST be the same as the 'name' of the model definition in that remote document. |
| 353 |
For all utypes pointing to elements in the imported model MUST use this name as prefix. |
| 354 |
</xsd:documentation> |
| 355 |
</xsd:annotation> |
| 356 |
</xsd:element> |
| 357 |
<xsd:element name="identifier" type="xsd:string" minOccurs="0" maxOccurs="1"> |
| 358 |
<xsd:annotation> |
| 359 |
<xsd:documentation> |
| 360 |
A string holding the identifier by which the imported model is registered in an |
| 361 |
IVOA compatible registry. Must be the same value as the 'identifier' of the imported model. |
| 362 |
</xsd:documentation> |
| 363 |
</xsd:annotation> |
| 364 |
</xsd:element> |
| 365 |
<xsd:element name="version" type="xsd:string" minOccurs="0"> |
| 366 |
<xsd:annotation> |
| 367 |
<xsd:documentation> |
| 368 |
Version of the imported model. |
| 369 |
</xsd:documentation> |
| 370 |
</xsd:annotation> |
| 371 |
</xsd:element> |
| 372 |
<xsd:element name="url" type="xsd:anyURI" minOccurs="1"> |
| 373 |
<xsd:annotation> |
| 374 |
<xsd:documentation> |
| 375 |
URL from which the VO-DML model document can be downloaded. |
| 376 |
Note, could likely be done through a registry once ivoId is known. |
| 377 |
TBD SHOULD this be a generic URI, or can we insits on URL? |
| 378 |
</xsd:documentation> |
| 379 |
</xsd:annotation> |
| 380 |
</xsd:element> |
| 381 |
<xsd:element name="documentationURL" type="xsd:anyURI" minOccurs="1"> |
| 382 |
<xsd:annotation> |
| 383 |
<xsd:documentation> |
| 384 |
URL where a documentation HTML file for the remote model can be downloaded. |
| 385 |
This SHOULD be a document that contains anchors for each element that has as name attribute the vodml-id of that element. |
| 386 |
I.e. it is assumed that the |
| 387 |
vodml-id-s of the imported types can be added onto this documentationURL |
| 388 |
(should end with a #?) so that a direct link to the documentation for a referenced data model element can be found. |
| 389 |
</xsd:documentation> |
| 390 |
</xsd:annotation> |
| 391 |
</xsd:element> |
| 392 |
</xsd:sequence> |
| 393 |
</xsd:complexType> |
| 394 |
|
| 395 |
|
| 396 |
<xsd:complexType name="Package"> |
| 397 |
<xsd:annotation> |
| 398 |
<xsd:documentation> |
| 399 |
A Package is a container for type definitions and possible (child-)packages. |
| 400 |
Names of types only need to be unique within their container (model or package), |
| 401 |
hence a package provides further name-spacing for type definitions. |
| 402 |
When |
| 403 |
deriving physical representations of a model, packages may be mapped to containers in the target |
| 404 |
meta-model. |
| 405 |
For example in mapping to XSD they may give rise to separate documents with type definitions and their |
| 406 |
own targetNamespace. When generating |
| 407 |
Java classes they may be used to define separate packages for |
| 408 |
the classes derived form the types. |
| 409 |
</xsd:documentation> |
| 410 |
</xsd:annotation> |
| 411 |
<xsd:complexContent> |
| 412 |
<xsd:extension base="ReferableElement"> |
| 413 |
<xsd:annotation> |
| 414 |
<xsd:documentation> |
| 415 |
Name of the package is constrained in that |
| 416 |
there can only be one package with a given name |
| 417 |
in the container in which the package is defined, i.e. the model or a parent package. |
| 418 |
TBD we may wish to extend this rule to all children |
| 419 |
defined in a container, including types. |
| 420 |
</xsd:documentation> |
| 421 |
</xsd:annotation> |
| 422 |
<xsd:sequence> |
| 423 |
<xsd:element name="primitiveType" type="PrimitiveType" minOccurs="0" maxOccurs="unbounded"> |
| 424 |
<xsd:annotation> |
| 425 |
<xsd:documentation> |
| 426 |
Collection of PrimitiveType-s defined in this package. |
| 427 |
</xsd:documentation> |
| 428 |
</xsd:annotation> |
| 429 |
</xsd:element> |
| 430 |
<xsd:element name="enumeration" type="Enumeration" minOccurs="0" maxOccurs="unbounded"> |
| 431 |
<xsd:annotation> |
| 432 |
<xsd:documentation> |
| 433 |
Collection of Enumeration-s defined in this package. |
| 434 |
</xsd:documentation> |
| 435 |
</xsd:annotation> |
| 436 |
</xsd:element> |
| 437 |
<xsd:element name="dataType" type="DataType" minOccurs="0" maxOccurs="unbounded"> |
| 438 |
<xsd:annotation> |
| 439 |
<xsd:documentation> |
| 440 |
Collection of DataType-s defined in this package. |
| 441 |
</xsd:documentation> |
| 442 |
</xsd:annotation> |
| 443 |
</xsd:element> |
| 444 |
<xsd:element name="objectType" type="ObjectType" minOccurs="0" maxOccurs="unbounded"> |
| 445 |
<xsd:annotation> |
| 446 |
<xsd:documentation> |
| 447 |
Collection of ObjectType-s defined in this package. |
| 448 |
</xsd:documentation> |
| 449 |
</xsd:annotation> |
| 450 |
</xsd:element> |
| 451 |
<xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"> |
| 452 |
<xsd:annotation> |
| 453 |
<xsd:documentation> |
| 454 |
Collection of child Package-s defined in this package. |
| 455 |
</xsd:documentation> |
| 456 |
</xsd:annotation> |
| 457 |
</xsd:element> |
| 458 |
</xsd:sequence> |
| 459 |
</xsd:extension> |
| 460 |
</xsd:complexContent> |
| 461 |
|
| 462 |
</xsd:complexType> |
| 463 |
|
| 464 |
|
| 465 |
<xsd:complexType name="Type" abstract="true"> |
| 466 |
<xsd:annotation> |
| 467 |
<xsd:documentation> |
| 468 |
Base class of all type definition elements. |
| 469 |
All Type-s extend ReferenceableElement, i.e. they are referenceable. |
| 470 |
Adds name, description, inheritance and indication of abstractness to ReferencableElement. |
| 471 |
</xsd:documentation> |
| 472 |
<xsd:documentation> |
| 473 |
Name of the type. Must be unique in the collection of all types in a given container |
| 474 |
(i.e. model or package) |
| 475 |
</xsd:documentation> |
| 476 |
</xsd:annotation> |
| 477 |
<xsd:complexContent> |
| 478 |
<xsd:extension base="ReferableElement"> |
| 479 |
<xsd:sequence> |
| 480 |
<xsd:element name="extends" type="ElementRef" minOccurs="0"> |
| 481 |
<xsd:annotation> |
| 482 |
<xsd:documentation> |
| 483 |
Reference to a type (called the base-type) that is extended by the current type (called the subtype). |
| 484 |
This implements the typical is-a inheritance relationship, similar to the extends relations in XSD and Java, |
| 485 |
the |
| 486 |
generaliation in UML, or the subclassOf relation in RDF. Note, VO-DML does not support multiple inheritance. |
| 487 |
Instances of a subtype are automatic instances of a base type. |
| 488 |
Polymorphism is assumed: When a role (see below) defines a base type |
| 489 |
as its datatype, instances of any subtype |
| 490 |
can be uased as value of the role. |
| 491 |
Roles defined on a base type are inherited by the subtypes. |
| 492 |
Relations inherited from a basetype can be 'subsetted', which is similar to overriding their definition. |
| 493 |
See the definition of this property on the Relation type. |
| 494 |
</xsd:documentation> |
| 495 |
</xsd:annotation> |
| 496 |
</xsd:element> |
| 497 |
<xsd:element name="constraint" type="Constraint" minOccurs="0" maxOccurs="unbounded"> |
| 498 |
<xsd:annotation> |
| 499 |
<xsd:documentation> |
| 500 |
Constraints defining valid instances of the type. |
| 501 |
May be an AttributeConstraint or an expression in some language. |
| 502 |
</xsd:documentation> |
| 503 |
</xsd:annotation> |
| 504 |
</xsd:element> |
| 505 |
</xsd:sequence> |
| 506 |
<xsd:attribute name="abstract" type="xsd:boolean" use="optional" /> |
| 507 |
</xsd:extension> |
| 508 |
</xsd:complexContent> |
| 509 |
</xsd:complexType> |
| 510 |
|
| 511 |
<xsd:complexType name="ObjectType"> |
| 512 |
<xsd:annotation> |
| 513 |
<xsd:documentation> |
| 514 |
TBD use description form VO-DML specification document. to ... |
| 515 |
</xsd:documentation> |
| 516 |
</xsd:annotation> |
| 517 |
<xsd:complexContent> |
| 518 |
<xsd:extension base="Type"> |
| 519 |
<xsd:sequence> |
| 520 |
<xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"> |
| 521 |
<xsd:annotation> |
| 522 |
<xsd:documentation> |
| 523 |
TODO |
| 524 |
</xsd:documentation> |
| 525 |
</xsd:annotation> |
| 526 |
</xsd:element> |
| 527 |
<xsd:element name="composition" type="Composition" minOccurs="0" maxOccurs="unbounded"> |
| 528 |
<xsd:annotation> |
| 529 |
<xsd:documentation> |
| 530 |
TODO |
| 531 |
</xsd:documentation> |
| 532 |
</xsd:annotation> |
| 533 |
</xsd:element> |
| 534 |
<xsd:element name="reference" type="Reference" minOccurs="0" maxOccurs="unbounded"> |
| 535 |
<xsd:annotation> |
| 536 |
<xsd:documentation> |
| 537 |
TODO |
| 538 |
</xsd:documentation> |
| 539 |
</xsd:annotation> |
| 540 |
</xsd:element> |
| 541 |
</xsd:sequence> |
| 542 |
</xsd:extension> |
| 543 |
</xsd:complexContent> |
| 544 |
</xsd:complexType> |
| 545 |
|
| 546 |
|
| 547 |
<xsd:complexType name="ValueType" abstract="true"> |
| 548 |
<xsd:annotation> |
| 549 |
<xsd:documentation> |
| 550 |
Base class of all valaue types, i.e. those types identified by their value, rather than a separate explicit identifier. |
| 551 |
These are the types that can be assigned to Attribute-s. |
| 552 |
</xsd:documentation> |
| 553 |
</xsd:annotation> |
| 554 |
<xsd:complexContent> |
| 555 |
<xsd:extension base="Type"> |
| 556 |
</xsd:extension> |
| 557 |
</xsd:complexContent> |
| 558 |
</xsd:complexType> |
| 559 |
|
| 560 |
|
| 561 |
<xsd:complexType name="PrimitiveType"> |
| 562 |
<xsd:annotation> |
| 563 |
<xsd:documentation> |
| 564 |
Atomic/simple type. Defined by a single value. Generally a built in type from the IVOA profile model, |
| 565 |
or a subclass of one of those types. |
| 566 |
</xsd:documentation> |
| 567 |
</xsd:annotation> |
| 568 |
<xsd:complexContent> |
| 569 |
<xsd:extension base="ValueType"> |
| 570 |
</xsd:extension> |
| 571 |
</xsd:complexContent> |
| 572 |
</xsd:complexType> |
| 573 |
|
| 574 |
<xsd:complexType name="DataType"> |
| 575 |
<xsd:complexContent> |
| 576 |
<xsd:extension base="ValueType"> |
| 577 |
<xsd:sequence> |
| 578 |
<xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"> |
| 579 |
<xsd:annotation> |
| 580 |
<xsd:documentation> |
| 581 |
TODO |
| 582 |
</xsd:documentation> |
| 583 |
</xsd:annotation> |
| 584 |
</xsd:element> |
| 585 |
<xsd:element name="reference" type="Reference" minOccurs="0" maxOccurs="unbounded"> |
| 586 |
<xsd:annotation> |
| 587 |
<xsd:documentation> |
| 588 |
TODO |
| 589 |
</xsd:documentation> |
| 590 |
</xsd:annotation> |
| 591 |
</xsd:element> |
| 592 |
</xsd:sequence> |
| 593 |
</xsd:extension> |
| 594 |
</xsd:complexContent> |
| 595 |
</xsd:complexType> |
| 596 |
|
| 597 |
<xsd:complexType name="Enumeration"> |
| 598 |
<xsd:annotation> |
| 599 |
<xsd:documentation> |
| 600 |
A primitive type with a limited, discrete set of values. |
| 601 |
May explicitly extend a PrimitiveType. Its values must be compatible with that type then. |
| 602 |
TBD Should define what it |
| 603 |
might mean for an enumeraiton to extend another enumeration. |
| 604 |
Should it restrict the possible values further? Or should it add to the values? Or ...? |
| 605 |
</xsd:documentation> |
| 606 |
</xsd:annotation> |
| 607 |
<xsd:complexContent> |
| 608 |
<xsd:extension base="PrimitiveType"> |
| 609 |
<xsd:sequence> |
| 610 |
<xsd:element name="literal" type="EnumLiteral" maxOccurs="unbounded"> |
| 611 |
<xsd:annotation> |
| 612 |
<xsd:documentation> |
| 613 |
TODO |
| 614 |
</xsd:documentation> |
| 615 |
</xsd:annotation> |
| 616 |
</xsd:element> |
| 617 |
</xsd:sequence> |
| 618 |
</xsd:extension> |
| 619 |
</xsd:complexContent> |
| 620 |
</xsd:complexType> |
| 621 |
|
| 622 |
<xsd:complexType name="EnumLiteral"> |
| 623 |
<xsd:complexContent> |
| 624 |
<xsd:extension base="ReferableElement"> |
| 625 |
<xsd:sequence> |
| 626 |
</xsd:sequence> |
| 627 |
</xsd:extension> |
| 628 |
</xsd:complexContent> |
| 629 |
</xsd:complexType> |
| 630 |
|
| 631 |
<xsd:complexType name="Role" abstract="true"> |
| 632 |
<xsd:annotation> |
| 633 |
<xsd:documentation> |
| 634 |
A Role represents the "role a Type plays in the definition of another Type". |
| 635 |
Generally, instances of structured types contain instances of other types, organised according to some |
| 636 |
predesigned pattern consisting basically of |
| 637 |
name-value pairs. |
| 638 |
The names refer to the particular role to which the values are assigned. |
| 639 |
These values must have the type corresponding to the role, implemented below using the datatype element. |
| 640 |
The values may be multiple-valued. |
| 641 |
Three different types |
| 642 |
of roles are supported in VO-DML: Attribute, COllection and Reference. |
| 643 |
Their characteristics are defined below. |
| 644 |
</xsd:documentation> |
| 645 |
<xsd:documentation> |
| 646 |
Role extends ReferencableElement. |
| 647 |
The 'name' element that is inherited from that type must be unique in the collection of roles |
| 648 |
defined on the parent type. |
| 649 |
This uniqueness must extend over the roles available on the type by |
| 650 |
inheritance. |
| 651 |
</xsd:documentation> |
| 652 |
</xsd:annotation> |
| 653 |
|
| 654 |
<xsd:complexContent> |
| 655 |
<xsd:extension base="ReferableElement"> |
| 656 |
<xsd:sequence> |
| 657 |
<xsd:element name="datatype" type="ElementRef"> |
| 658 |
<xsd:annotation> |
| 659 |
<xsd:documentation> |
| 660 |
Reference to the type that plays the role represented by this Role. |
| 661 |
</xsd:documentation> |
| 662 |
</xsd:annotation> |
| 663 |
</xsd:element> |
| 664 |
<xsd:element name="multiplicity" type="Multiplicity"> |
| 665 |
<xsd:annotation> |
| 666 |
<xsd:documentation> |
| 667 |
The multiplicity of the role (also called cardinality) indicates whether it must have a |
| 668 |
value or may be without value, or possibly how many values are allowed. |
| 669 |
</xsd:documentation> |
| 670 |
</xsd:annotation> |
| 671 |
</xsd:element> |
| 672 |
</xsd:sequence> |
| 673 |
</xsd:extension> |
| 674 |
</xsd:complexContent> |
| 675 |
</xsd:complexType> |
| 676 |
|
| 677 |
<xsd:complexType name="Attribute"> |
| 678 |
<xsd:annotation> |
| 679 |
<xsd:documentation> |
| 680 |
An Attribute is a Role where the target datatype is a ValueType. |
| 681 |
It represent "simple" properties of its container type, which can be an ObjectType or a DataType. |
| 682 |
</xsd:documentation> |
| 683 |
<xsd:documentation> |
| 684 |
Must refer to a ValueType. |
| 685 |
</xsd:documentation> |
| 686 |
</xsd:annotation> |
| 687 |
<xsd:complexContent> |
| 688 |
<xsd:extension base="Role"> |
| 689 |
<xsd:sequence> |
| 690 |
<xsd:element name="semanticconcept" type="SemanticConcept" minOccurs="0"> |
| 691 |
<xsd:annotation> |
| 692 |
<xsd:documentation> |
| 693 |
It is possible to assign a SemanticConcept to an attribute definition. |
| 694 |
This means that the values of the attribute have to comply with the definition of the |
| 695 |
SemanticConcept. |
| 696 |
This can be done in two manners. Either the SemanticConcept |
| 697 |
gives a link to a semantic vocabulary, in which case the value must be a |
| 698 |
concept defined in that vocabulary. |
| 699 |
Or it defines a topConcept, in which case the value must be a concept that is explicitly |
| 700 |
declared to be (narrower than) |
| 701 |
that concept, or a concept that is narrower than that concept. |
| 702 |
FOr details on the interpretation see the VO-DML document. |
| 703 |
</xsd:documentation> |
| 704 |
</xsd:annotation> |
| 705 |
</xsd:element> |
| 706 |
</xsd:sequence> |
| 707 |
</xsd:extension> |
| 708 |
</xsd:complexContent> |
| 709 |
</xsd:complexType> |
| 710 |
|
| 711 |
|
| 712 |
|
| 713 |
<xsd:complexType name="SemanticConcept"> |
| 714 |
<xsd:annotation> |
| 715 |
<xsd:documentation> |
| 716 |
Type used to indicate on attributes that they take values representing a concept defined in |
| 717 |
an identified semantic vocabulary (SKOS or RDFS), and/or restricted by being narrower/more specific than an |
| 718 |
identified "top" concept. |
| 719 |
</xsd:documentation> |
| 720 |
</xsd:annotation> |
| 721 |
<xsd:sequence> |
| 722 |
<xsd:element name="topConcept" type="xsd:anyURI" minOccurs="0"> |
| 723 |
<xsd:annotation> |
| 724 |
<xsd:documentation> |
| 725 |
A URI identifiying a semantic concept that corresponds to the concept in the model. |
| 726 |
Values of a corresponding attributes must be URI-s identifiying objects that are narrower |
| 727 |
than the identified concept. This attribute may be null as |
| 728 |
certain vocabularies may not have a |
| 729 |
</xsd:documentation> |
| 730 |
</xsd:annotation> |
| 731 |
</xsd:element> |
| 732 |
<xsd:element name="vocabularyURI" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"> |
| 733 |
<xsd:annotation> |
| 734 |
<xsd:documentation> |
| 735 |
If no topConcept is defined, one or more explicit vocabularies can be provided from which the |
| 736 |
value must be obtained. |
| 737 |
</xsd:documentation> |
| 738 |
</xsd:annotation> |
| 739 |
</xsd:element> |
| 740 |
</xsd:sequence> |
| 741 |
</xsd:complexType> |
| 742 |
|
| 743 |
<xsd:complexType name="Relation" abstract="true"> |
| 744 |
<xsd:annotation> |
| 745 |
<xsd:documentation> |
| 746 |
A relation is a Role where the target datatype is an ObjectType. |
| 747 |
</xsd:documentation> |
| 748 |
</xsd:annotation> |
| 749 |
<xsd:complexContent> |
| 750 |
<xsd:extension base="Role"> |
| 751 |
<xsd:sequence> |
| 752 |
</xsd:sequence> |
| 753 |
</xsd:extension> |
| 754 |
</xsd:complexContent> |
| 755 |
</xsd:complexType> |
| 756 |
|
| 757 |
<xsd:complexType name="Reference"> |
| 758 |
<xsd:annotation> |
| 759 |
<xsd:documentation> |
| 760 |
A Reference is a Relation that indicates a kind of "usage" relationship |
| 761 |
between the target ObjectType and the owner of the reference, the "referrer". |
| 762 |
The referrer can be an ObjectType (typically) but also a DataType. |
| 763 |
The relation is |
| 764 |
looser than the composition relationship, acting like a |
| 765 |
semantically meaningful pointer rather than indicating a component of the referrer. |
| 766 |
Consequently, in general many referrers can point at the same target instance, |
| 767 |
and ObjectType-s can |
| 768 |
be the target in different reference definitions. |
| 769 |
The lifecycle of the target is not bound to that of the referrer. |
| 770 |
Often the target instance is used to provide a context for the definition of |
| 771 |
the referrer. For example a coordinate frame may be |
| 772 |
referenced to provide context to coordinate values. |
| 773 |
TBD more needed ...? |
| 774 |
</xsd:documentation> |
| 775 |
</xsd:annotation> |
| 776 |
<xsd:complexContent> |
| 777 |
<xsd:extension base="Relation"> |
| 778 |
<xsd:annotation> |
| 779 |
<xsd:documentation> |
| 780 |
TBD Should have multiplicity 0..1 or 1? |
| 781 |
</xsd:documentation> |
| 782 |
</xsd:annotation> |
| 783 |
</xsd:extension> |
| 784 |
</xsd:complexContent> |
| 785 |
</xsd:complexType> |
| 786 |
|
| 787 |
<xsd:complexType name="Composition"> |
| 788 |
<xsd:annotation> |
| 789 |
<xsd:documentation> |
| 790 |
This type implements a composition relation between the parent and child ObjectTypes. |
| 791 |
Its instances are ONLY used to set the composition field on an ObjectType. |
| 792 |
It is a rule that an object type can only be the target of a single composition definition. |
| 793 |
A subclass can be assigned a target to a composition if a |
| 794 |
baseclass is already assigned such a target, but only if the composition is explicitly 'subsetted'. |
| 795 |
A composition is assumed to be a set, i.e. |
| 796 |
a given object (as identified by its identifier!) cannot occur |
| 797 |
multiple times in the composition. |
| 798 |
The composition |
| 799 |
may be ordered, which implies that the order in which objects have been added |
| 800 |
to |
| 801 |
the parent is to be preserved. As clients can always do an explicit sort on any of the child objects' attributes, |
| 802 |
it seems not necessary to add functionality for |
| 803 |
declaring a composition is |
| 804 |
sorted on one or more attributes. |
| 805 |
Through the uniqueInCollection constraint that can be assigned to attributes, a composition can impose the |
| 806 |
constraint that different objects in the composition |
| 807 |
must have distinct values of the |
| 808 |
attribute to which that constraint is assigned. |
| 809 |
It would be better probably to add the capability to assign such constraints to this composition type. |
| 810 |
This would |
| 811 |
also give more flexibility in for example creating explicit (named) keys, or defining |
| 812 |
multi-attribute uniqueness constraints. |
| 813 |
</xsd:documentation> |
| 814 |
</xsd:annotation> |
| 815 |
<xsd:complexContent> |
| 816 |
<xsd:extension base="Relation"> |
| 817 |
<xsd:sequence> |
| 818 |
<xsd:element name="isOrdered" type="xsd:boolean" default="false" minOccurs="0"> |
| 819 |
<xsd:annotation> |
| 820 |
<xsd:documentation> |
| 821 |
If true, this composition preserves the ordering of object insertions. |
| 822 |
</xsd:documentation> |
| 823 |
</xsd:annotation> |
| 824 |
</xsd:element> |
| 825 |
</xsd:sequence> |
| 826 |
</xsd:extension> |
| 827 |
</xsd:complexContent> |
| 828 |
</xsd:complexType> |
| 829 |
|
| 830 |
|
| 831 |
<xsd:complexType name="Multiplicity"> |
| 832 |
<xsd:annotation> |
| 833 |
<xsd:documentation> |
| 834 |
Also called "Cardinality". Indicates how many instances of a datatype can/must be associated to a given role. |
| 835 |
Unless |
| 836 |
Follows model in XSD, i.e. with explicit lower bound and upper bound on number of instances. |
| 837 |
maxOccurs must be gte minOccurs, unless it is negative, in which case it corresponds to unbounded. |
| 838 |
</xsd:documentation> |
| 839 |
</xsd:annotation> |
| 840 |
<xsd:sequence> |
| 841 |
<xsd:choice> |
| 842 |
<xsd:element name="minOccurs" type="xsd:nonNegativeInteger"> |
| 843 |
<xsd:annotation> |
| 844 |
<xsd:documentation> |
| 845 |
Lower bound on number of instances/values. |
| 846 |
</xsd:documentation> |
| 847 |
</xsd:annotation> |
| 848 |
</xsd:element> |
| 849 |
</xsd:choice> |
| 850 |
<xsd:element name="maxOccurs" type="xsd:int"> |
| 851 |
<xsd:annotation> |
| 852 |
<xsd:documentation> |
| 853 |
When negative, unbounded. |
| 854 |
</xsd:documentation> |
| 855 |
</xsd:annotation> |
| 856 |
</xsd:element> |
| 857 |
</xsd:sequence> |
| 858 |
</xsd:complexType> |
| 859 |
|
| 860 |
|
| 861 |
<xsd:complexType name="Constraint"> |
| 862 |
<xsd:annotation> |
| 863 |
<xsd:documentation> |
| 864 |
Constraint represents rules that instances of Type-s must obey to be valid. |
| 865 |
A generic Constraint only has a 'description' element |
| 866 |
which describes the constraint in English. |
| 867 |
In future versions of the language extra elements may be added that give a more formal |
| 868 |
definition of the constraint. In particular we may add expressions in a language |
| 869 |
such as OCL or subset thereof tuned to VO-DML. |
| 870 |
In terms of OCL, VO-DML COnstraint-s are invariants of a Type. |
| 871 |
</xsd:documentation> |
| 872 |
</xsd:annotation> |
| 873 |
<xsd:sequence> |
| 874 |
<xsd:element name="description" type="xsd:string" minOccurs="0"> |
| 875 |
<xsd:annotation> |
| 876 |
<xsd:documentation> |
| 877 |
A natural language description of the constraint. |
| 878 |
</xsd:documentation> |
| 879 |
</xsd:annotation> |
| 880 |
</xsd:element> |
| 881 |
</xsd:sequence> |
| 882 |
</xsd:complexType> |
| 883 |
|
| 884 |
|
| 885 |
<xsd:complexType name="SubsettedRole"> |
| 886 |
<xsd:annotation> |
| 887 |
<xsd:documentation> |
| 888 |
A special type of constraint that represents the common pattern where a subtype. |
| 889 |
would like to restrict certain aspects of a definition of a roles defined on a super type. |
| 890 |
The constraint explicitly defines the datatype of the identified role. This new datatype MUST |
| 891 |
be a subtype of the declared datatype of the role that is being constrained. Similarly |
| 892 |
a new, more restrictive semantic concept may be defined. |
| 893 |
</xsd:documentation> |
| 894 |
</xsd:annotation> |
| 895 |
<xsd:complexContent> |
| 896 |
<xsd:extension base="Constraint"> |
| 897 |
<xsd:sequence> |
| 898 |
<xsd:element name="role" type="ElementRef"> |
| 899 |
<xsd:annotation> |
| 900 |
<xsd:documentation> |
| 901 |
VODMLREF identifying the constrained Role. |
| 902 |
This role MUST be available to the type containing this constraint. |
| 903 |
</xsd:documentation> |
| 904 |
</xsd:annotation> |
| 905 |
</xsd:element> |
| 906 |
<xsd:element name="datatype" type="ElementRef" minOccurs="0"> |
| 907 |
<xsd:annotation> |
| 908 |
<xsd:documentation> |
| 909 |
Pointer to datatype that the constrained Role must take. |
| 910 |
This datatype MUST be a sub-type of the declared datatype of the constrained Role. |
| 911 |
</xsd:documentation> |
| 912 |
</xsd:annotation> |
| 913 |
</xsd:element> |
| 914 |
<xsd:element name="semanticconcept" type="SemanticConcept" minOccurs="0"> |
| 915 |
<xsd:annotation> |
| 916 |
<xsd:documentation> |
| 917 |
Maybe the super type has not defined a semantic concept for the Role, but |
| 918 |
the subtype needs that. This attribute allows this assignment. But alse when |
| 919 |
the Role on the super-type already has a semanticconcept with a topConcept |
| 920 |
defined on it, the subtype may restrict the values to a narrower concept than |
| 921 |
that assigned to it on the super-type. |
| 922 |
</xsd:documentation> |
| 923 |
</xsd:annotation> |
| 924 |
</xsd:element> |
| 925 |
</xsd:sequence> |
| 926 |
</xsd:extension> |
| 927 |
</xsd:complexContent> |
| 928 |
|
| 929 |
</xsd:complexType> |
| 930 |
|
| 931 |
<!-- Begin of element declaration(s) --> |
| 932 |
<xsd:element name="model" type="Model"> |
| 933 |
<xsd:annotation> |
| 934 |
<xsd:documentation> |
| 935 |
Every VO-DML/XML document must start with a 'model' element, no other root elements are supported by this spec. |
| 936 |
</xsd:documentation> |
| 937 |
</xsd:annotation> |
| 938 |
</xsd:element> |
| 939 |
|
| 940 |
|
| 941 |
</xsd:schema> |