[OSGeo-Discuss] Searching proper schema constructs in layered GML
krzysztof.finowicki at tessel.pl
Thu Nov 12 06:21:15 EST 2009
I'm trying to define GML 3.2.1. based application schema for FM-related
The concept is to create some intermediate base-level schema common to basic
software tools (e.g. universal XSLT processing), completed with specific
application-level schemas presenting actual application structure.
>From "GML Best Practices Guide"
(http://www.ogcnetwork.net/system/files/GML_Best_Practices_Guide.pdf) it is
advised not to use "type" attribute:
If you wish to denote distinct semantic types such as river and road, it is
INVALID GML to use a type attribute as shown in the following examples.
Example of Invalid GML Using a Type Attribute
<app:GenericFeature gml:id = "p2" type = "Canal">
<gml:centerLineOf> … </app:centerLineOf>
You can "narrow" the type denoted by the feature type name element (<app:
GenericFeature>) by using qualifying properties, as shown in the following
<app:GenericFeature gml:id = "p2">
<gml:centerLineOf> ... </app:centerLineOf>
But from the other hand, from "XML Schema W3C Recommendation"
(http://www.w3.org/TR/xmlschema-0/#abstract) it results that using abstract
types makes constructs with "type" attribute perfectly legal:
Declaring a type as abstract simply requires the use of a type derived from
it (and identified by the xsi:type attribute) in the instance document.
<complexType name="Vehicle" abstract="true"/>
<element name="transport" type="target:Vehicle"/>
The transport element is not abstract, therefore it can appear in instance
documents. However, because its type definition is abstract, it may never
appear in an instance document without an xsi:type attribute that refers to
a derived type. That means the following is not schema-valid:
because the transport element's type is abstract. However, the following is
because it uses a non-abstract type that is substitutable for Vehicle.
It results that using Galdos recommendation with <app:type> element is
somehow artificial and naive, disallowing for application-specific
specialization of concrete GenericFeatures.
On the other hand, W3C recommended xsi:type attribute is perfectly legal,
and allows using in the same time generic schema to describe specific
Of course it requires further generalization by defining generic properties
for features in base-level schema with their concrete definitions in
I wonder what is opinion of GML-gurus about proper constructs for layering
of GML-application schemas.
View this message in context: http://n2.nabble.com/Searching-proper-schema-constructs-in-layered-GML-application-schema-tp3992089p3992089.html
Sent from the OSGeo Discuss mailing list archive at Nabble.com.
More information about the Discuss