- 1 General Information
- 2 Supported Target Types
The primary target of ShapeChange are GML application schemas, represented as a set of XML Schema documents. However, there are other targets that ShapeChange may be configured to produce. The targets are described here, both conceptually (the specifications underlying each target) and practically (how ShapeChange may be configured to produce each form of output).
An encoding rule, as defined in ISO 19118:2005, is an “identifiable collection of conversion rules” that “is applied to application schema specific data structures to produce system-independent data structures suitable for transport or storage” (ISO 19118:2005, section 6.4.1). Both input and output data structures are specified in a schema language, such as UML or XML Schema; accordingly, an encoding rule includes a schema conversion rule.
The encoding rule concept drives ShapeChange: the conversion from an application schema in UML to another data structure is (broadly) driven by a set of rules, encapsulated by the internal code of the classes in the Target packages.
The ShapeChange configuration framework contains provisions for specifying which of a set of possible encoding rules applies to a particular transformation, with the ability for an application schema in UML to support multiple encoding rules for different “platforms” or targets. Currently, only the XML Schema target allows for detailled customization of the encoding rule to be applied during that transformation; the details of this mechanism and the encoding rules applied – including ShapeChange extensions to the standard rules – are provided in the discussion of that target. However, the encoding rules implemented for other targets (such as KML) are described, too, with links to the details of those encoding rules.
Java Implementation Details
Within the ShapeChange Java framework, each target/output format definition is implemented as a Java class. In keeping with the modularity of ShapeChange, each such target implements the de.interactive-instruments.ShapeChange.Target.Target interface, which contains method “hooks” for the various steps in the output process— initializing the target, processing each class in the application schema appropriately for the target type, and finally writing the output to one or more files (XSD, HTML or other file). The fully-qualified name of this class must be provided in the configuration file.
Each individual target for a run of ShapeChange is defined in the configuration file as its own <Target> element. All <Target> definitions are nested under the <targets> element.
All <Target> definitions, no matter the actual target type, are configured via XML attributes and parameters. <MapEntry> definitions may also be used to customize mappings.
Each <Target> element has three attributes, one required and two optional. These attributes are as follows:
|Attribute Name||Required / Optional||Default Value||Explanation|
A string representing the fully-qualified target “handler” class (an extension of the Target interface).
|mode||Optional||enabled||Whether or not this particular target is “turned on”. This allows for multiple targets to be specified in a configuration file, and turned on/off at will. The possible values are:
|inputs||Optional||defaults to the input model||A (space-separated list of) identifiers, referencing the id of transformers and/or the input model. If multiple identifiers are provided, the target is executed for the output model of each referenced transformer and/or the input model. If the attribute is omitted then the target is applied on the input model.|
In addition to the required attributes, each <Target> may have additional parameters defined via <targetParameter> elements.
Each target type may define its own expected or required parameters; the target-specific subheadings of the subpages will describe these for each target type.
The <mapEntries> section of the <Target> element may contain a series of <MapEntry> definitions.
Map entries allow for customized mapping from UML classes to target elements, by enabling the specification of generic “rules”.
The attributes of a <MapEntry> are as follows:
|type||(Required) The UML type/class name to be mapped..|
(Required) The “rule” for the mapping. This is a freeform String field; the interpretation of its value is left to the code implementing the target.
The type to which the type will be mapped. The interpretation of its value is left to the code implementing the target.
An optional parameter for the mapping. The interpretation of its value is left to the code implementing the target.
A sample <mapEntries> element is given below (for a FME target that is part of an extension to ShapeChange):
<mapEntries> <!-- 19107 to FME geometry types --> <MapEntry rule="FME" targetType="*" type="GM_Primitive"/> <MapEntry param="fme_point" rule="FME" targetType="fme_point" type="GM_Point"/> <MapEntry param="fme_line,fme_aggregate" rule="FME" targetType="fme_line" type="GM_Curve"/> <MapEntry param="fme_polygon,fme_donut,fme_aggregate" rule="FME" targetType="fme_area" type="GM_Surface"/> </mapEntries>
Supported Target Types
The original and still the most commonly used functionality of ShapeChange is to generate XML Schema representations of application schemas, encoded as a set of XML Schema documents (XSDs). ShapeChange supports the standard encoding rules from
- GML 3.2 (ISO 19136)
- GML 3.3
- ISO/TS 19139
- SWE Common 2.0
An extension supports the generation of a Schematron schema from the OCL constraints in an application schema.
In addition, a number of community-specific encoding rule extensions for
- CityGML ADEs
- ISO 19115 metadata profiles
ISO 19110 specifies a methodology for classifying and organizing feature types into a feature catalogue. ShapeChange contains a target for generating a feature catalogue from an application schema in UML (or one of its contained packages).
The Feature Catalogue target can produce a feature catalogue in the following formats:
Code List Dictionaries
The Code List Dictionary target is a tool for outputting GML dictionaries containing values for <<CodeList>>-stereotyped data types within an application schema.
The target creates a RDF/OWL ontology representation of an application schema.
This target is experimental, also since the rules for mapping from ISO 19109 application schemas to RDF/OWL representations of these schemas is not stable. Roughly, the following describes the current mapping:
- A data type and feature type becomes a <Class>.
- Properties become <DatatypeProperty>s.
- A code list or enumeration becomes a <ConceptScheme>.
- Enumerants become <Concept>s.
An ISO 19109 application schema can be converted to an ArcGIS workspace document. That document can be imported as a schema to the various Esri Geodatabases using ArcGIS. This enables the use of ArcGIS in conjunction with ISO 19109 based application schema.
This target is work in progress and not yet documented.
OGC KML offers possibilities as a format for the exchange and visualization of geographic information. KML 2.2 includes the <ExtendedData> element as a mechanism for the inclusion of additional data elements in a KML placemark, making it possible for the semantics of an application schema to be preserved and presented in KML representation.
This target derives an XSLT stylesheet from the input application schema. When the stylesheet is applied to GML data of the same application schema, e.g. by a Web Feature Service, the result is a KML file suitable for display in any KML client including Google Earth.
The Definitions target is a tool for outputting GML dictionaries (extended by ShapeChange custom tags) for the types and their properties within an application schema. This target is deprecated and may be removed from the distribution.