SWIM Supporting Material
XML Schema definition language constructs
This page maps the requirements found in the SWIM Information Definition Specification (and Requirement 22 of the SWIM Service Description Specification) to the structures found in the XML Schema Definition language. It does this with the purpose of showing how information definitions expressed in those formats can meet the requirements. This will ensure that the formats can be used in satisfaction of the specifications.
Requirement | Corresponding structure in XSD | Example | Notes |
General Requirements for Information Definitions | |||
Information definition identification | xs:annotation |
|
|
title |
| <xs:annotation> <xs:appinfo>Information Definition</xs:appinfo> <xs:documentation> <generalInformation> <identification> <title>my first information definition</title> <edition>0.1</edition> <referenceDate>2017-11-10</referenceDate> </identification> </generalInformation> </xs:documentation> </xs:annotation> |
|
edition |
| Prefer to keep in annotation rather than use the XSD version attribute. | |
reference date |
|
| |
Information definition responsible party | xs:annotation |
|
|
name |
| <xs:annotation> <xs:appinfo>Information Definition</xs:appinfo> <xs:documentation> <generalInformation> <responsibleParty> <responsiblePartyName>jeff</responsiblePartyName> <contactDetails>smoke signals only</contactDetails> <role>nice guy in a bad world</role> </responsibleParty> </generalInformation> </xs:documentation> </xs:annotation> |
|
contact information |
|
| |
role |
|
| |
Information definition scope | xs:annotation | <xs:annotation> <xs:appinfo>Information Definition</xs:appinfo> <xs:documentation> <generalInformation> <scope>a really quite intriguing and self-referential schema</scope> </generalInformation> </xs:documentation> </xs:annotation> |
|
Information definition namespace | XSD namespaces
| xmlns:sid="http://www.exampleURI.com/Schema1" targetNamespace="http://www.exampleURI.com/Schema1" |
|
Information definition concepts |
|
|
|
name | es:element name | <xs:element name="SimpleMessage"> |
|
definition | xs:annotation | <xs:element name="SimpleMessage"> <xs:annotation> <xs:documentation> <definition>Definition of the element/concept</definition> </xs:documentation> </xs:annotation> </xs:element> |
|
data type | xs:element type or xs:restriction base | <xs:element name="name" type="xs:string"> or <xs:restriction base="xs:double"/> | There are probably other ways to do this as well |
Unique identifiers for concepts | xs:element id | <xs:element name="status" id="abcd"/> | Cannot start with a number so may have limitations |
Semantic Correspondence Requirements for Information Definitions | |||
mapping | xs:annotation |
|
|
trace |
| <xs:annotation> <xs:documentation> <semanticCorrespondence> <mapping> <trace>-AIRM unique identifier-</trace> </mapping> </semanticCorrespondence> </xs:documentation> </xs:annotation> |
|
trace source |
| Is obvious from the position in the XSD if placed inline. | |
trace target |
|
| |
out-of-scope declaration | xs:annotation | <xs:annotation> <xs:documentation> <semanticCorrespondence> <outOfScope rationale=”container”/> </semanticCorrespondence> </xs:documentation> </xs:annotation> |
|
out-of-scope declaration rationale |
|
| |
change request reference | xs:annotation | <xs:annotation> <xs:documentation> <semanticCorrespondence> <changeRequest number=”100”/> </semanticCorrespondence> </xs:documentation> </xs:annotation> |
|
no semantic correspondence established declaration | xs:annotation | <xs:annotation> <xs:documentation> <semanticCorrespondence> <noSemanticCorrespondence rationale=”work in progress”/> </semanticCorrespondence> </xs:documentation> </xs:annotation> |
|
no semantic correspondence established declaration rationale |
|
|
Additional Requirement on Exchanged Information | |||
cardinality (optional, conditional, mandatory) | xs:element minOccurs and maxOccurs | <xs:element ref="sid:status" minOccurs="0" maxOccurs="unbounded"/> |
|
constraints |
|
|
|
data type |
|
| Same as above |
value ranges | xs:restriction | <xs:simpleType name="messageSequenceType"> <xs:restriction base="xs:int"> <xs:minExclusive value="1"/> <xs:maxExclusive value="100"/> </xs:restriction> </xs:simpleType> |
|
special values | xs:restriction | <xs:simpleType name="statusType"> <xs:restriction base="xs:string"> <xs:enumeration value="open"/> <xs:enumeration value="closed"/> </xs:restriction> </xs:simpleType> |
|
character set restrictions | xml encoding | <?xml version="1.0" encoding="UTF-8"?> |
|
structure and relevant relationships | combination of sequence, choice, base, etc. | Too many to show! |
|
Related content
Status: Living Material