Comprehensive conversion rules OCL to Schematron

24 Copyright © 2014 Open Geospatial Consortium class has been supplemented with additional code to perform the Schematron code generation on the basis of an OCL syntax tree generated by the new OCL 2.2 parser.

6.4 Validation using the NAS model

The OCL-to-Schematron translation process has been extensively tested on the NAS model. Following the necessary adaption of the already existing OCL constraints to the OCL 2.2 standard, many new OCL constraints have been added. These new OCL constraints cover nearly all of the cases in Annex B. New requirements have been detected during the validation process and have been implemented accordingly. The generated output documents, including error messages and Schematron code have been carefully reviewed and discussed by the participants. However, lacking corresponding GML instance documents of NAS data, neither the XML Schema representation nor the Schematron code has been tested against data instances.

6.5 Extensions implemented during the validation process

The validation process brought forward a couple of additional functional requirements. Most of these could be treated by extending the implementation of the OCL-to- Schematron translation in ShapeChange.

6.5.1 Nested error messages

The analysis of OCL invariants by the new OCL parser of ShapeChange frequently generates more than one error message for one OCL invariant. In the pre-OWS-7 version of ShapeChange this had been handled by first emitting an introductory message identifying the constraint and the class context, followed by one or more messages explaining the exact nature of the problems detected. Example: Error One or more errors encountered in OCL constraint in class Installation : LengthValMeta ... Error Error Linecolumns 6362: Unrecognized syntax [] encountered and ignored. Error Error Linecolumns 6483: Identifier, literal or bracketed expression expected preceding operator quot; = quot; token. Invalid assumed. Error Error Linecolumns 6485‐502: Closing bracket expected preceding identifier quot; VoidNumValueReason quot; token, assumed. Error Error Linecolumns 6485‐502: Extra tokens following OCL expression ignored, starting with identifier quot; VoidNumValueReason quot; . Error In analyzing the error reports from the OCL attached to NAS classes this format was deemed not sufficiently comprehendible. It was changed to a nested format as follows: