[OSGeo-Discuss] Searching proper schema constructs in layered GML application schema

Krzysztof FF krzysztof.finowicki at tessel.pl
Thu Nov 12 06:21:15 EST 2009

Hi there,

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:

quote starts
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>
quote ends

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:

quote starts
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.

<schema xmlns="http://www.w3.org/2001/XMLSchema"

  <complexType name="Vehicle" abstract="true"/>

  <complexType name="Car">
      <extension base="target:Vehicle"/>

  <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:

  <transport xmlns="http://cars.example.com/schema"/>

because the transport element's type is abstract. However, the following is

<transport xmlns="http://cars.example.com/schema"

because it uses a non-abstract type that is substitutable for Vehicle. 
quote ends

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
application-level schema.

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 mailing list