120 likes | 288 Views
GML Model and Syntax. Courtesy of Galdos Systems Inc This presentation provides a short GML basic concept review, which is intended to facilitate the understanding of the AIXM Schema structure. GML Model and Syntax. Topics GML model – Object-Property-Value XML Syntax representation
E N D
GML Model and Syntax Courtesy of Galdos Systems Inc This presentation provides a short GML basic concept review, which is intended to facilitate the understanding of the AIXM Schema structure.
GML Model and Syntax • Topics • GML model – Object-Property-Value • XML Syntax representation • Lexical conventions
GML Conceptual Model The basic constructs of the GML data model are object and property. • GML object ─ an entity represents a real word entity but with a more generic meaning to represent any meaningful thing in an application context. • GML property ─ an attribute of objects or relationships between entity objects.
XML Syntax Representation • A GML object is encoded as an XML element with a type definition that is derived from the GML predefined type gml:AbstractGMLType. • The properties of the GML object are represented as sub-elements of the corresponding GML object element.
Example GML Representation <Road> <name>…</name> <numOfLanes> … </numOfLanes> <shape>…</shape> </Road> Road name numOfLanes shape GML Representation of Road Feature
Property Value RepresentationInline • Inline: the value of the property is encoded as content of the property element. • simple valued property: the value is encoded as XML text content of the property element • complex valued property: the value is encoded as a sub-element of the property element.
Example for Value Representation Simple value encoded as text content <Road> <gml:name>Cambie Street</gml:name> <numOfLanes>4</numOfLanes> <shape> <gml:LineString> … </gml:LineString> </shape> </Road> Complex value encoded as a sub-element
Property Value Representation By Reference • By reference: the value is identified by xlink:href. <ObjectA> <property1 xlink:href=“http://www.elsewhere.org/remoteGML.xml#B_1”/> <property2 xlink:href=“#Road_1”> </ObjectA> <Road gml:id=“Road_1”> <gml:name> … </Road> <ObjectB gml:id=“B_1”> <propertyb1> <propertyb2> … </ObjectB>
Property Value RepresentationMultiple-Valued Property (Possibilities) <ObjectElement> <multipleValuedProperty> <ValueObject> <ValueObject> … <ValueObject> </multipleValuedProperty> </ObjectElement> Note: Single property element with multiple value objects as itd content. <ObjectElement> <multipleValuedProperty> <ValueObject> </multipleValuedProperty> <multipleValuedProperty> <ValueObject> </multipleValuedProperty> … </ObjectElement> Note: multiple property elements, each of them contains a single value object.
Ownership of Property Values The “owns” attribute may be added to property elements to indicate whether the value is owned by the parent object. <ObjectElement> <propertyElement owns=“true”> <ValueObject> </propertyElement> </ObjectElement> The “true” value of the attribute “owns” indicates the <ValueObject>. is owned by the <ObjectElement>. delete <ObjectElement> delete <ValueObject>
Lexical Convention • Object names : UpperCamelCase • Property names : lowerCamelCase • Abstract object names : “Abstract” + object name • Abstract property names: “abstract” + property name • Complex type names : UpperCamelCase + “Type” • Abstract complex type names : “Abstract” + complex type name
XML Tree Structure for GML Object <Object> <property1>simple valued </property1> <property2 owns=“true”> <ValueObject>…</ValueObject> </property2> <property3 owns=“false” xlink:href=“…”> … </Object>