jueves, 17 de abril de 2014

OWS Context validation alternatives

Introduction to OWS Context

The OGC Web Services Context Document (OWS Context) allows a set of configured information resources (service set) to be passed between applications primarily as a collection of services. OWS Context is developed to support in-line content as well. The goal is to support use cases such as the distribution of search results, the exchange of a set of resources such as OGC Web Feature Service (WFS), Web Map Service (WMS), Web Map Tile Service (WMTS), Web Coverage Service (WCS) and others in a ‘common operating picture’. This standard covers almost all use cases for the old Web Map Context standards and intents to replace it.

The standard can be found here: http://www.opengeospatial.org/standards/owc

OWSContext XML file can be encoded in XML and in JSON (still under development).

The XML encoding is an extension of the W3C Atom standard (RFC4287). RSS and Atom readers are able to reed them and present some information. Geospatially enabled clients can share the 'common operating picture' better.

OWS Context Validation

The http://schemas.opengis.net/owc/1.0 contains the official RelaxNG compact schemas (.rnc extension) to validate OWS
Context files. RelaxNG compact validation was chosen following RFC4287 that also provides a RelaxNG for Atom.

This post presents other validation alternatives that are not official but can be equally useful. I have found that RelaxNG compact notation is not supported for many of the usual tools that I was using for validating XSD so I imagine that other people can have the same problem and might find this post useful


Alternative 1: Use the RelaxNG XML format

Some tools that I have found to validate RelaxNG only supports the XML notation (.rng extension). I have created those. It was not so difficult since there is a tool that can do this for you. You can find this in https://github.com/joanma747/owscontext-xsd

Alternative 2: Use a combination of XSD schemas and Schematron

Mainly there are to advantages in RelaxNG: It is There support better extensible XML creation and they include contextual validation rules based on xpath. Support for extensible XML creation can also be included in XSD if some tricks are used. I learned some of this tricks from some Atom XSD validation that I have found (and in particular http://www.atomenabled.org/developers/syndication/atom-format-spec.php) such as the use of xs:choice and xs:any. Support to contextual validation rules based on xpath can be done using Schematron (that has been used in OGC in combination with XSD for a while).

OWS Context examples

https://github.com/joanma747/owscontext-xsd also contains the same examples that can be found on the OGC original repository but I have edited them to link to the XSD, SCH and RNG corresponding files.

Joan Masó