DEF Lines (User Attributes)

 

 

The DEF lines control the generation of the GML application schema.

The syntax of a GML DEF line is:

<WriterKeyword>_DEF <feature type> \

[<attribute name> <attribute type>]*

The Name can either be a simple attribute, a list attribute, a structured attribute, or a geometry attribute.

The valid values for Type are: xml_buffer, xml_char(width), xml_int32, xml_real32, xml_decimal(width,decimal), xml_boolean, xml_real64, and xml_geometry.

Simple attributes have no embedded period, and they are mapped into simple type properties in the GML application schema.

List attributes end with a “{}” suffix, and are mapped into simple type property declarations whose maxOccurs are set to unbounded. Structured attributes have embedded periods, each component in a structured attribute is separated by a period, and each component may also be a list. Structured attributes are mapped into complex type properties in the GML application schema. For example, the structured FME attributes, “changeHistory.Date”, and “changeHistory.Reason” are mapped into a changeHistory element whose complex type is defined as a sequence of Date and Reason elements both of which are defined as simple types.

Geometry attributes are used to control the name and the position of the GML geometry elements. Currently only the generic xml_geometry type is supported. Therefore, the geometry attribute only specifies the name and the position for the GML gml geometric property. The type for the GML geometric property is determined via the instances of the data features. For example, if all instances of a named geometry corresponding to the geometry attribute are points, then the XSD written will have its geometric element declared as gml:PointPropertyType; if the specific GML geometry property type cannot be determined via the data features, then the geometric element is declared as gml:GeometryPropertyType.

For example, the DEF line:

GML_DEF F1									\
		code				xml_int32			\
		changeHistory.Date		xml_char(10)			\
		changeHistory.Reason		xml_char(254)			\
		center_point			xml_geometry			\
		place				xml_buffer			\
		boundary			xml_geometry

 

GML_DEF F1									\
		code				xml_int32			\
		changeHistory.Date				xml_char(10)			\
		changeHistory.Reason				xml_char(254)            \

If every F1 feature instance given to the writer has an aggregate containing individual geometries, and the component of the aggregates are point geometries named “center_point” and area geometries named “boundary”, then the following complex type definition will be generated:

<complexType name="F1Type">
   <complexContent>
      <extension base="gml:AbstractFeatureType">
         <sequence>
            <element name="code" minOccurs="0" type="integer"/>
            <element name="changeHistory" minOccurs="0">
               <complexType>
                  <sequence>
                     <element name="Date" minOccurs="0">
                        <simpleType>
                           <restriction base="string">
                              <maxLength value="10"/>
                           </restriction>
                        </simpleType>
                     </element>
                     <element name="Reason" minOccurs="0">
                        <simpleType>
                           <restriction base="string">
                              <maxLength value="254"/>
                           </restriction>
                        </simpleType>
                     </element>
                  </sequence>
               </complexType>
            </element>
            <element name="center_point" minOccurs="0" type="gml:PointPropertyType"/>
	     <element name="place" minOccurs="0" type="string"/>			 
	     <element name="boundary" minOccurs="0" type="gml:SurfacePropertyType"/>
	  </sequence>
      </extension>
   </complexContent>
</complexType>