XSD generation pattern
For each AIXM Feature in the UML, the following XML schema entities are created:
The direction in which the different types and elements are used in the schema definition
(e.g. Feature uses FeatureType)* FeaturePropertyType
- Feature
- FeatureType
- FeatureTimeSlicePropertyType
- FeatureTimeSlice.
- FeatureTimeSliceType
- FeaturePropertyGroup
- AbstractFeatureExtension
Example
The Runway feature (shown below) will be used to illustrate the mapping. The example will concentrate on the properties (shown as attributes).
RunwayPropertyGroup
An XML Schema (XSD) group is generated for each feature containing all of the properties (attributes and relationships) of the feature.
The order in which the chilled elements of the group are declared is the following:
- (if applicable) in the case of derived classes only, the property group of the super class is inserted first;
- then, all the elements that correspond to class attributes, in the order that they appear in the UML class diagram
- then, all the elements that correspond to association role names, in random order;
- last the "annotation" property – note that for derived classes this property is only defined in the super class, therefore it will appear in the property group of the super class.
Below is an example of the RunwayPropertyGroup in graphic form and as an extract from the XSD. It shows clearly how the attributes are mapped from the UML to the XSD and how the relationship 'associatedAirportHeliport' is created.
RunwayTimeSliceType
The properties of a feature or the target of any feature relationship can change within the lifetime of the feature. This temporality can be expressed in GML by using dynamic features and feature collections. The TimeSlice property of a dynamic feature contains one or more Feature TimeSlices that capture the evolution of the feature over time. A gml:TimeSlice object contains the dynamic properties of the feature.
For each feature a TimeSlice property is created that contains an array of feature TimeSlice objects. This example shows the RunwayTimeSliceType encapsulating all of the Runway properties (RunwayPropertyGroup created above) that change over time.
<complexType name="RunwayTimeSliceType"> <complexContent> <extension base="aixm:AbstractAIXMTimeSliceType"> <sequence> <group ref="aixm:RunwayPropertyGroup"/> <element name="extension" minOccurs="0" maxOccurs="unbounded"> <complexType> <sequence> <element ref="aixm:AbstractRunwayExtension"/> </sequence> <attributeGroup ref="gml:OwnershipAttributeGroup"/> </complexType> </element> </sequence> </extension> </complexContent> </complexType>
RunwayTimeSlice
The FeatureTimeSlice object is of type FeatureTimeSliceType. Continuing the example, the RunwayTimeSlice element is of type RunwayTimeSliceType.
<element name="RunwayTimeSlice" type="aixm:RunwayTimeSliceType" substitutionGroup="gml:AbstractTimeSlice"/>
RunwayTimeSlicePropertyType
A GML property type containing a FeatureTimeSlice objects is created.
<complexType name="RunwayTimeSlicePropertyType"> <sequence> <element ref="aixm:RunwayTimeSlice"/> </sequence> <attributeGroup ref="gml:OwnershipAttributeGroup"/> </complexType>
RunwayType
Continuing with the object-property model, the Runway feature type is created extending the AbstractAIXMFeatureType with the RunwayTimeSlice object created above.
<complexType name="RunwayType"> <complexContent> <extension base="aixm:AbstractAIXMFeatureType"> <sequence> <element name="timeSlice" type="aixm:RunwayTimeSlicePropertyType" maxOccurs="unbounded"/> </sequence> </extension> </complexContent> </complexType>
Runway
The Runway feature is then defined by the RunwayType.
<element name="Runway" type="aixm:RunwayType" substitutionGroup="aixm:AbstractAIXMFeature"> <annotation> <appinfo>RWY</appinfo> <appinfo><gml:description>A defined rectangular area on a land aerodrome/heliport prepared for the landing and take-off of aircraft. Note: this includes the concept of Final Approach and Take-Off Area (FATO) for helicopters.</gml:description></appinfo> </annotation> </element>
RunwayPropertyType
When a property of a feature is a relationship, the relationship must be associated to another feature or object. This is done through the creation of the FeaturePropertyType, in this case, the RunwayPropertyType.
In AIXM, when the relationship or association points to another feature, the feature is referenced using the xlink:href attribute (it's always a "remote" encoding). When the relationship points to an object, the object is included inside the parent. (Objects cannot exist without the parent.) Since a Runway is a feature the RunwayPropertyType is created with the attribute xlink:href .
<complexType name="RunwayPropertyType"> <attributeGroup ref="gml:OwnershipAttributeGroup"/> <attributeGroup ref="gml:AssociationAttributeGroup"/> </complexType>
RunwayExtension
All Features and Objects can be extended. A relationship is created with an abstract XML element that acts as the root for all extensions. Below is an example of the extension for the Runway feature. The AbstractRunwayExtension element uses the AbstractExtensionType as shown below.
<element name="AbstractRunwayExtension" type="aixm:AbstractExtensionType" abstract="true" substitutionGroup="aixm:AbstractExtension"/>