Implementation of a Content Process “lax” function Element for AASG Schemas

Discussion of using the “lax” function in Schema Documents

We’ve recently changed how we are structuring our XSD schemas by adding a “lax” process function element at the end of the sequence.  The ‘lax’ function, or ‘any Element’ function, can be specified by the author of the schema document, and enables additional elements not specified by the schema to be included.

An example of the syntax for the ‘any Element’ function is below.

<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> 

The benefit of adding a ‘lax’ function to your schema is that the data provider is no longer limited by the geometry elements automatically generated when processing spatial data or during service deployment. The data provider generally has little or no control over these additional fields, how they are named, or how they are displayed.  An example of where this occurs is when deploying a line or polygon feature service, including geologic fault data, contour data or geologic map polys in ArcGIS. 

The ‘lax’ function allows a feature service to be valid, even if the geometry fields are not uniform across services using the same schema.

The ‘new and improved’ Quaternary (Active) Fault Schema Below

<?xml version="1.0" encoding="utf-8"?>

<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:aasg="http://stategeothermaldata.org/uri-gin/aasg/xmlschema/activefault/1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://stategeothermaldata.org/uri-gin/aasg/xmlschema/activefault/1.1" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.01">

                <import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>

                <annotation>

                                <!-- This XSD document, including XML schema, indicates the content requested for quaternary (active) fault data obtained from state geological surveys for the AASG geothermal data project.  Typically movements are recorded from field observations and measurements; this information will be provided through an active fault service. The SpecificationURI for a particular fault (is the link (foreign key) used to associate the feature with additional information and metadata.  Each measurement should have a unique FeatureURI. -->

                                <!--This XSD document was created on 2012-24-02 by Celia Coleman, AZGS.  This schema is based on the data available in the AASG Web Feature Services created for the active faults in Arizona and California. -->

                </annotation>

                <element name="ActiveFault" type="aasg:ActiveFaultType" substitutionGroup="gml:_Feature"/>

                <complexType name="ActiveFaultType">

                                <complexContent>

                                                <extension base="gml:AbstractFeatureType">

                                                                <sequence>

                                                                                <element name="FeatureURI" type="xs:string"/>

                                                                                <element name="Name" type="xs:string"/>

                                                                                <element name="FullName" type="xs:string" minOccurs="0"/>

                                                                                <element name="ParentFeatureURI" type="xs:string" minOccurs="0"/>

                                                                                <element name="Label" type="xs:string"/>

                                                                                <element name="Description" type="xs:string" minOccurs="0"/>

                                                                                <element name="Symbol" type="xs:string"/>

                                                                                <element name="OtherID" type="xs:string" minOccurs="0"/>

                                                                                <element name="SpecificationURI" type="xs:string" minOccurs="0"/>

                                                                                <element name="FeatureType" type="xs:string"/>

                                                                                <element name="GeologicHistory" type="xs:string" minOccurs="0"/>

                                                                                <element name="RepresentativeAgeURI" type="xs:string" minOccurs="0"/>

                                                                                <element name="YoungerAgeURI" type="xs:string" minOccurs="0"/>

                                                                                <element name="OlderAgeURI" type="xs:string" minOccurs="0"/>

                                                                                <element name="IntervalSinceMovement" type="xs:string" minOccurs="0"/>

                                                                                <element name="ObservationMethod" type="xs:string" minOccurs="0"/>

                                                                                <element name="PositionAccuracyMeters" type="xs:double" minOccurs="0"/>

                                                                                <element name="PositionAccuracy" type="xs:string" minOccurs="0"/>

                                                                                <element name="Displacement" type="xs:string" minOccurs="0"/>

                                                                                <element name="SlipRate" type="xs:string" minOccurs="0"/>

                                                                                <element name="SlipAccumulationInterval" type="xs:string" minOccurs="0"/>

                                                                                <element name="MovementType" type="xs:string" minOccurs="0"/>

                                                                                <element name="MovementSense" type="xs:string" minOccurs="0"/>

                                                                                <element name="DipDirection" type="xs:string" minOccurs="0"/>

                                                                                <element name="DateMostRecentEvent" type="xs:string" minOccurs="0"/>

                                                                                <element name="RecurrenceInterval" type="xs:string" minOccurs="0"/>

                                                                                <element name="TotalSlip" type="xs:string" minOccurs="0"/>

                                                                                <element name="Source" type="xs:string"/>

                                                                                <element name="MetadataURI" type="xs:string" minOccurs="0"/>

                                                                                <element name="Shape" type="gml:MultiCurvePropertyType"/>

                                                                                <any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>

                                                                </sequence>

                                                </extension>

                                </complexContent>

                </complexType>

                <complexType name="ActiveFaultPropertyType">

                                <sequence minOccurs="0">

                                                <element ref="aasg:ActiveFault"/>

                                </sequence>

                </complexType>

</schema>