OGC to switch to WC3 XLink in July 2012

Open Geospatial Consortium (OGC) will make a backwards incompatible change to it’s XML Schema files of a large part of it’s standards in July 21st 2012. This change is done as a global corrigendum to move into using the W3C XLink version 1.1 instead of the OGC-specific XLink XML Schema implementation. See my previous post at for details on the reasons behind this pretty large-scale change.

Basically the change is quite a simple one:

  • all existing OGC standards that reference the OGC XLink shall be updated to reference the W3C XLink 1.1 schema and
  • going forward any new standards work shall only reference the W3C XLink schema.

By far the most used XLink attribute in OGC schemas is the locator attribute xlink:href, which contains an URL pointing to a link between two XML documents. In the XML Schema documents, the XLink href attribute is usually included in a complex type by adding an attribute group named simpleLink. In schemas using GML this is often done indirectly by using a pre-defined gml:AssociationAttributeGroup:

<complexType name="ReferenceType">
    gml:ReferenceType is intended to be used in application schemas directly,
    if a property element shall use a "by-reference only" encoding.
  <attributeGroup ref="gml:OwnershipAttributeGroup"/>
  <attributeGroup ref="gml:AssociationAttributeGroup"/>

The gml:AssociationAttributeGroup GML 3.2.1 (before the XLink corrigendum) in turn refers to the simpleLink attribute group defined in the XLink namespace:

<attributeGroup name="AssociationAttributeGroup">
    XLink components are the standard method to support hypertext referencing in XML. An XML Schema 
    attribute group, gml:AssociationAttributeGroup, is provided to support the use of Xlinks as 
    the method for indicating the value of a property by reference in a uniform manner in GML.
  <attributeGroup ref="xlink:simpleLink"/>
  <attribute name="nilReason" type="gml:NilReasonType"/>
  <attribute ref="gml:remoteSchema">

In non-corrected GML 3.2.1 schema files the XLink namespace is imported from the OGC version of the XLink schema:

<import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd"/>

In this file the simpleLink attributeGroup is defined like this:

<attribute name="href" type="anyURI"/>
<attributeGroup name="simpleLink">
  <attribute name="type" type="string" fixed="simple" form="qualified"/>
  <attribute ref="xlink:href" use="optional"/>
  <attribute ref="xlink:role" use="optional"/>
  <attribute ref="xlink:arcrole" use="optional"/>
  <attribute ref="xlink:title" use="optional"/>
  <attribute ref="xlink:show" use="optional"/>
  <attribute ref="xlink:actuate" use="optional"/>

The thing that will change in July 2012 is all the schema files of all affected OGC standards will modified to point to the W3C official XLink 1.1 schema available at http://www.w3.org/XML/2008/06/xlink.xsd. The href attribute definition in the W3C XLink schema is only slightly different from the OGC version:

<xs:attribute name="href" type="xlink:hrefType"/>
<xs:simpleType name="hrefType">
  <xs:restriction base="xs:anyURI"/>
<xs:attributeGroup name="simpleAttrs">
  <xs:attribute ref="xlink:type" fixed="simple"/>
  <xs:attribute ref="xlink:href"/>
  <xs:attribute ref="xlink:role"/>
  <xs:attribute ref="xlink:arcrole"/>
  <xs:attribute ref="xlink:title"/>
  <xs:attribute ref="xlink:show"/>
  <xs:attribute ref="xlink:actuate"/>

This means that all XML files using xlink:href attribute valid against the OGC XLink schema are also valid against the W3C XLink 1.1 schema. However because the attribute group “simpleLink” in the OGC schema is called “simpleAttrs” in the W3C schema, the XML schema files using this attribute group will no longer be valid after the change. To fix this all the schema files using the “simpleLink” attribute group will have to be changed to use the “simpleAttrs” instead.

This change has to be done simultaneously to as many schema files as possible, because the XML validators become confused if they encounter two different schema versions of the same XML namespace. In addition to the OGC’s schema files, the same change should also be done to any other schemas using the OGC version of the XLink schema available at http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd. To force the users to do this change, the OGC Architecture Board has decided to remove the OGC XLink schema file along with the other schema changes.

According to a mailing list post by Carl Reed, the CTO of the OGC, on 12th April 2012, at least the following OGC standards are affected by this change:

  • All versions of WM context
  • All versions of GML since version 2.0.0
  • All profiles of GML since 2.0.0
  • Image CRSs
  • All versions of OpenLS since version 1.1.0
  • All versions of OWS Common since 1.0.0
  • Symbology Encoding 1.0
  • All versions of SLD since 1.0.0
  • All versions of SensorML (including 2.0)
  • All versions of SWE Common
  • Table Join Service
  • All versions of Web Coverage Service
  • Web Feature Service 2.0
  • Web Map Service 1.3
  • WMTS
  • Web Processing Service

There are probably other schemas and standards in addition to this list because the schemas are inter-linked. Especially the different version of GML are used in many other OGC schemas.

Further quoting the announcement from Carl Reed about the OGC actions to be taken:

The target date for implementing change is the weekend of July 21, 2012.

The process will be:

  • Scan schema repository for import of xlink to find a list of standards that use xlink.
  • Also scan for strings such as Gml:ReferenceType to find other possible places that xlink is required.
  • Whatever schema uses any of XLink schema components will need to replace the schema location. We need to do this for all schemas that import xlink. All these changes will be done to a copy of the existing OGC schema repository.
  • For software developers, they need to patch their products to use the revised OGC schemas.
  • Everyone will need to delete local copies, get a new copy from the OGC schema repository, and use the new schemas. There is also the possibility to use a tool such as the OASIS XML Catalogue to override the required change and to continue using the old XLink.
  • In July, we will then issue one global corrigendum for all the affected standards. Essentially, the current OGC schema repository will be replaced with the schemas that have been changed (and tested). The actual standards documents will not change – only the schemas. OGC policy is that the schemas are normative and that if there are differences between a standards document and a schema, then the schemas are normative.

This is pretty much the approach I expected the OGC to take when I wrote about this in January.

If you are running or developing software dealing with OGC compliant data or services you really should check that it will still work with the modified versions of the schema files. You can begin testing your software as soon as the modified OGC schema files are made available in the alternative OGC schema repository. One of the simplest ways to test this is to use the OASIS XML Catalog to temporarily redirect the requests for the schema files of the modified standards’ namespaces to the alternative OGC schema locations. If your software supports the XML Catalog a catalog.xml file with directives something like the following should do the trick (assuming that the modified OGC schemas would be made available under the domain alternative.schemas.opengis.net):

<!DOCTYPE catalog
  PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
  <rewriteURI uriStartString="http://schemas.opengis.net/gml/"
		rewritePrefix="http://alternative.schemas.opengis.net/gml/" />
  <rewriteURI uriStartString="http://schemas.opengis.net/wfs/"
		rewritePrefix="http://alternative.schemas.opengis.net/wfs/" />
  [etc for all affected standards]

When an XML validator using this catalog needs to fetch any xml files from URLs beginning with “http://schemas.opengis.net/gml/” it will try to fetch them from “http://alternative.schemas.opengis.net/gml/” instead. The benefit from this approach is that you will be able to simulate schema switch-over well before the actual change in July without making any changes to your code or data files.

You can also use the XML Catalog if you find that you must delay the schema changes for your local system. To do this you can take local copies from the unmodified OGC schema files and create another set of rewriteURI directives. Assuming that the local schema files are stored under /etc/xml/schemas/original/ogc/:

<!DOCTYPE catalog
  PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
  <rewriteURI uriStartString="http://schemas.opengis.net/gml/"
		rewritePrefix="file:///etc/xml/schemas/original/ogc/gml/" />
  <rewriteURI uriStartString="http://schemas.opengis.net/wfs/"
		rewritePrefix="file:///etc/xml/schemas/original/ogc/wfs/" />

What is an O&M Observation and why should you care?

Observations & Measurements (O&M) is an international standard for modeling observation events and describing their relations to the target spatial objects under observation, the measured properties & measurement procedure, and the captured data resulting from those observation events. It’s based on Geography Markup Language (GML), another standard by the Open Geospatial Consortium (OGC) enabling a common base for it’s notation of location based information.

In addition to the most obvious cases of representing records of scientific measurement data, the O&M model is also used for modeling predicted information like weather forecasts. Because of it’s general ability to model perceived values of spatial objects’ properties at specific times, it’s a good fit for many kinds of application domains where it’s necessary to capture time-based changes on objects of interest.

The basic O&M observation event concepts.

The O&M conceptual model is published both as an Open Geospatial Consortium (OGC) Abstract Specification Topic 20 and as an ISO standard with number ISO/DIS 19156. The XML implementation of O&M model is also an OGC standard “Observations and Measurements – XML Implementation“. The origins of the O&M is in the Sensor Web Enablement (SWE) initiative of the OGC. It was needed as the common standardized data model for handling the measurement events occurring in different kinds of sensors from thermometers inside an industrial process to satellites taking images of the Earth from the space. Together with other SWE framework open standards like SensorML and Sensor Observation Service (SOS), O&M provides a system-independent, Internet-enabled ways of data exchange between different parts of sensor networks and other systems using the captured sensor information.

Even though the O&M model was originally created for modeling measurement acts that have already happened, there is no technical difficulty in using the same model also for describing acts of estimating the values of some properties of spatial objects at some point in the future. After all, event the most precise measurements are still only estimations of the actual properties of the target objects, limited by the method and the tools used, as well as our capabilities of interpreting the measurement results. The captured data itself is often very similar in both measurement and prediction cases, so it makes sense to try to store and deliver those data sets using the the same basic concepts.

One of the facts that makes the O&M model interesting right now is the increasing affordability of IP-based environmental sensors: these days almost anyone can afford to buy a basic weather observation station, place it in their backyard, and plug it in the Internet for sharing the data with others. Or buy an Internet-connected web camera. This also means that it’s becoming possible for anyone to gather and refine detailed environmental information about the world around us, both locally and globally. What used to the playground of the big, closed national and international institutes and governmental offices, is now opening up also to ordinary citizens. Of course this also means, like in everything based on the Internet, that as the amount of information and the heterogeneity of the sources producing it grows, the quality range of the available information also inevitably becomes wider.

The Sensor Web movement is so promising that also the organizations that used to deploy and maintain their own sensor networks with their proprietary data and control interfaces built for their specific software and hardware systems, are moving towards these open standards. Even though they might not put their data publicly in the Internet, they definitely want to take advantage of the IP-based networks for communicating, and they’s love to be able to easily switch between two sensor equipment boxes made by different vendors in plug-and-play fashion. The extra network traffic caused by a higher level communication protocols and more verbose content encoding is less and less of an issue in this ever more broadband world of ours.

Still, it would be nice if the increasing amounts of sensor data collected by publicly funded organizations would also be made available to the public, wouldn’t it? In many cases it already is available for someone who knows where to ask. Sometimes it’s even freely available in the Internet, like the various public web cams, but mostly it’s still accessible only to professionals. This is bound to change gradually however as international legislation aiming at data opening and harmonization, like the EU INSPIRE directive in Europe, is being implemented around the world. The O&M concepts form the basis of the EU-widely harmonized INSPIRE data models for meteorological, climatological and air quality information, as well as for physical oceanographic measurement data and the structure and the capabilities of the various environmental observation networks. This basically means that in the near future the ordinary citizens will be able to access the environmental data provided by the government officials in pretty much using the same protocols and data formats that they’re used to while accessing their neighbor’s off-the-self sensor equipment. Ain’t that cool?

I’m currently involved in the international expert teams on behalf of our customer the Finnish Meteorological Institute for creating the data specifications and writing guidelines for some of the O&M based INSPIRE data sets. We’re currently finalizing our work on the guidelines documents, but the actual work to make the INSPIRE spatial data infrastructure reality goes on of course. Fortunately there are deadlines: initial bunch of the view and download services for these INSPIRE data sets should be publicly available in May 2013, and even the last bits should be fully in INSPIRE compliant shape by 2020.

OGC W3C XLink transition: A potential validity breaker

XLink is a widely used W3C standard for creating links between XML documents or fragments inside those documents, similar to HTML a tag. The problem is that for historical reasons there several slightly different XML Schema grammar definitions for the same XLink namespace “http://www.w3.org/1999/xlink” published by different standardization authorities, like World Wide Web Consortium (W3C), Open Geospatial Consortium (OGC), Organization for the Advancement of Structured Information Standards (OASIS) and XBRL International (XBRL stands for eXtensible Business Reporting Language).

Two different XML Schema versions for the same namespace = trouble

If your software is using XML documents referring to different versions of XML Schema files for the same namespace, you are heading for trouble: A well-behaving, validating XML parser will probably only load the XML Schema files once for each namespace, meaning that it will use different schema files for validating XLinks depending on the order in which it happens to read the input XML files. If this happens, there is a high probability that part of your XML files will not validate if parsed together, even though they will if parsed separately.

It could also happen that an XML parser caches the downloaded XML Schema files locally to avoid excess network traffic and thus improve it’s parsing efficiency. Say that your software first validates a bunch of XBRL 2.1 documents, and caches the schema file XBRL schema refers to as the definition of the XLink namespace. Then the same software tries to validate a GML 3.2 document. When the parser notices that the XLink schema is also used in the GML schema files (AssociationAttributeGroup), it will not download the referred OGC XLink schema, but use the cached XBRL version instead. This will result in validation error, because the attributeGroup named “xlink:simpleLink” used by the GML schema does not exist in the XBRL version of the XLink schema. So one day the same files do validate, the other day they do not.

XLink in OGC standards

The W3C Xlink 1.0 version published in June 2001 was accompanied with only the DTD version of the defined linking attributes, and the users of XML Schema language were left on their own (probably because the W3C XML Schema 1.0 had only just been published at the time). The OGC version of the XLink XML Schema file was always meant to be a temporary measure, to be replaced by an official W3C version when one would become available. Unfortunately W3C XLink Schema version eventually published in May 2010 along with the standard version 1.1, was not exactly the same as the OGC version, a decision which is now causing a major headache for the OGC.

The differences between the two are quite small, but irritating. Both versions use almost identical definitions for the XLink attributes (href, type, role etc.), but they have grouped the typical sets of these attributes using different group names: the OGC XLink schema has an attributeGroup named “simpleLink” where as in the W3C XLink 1.1 schema the corresponding attribute groups is called “simpleAttrs”. Both contain the same set of attributes: the mandatory “type” and “href”, and the optional “role”, “arcrole”, “title”, “show” and “actuate”. This means that the actual XML documents using either version of these XML Schema files do validate against the other schema, but the XML Schema files containing references to these named attribute groups will not.

As an example, to make the GML 3.1.1 to use the W3C XLink schema, in addition to changing the schemaLocation attribute to point from the OGC schema repository to the W3C one, all references to the attribute group “simpleLink” would have to be changed to “simpleAttrs”. For GML 3.2.1 the problem is even somewhat more complicated, because it refers to the XML schemas for the ISO standard 19139 “Geographic information — Metadata — XML schema implementation” a.k.a GMD, which too are currently pointing the the OGC version of the XLink XML Schema.

OGC is moving towards W3C XLink 1.1

This issue has been acknowledged by the OGC, and as far as I know, they are currently taking action in moving from using their own version of XLink schema into using the W3C XLink version 1.1. That said, the OGC has not yet officially declared how and when the changes will be made, but it seems obvious that they will require changes to the existing XML Schema files for published OGC standard versions stored in the OGC XML Schema repository. Because it’s commonplace, and even recommended, to make local copies of the XML Schema files for making XML validation more efficient and robust, this would mean that there would be different versions of the OGC standard XML schema files out there, until everybody would replace their local versions with the modified ones. Needless to say, this kind of maneuver needs careful planning and efficient communication to all the OGC standard users around the world, to minimized the problems during the transition period.

So why would OGC risk making such change to the XML Schema files of the published standards? Why not just do the change to the new versions of the standard and leave the existing standards to use the OGC version of the XLink schema? So for example the GML 4.0 would to the transition from the OGC XLink into the W3C XLink definition, while the GML 3.3 as well as all the other published OGC standard versions would still use the OGC XLink schema.

The problem is that hanging on to both versions of the XLink schema would probably cause even more trouble for the XML validators than trying to change all the schemas simultaneously: it would increase the probability of a validator encountering different XLink schema versions, and there would be no end to this misery in sight. It might also happen that even newly created XML languages would start using the OGC XLink schema, because they would want to be schema compatible with the older OGC standards. So the only way to eventually make the nuisance disappear, would be to abandon the OGC version of the Xlink schema once and for all.

Prepare for the change

As mentioned, the OGC is still planning the best way to make the XLink transition as smooth as possible for all OGC standards users. If they do decide to go for the full-scale, once-and-for-all transition my personal guess is that something like this will happen:

  • All the OGC standards using the OGC version of the XLink Schema files will be listed, and they will be converted to using the W3C XLink 1.1 Schema. The namespaces of these changed schema versions would be left unchanged, but they would initially be published in a dedicated, temporary schema repository.
  • The users of those standards are urged to test their systems by using the alternative, modified versions of those OGC Schemas instead of the OGC official versions, for validating their documents. One way to do this is to use XML Catalog technique instructing the XML validators to retrieve the schema files for those specific namespaces from an alternative URL address. The main purpose of this testing period is to reveal possible compatibility problems with other XML schema languages using a non-W3C version of XLink: It could well be that some other schemas used for XML validation by the same parsers no longer validate after the OGC XLink schema is no longer available. The pre-configured XML Catalog file could be provided by the OGC to ease the transition.
  • A hard transition day would be announced by the OGC: on that day (or night, more likely) all the affected OGC schema files in the official will be replaced by the modified versions pointing to the W3C XLink Schema only. At the same time the OGC XLink Schema file would probably be removed from the OGC schema repository. The users should take action to ensure that their systems no longer point to the old OGC schema versions of the OGC XLink schema from that point on, and that the possible local versions of the changed schemas are replaced with the new ones.
  • The files in the temporary schema repository may co-exist for some (pre-announced) time after the transition date. This gives the XML Catalog users more time to update the URLs of the modified Schema files from the temporary location (back) to the official location.

In general organizations should not publish an XML Schema for the namespace they do not own, because the governance of such schemas becomes complicated: if the owner of the namespace (w3c in this case) decides to make a change to it’s schemas, it might not be able to do so because the other organization “hosting” the schemas does not want to or is unable to make those changes. The case of W3C and OGC XLink schemas is a perfect example of the problems even a slight lack of coordination in such issues may cause.

Edit 27th Jan: Carl Reed, the CEO of OGC confirmed to me yesterday that there will be official OGC announcement considering the problem as well as actions to be taken “in the next month or so”. The actual transition day is expected in late summer to early autumn this year.

Edit 13th April: The OGC Architecture Board has to make the XLink schema switch-over in July 2012, most likely during the weekend of 21st July. See my follow-up post for more information.