Print This Post

Embedding GML in “foreign” grammars

It seems that there are many people who would like to use GML in a non-GML grammar but are not sure how to do it.  This note is offered as a suggested best practice.

GML follows the so called "object-property-value" rule borrowed more or less from RDF.  This gives GML instances a particular striped structure – especially if the value is again a GML object.  GML was intended to allow applications to define voacabularies of geographic objects – i.e. concrete or abstract real world objects such as political boundaries, bouys, airspaces, shipping lanes, roads and forest districts.  Since such vocabularies are open ended GML uses XML Schema and creates so called application schemas that define these vocabularies,

Some people would, however, like to use GML within an existing XML grammar for such things as the expression of geometry, time, direction etc.  For such purposes the application schema route is not the best approach.  In this case it is suggested that ONLY GML objects be used.  GML objects are XML elements whose content models derive from one of the GML core schema objects such as features, geometries, topologies, time etc.  Their children are ALWAYS properties of the object.

To use a GML object, enclose it in a property in the "foreign" grammar.

Thus you might write:

1
2
3
    <foreignGrammar>
      <gml:Object> .. </gml:Object>
    </foreignGrammar>

Note that this approach is NOT recommended when defining geographic objects and everything outside the GML must be handled by non-GML aware sotware.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>