Schematron document structure improvements

22 Copyright © 2011 Open Geospatial Consortium pattern rule context = nas:AircraftHangar assert test = nas:address AddressReq: Building assert rule rule context = nas:AircraftHangar assert test = notnas:featureFunctionnas:valuesOrReason or notnas:featureFunctionnas:valuesOrReason[. = aircraftRepair and . = airTransport and . = cargoHandling and . = diningHall and . = dormitory and . = emergencyOperations and . = emergencyShelter and . = meetingPlace and . = outPatientCare and . = warehousingStorage] FeatureFunction: AircraftHangar assert rule rule context = nas:AircraftHangar assert test = notnas:verticalConstMaterialnas:valuesOrReason or notnas:verticalConstMaterialnas:valuesOrReason[. = adobeBrick and . = brick and . = concrete and . = masonry and . = metal and . = prestressedConcrete and . = reinforcedConcrete and . = steel and . = wood] VertConstMaterial: AircraftHangar assert rule rule context = nas:AircraftHangar assert test = nas:verticalConstMaterial VertConstMaterialReq: AircraftHangar assert rule …. pattern As it turned out this simple structure is not optimal, because the rules of Schematron demand that the rules belonging to one pattern are treated in an “if … then … else if … else if …” fashion. In the Schematron standard you find the statements:

6.5 Order and side-effects

… The only elements for which order is significant are the rule and let elements. A rule element acts as an if-then-else statement within each pattern. An implementation may make order non-significant by converting rules context expressions to elaborated rule context expressions 3 . This means that in executing a pattern on a single element instance, the instance bubbles down the rules of the pattern, until it finds a match on the context. The asserts in this rule are executed and the rest of the remaining rules are discarded. In the way patterns were structured in OWS-7, this means that for one particular feature type nas:AircraftHangar in the example, only the first rule would apply, which is quite unfortunate. Therefore, the Schematron pattern structure has been changed and has been made available to OWS-8. In the new structure there is only one rule for each feature type 3 An elaborated rule context expression is one, which does not match any of the context expressions in other rules. The “if then else if” logic does not apply to such elaborated contexts because the all match something different. Copyright © 2011 Open Geospatial Consortium 23 and all asserts corresponding to the OCL constraints belonging to that feature type are now gathered in one rule. The following Schematron snippet shows the difference: pattern rule context = nas:AircraftHangar assert test = nas:address AddressReq: Building assert assert test = notnas:featureFunctionnas:valuesOrReason or notnas:featureFunctionnas:valuesOrReason[. = aircraftRepair and . = airTransport and . = cargoHandling and . = diningHall and . = dormitory and . = emergencyOperations and . = emergencyShelter and . = meetingPlace and . = outPatientCare and . = warehousingStorage] FeatureFunction: AircraftHangar assert assert test = notnas:verticalConstMaterialnas:valuesOrReason or notnas:verticalConstMaterialnas:valuesOrReason[. = adobeBrick and . = brick and . = concrete and . = masonry and . = metal and . = prestressedConcrete and . = reinforcedConcrete and . = steel and . = wood] VertConstMaterial: AircraftHangar assert assert test = nas:verticalConstMaterial VertConstMaterialReq: AircraftHangar assert rule …. pattern In the new document structure all Schematron assertions derived from OCL constraints for one feature type are applied to each feature instance. This is in contrast to the former behavior where only the first rule in the pattern was effective.

6.4.6 Additional assertions on code list values and constraints

6.4.6.1 Target encoding: GML 3.3

If the code list classifier has a tagged value codeList {codeList} then the following assertion is added to the Schematron schema in the context of the property: starts-with.xlink:href,{codeList} To test the existence of the code list value the following assertion is added to the Schematron schema in the context of the property: not containsxlink:href, and document.xlink:href or containsxlink:href, and documentsubstring- before.xlink:href,idsubstring-after.xlink:href, In addition, we can assert that the remote resource has the correct element based on its representation. For applicationgml+xml;version=3.2 the default we expect a gml:Definition: not containsxlink:href, and document.xlink:hrefgml:Definition or