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
The Runway feature (shown below) will be used to illustrate the mapping. The example will concentrate on the properties (shown as attributes).
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.
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.
The FeatureTimeSlice object is of type FeatureTimeSliceType. Continuing the example, the RunwayTimeSlice element is of type RunwayTimeSliceType.
A GML property type containing a FeatureTimeSlice objects is created.
Continuing with the object-property model, the Runway feature type is created extending the AbstractAIXMFeatureType with the RunwayTimeSlice object created above.
The Runway feature is then defined by the RunwayType.
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 .
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.