Extending the Common Catalogue Query Language

{commageometry literal} right paren Envelope Tagged Text ::= ENVELOPE Envelope Text Envelope Text := EMPTY | left paren WestBoundLongitudecomma EastBoundLongitudecomma NorthBoundLatitudecomma SouthBoundLatitude right paren WestBoundLongitude := signed numeric literal EastBoundLongitude := signed numeric literal NorthBoundLatitude := signed numeric literal SouthBoundLatitude := signed numeric literal date-time ::= full-date T UTC-time full_date ::= date-year - date-month - date-day date-year ::= digitdigitdigitdigit date-month ::= digitdigit date-day ::= digitdigit UTC-time ::= time-hour : time-minute : time-second Z time-hour ::= digitdigit time-minute ::= digitdigit time-second ::= digitdigit[.{digit}] duration ::= P dur-date | dur-time dur-date ::= dur-day | dur-month | dur-year [dur-time] dur-day ::= {digit} D dur-month ::= {digit} M [dur-day] dur-year ::= {digit} Y [dur-month] dur-time ::= T dir-hour | dur-minute | dur-second dur-hour ::= {digit} H [dur-minute] dur-minute ::= {digit} M [dur-second] dur-second ::= {digit} S period ::= date-time date-time | date-time duration | duration date-time

6.2.3 Extending the Common Catalogue Query Language

The Common Catalogue Query Language BNF can be extended by adding new predicates, operations, and datatypes. The following discussion is an example of extending the BNF to include a CLASSIFIED-AS operator using the patterns identified in OASISebXML Registry Services Specification v2.5. This extension could appear in a protocol binding or an Application Profile. This specification makes no assumptions about how taxonomies are maintained in a catalogue, or how records are classified according to those taxonomies. Instead, this specification defines a routine, CLASSIFIED-AS, in order to support classification queries based on taxonomies. 16 Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved. The CLASSIFIED-AS routine takes three arguments. The first argument is the abstract entry point whose classification is being checked. The second argument is the key name string that represents a path expression in the taxonomy. The last argument is the key value string that represents the corresponding path expression containing key values that are the targets of the query. In both cases, the first element of the path expression for the key name argument and key value arguments shall be the name of the taxonomy being used. The normal wildcard matching characters, ‘_’ for a single character and ‘’ for zero or more characters, may be used in the key value expression which is the last argument of the CLASSIFIED_AS routine. The following set of productions defines the CLASSIFIED-AS routine. The following example: RECORD CLASSIFIED AS CLASSIFICATIONSCHEME=’GeoClass’ =’GeoClassNorth AmericaOntario’ Will find all records in all the Ontario’s in North America. The following are the required BNF specializations: classop argument list ::= left paren entry_point comma Classification Scheme commaClassification Node right paren entry_point ::= identifier Classification Scheme ::= identifier classop name ::= CLASSIFIED_AS Classification Node ::= identifier | soliduspath element[soliduspath element]… path element ::= character pattern routine invocation ::= | geoop namegeoroutine argument list | relgeoop namerelgeoop argument list | routine nameargument list | classopclassop argument list Consider the following example: CLASSIFIED_ASRECORD, GeoClass, GeoClassNorthAmericaOntario In this example, we are searching records classified according to the GeoClass taxonomy. Specifically, we are looking for all catalogue records classified as Continent=NorthAmerica , Country=any country and State=Ontario. Notice how the wildcard character ‘’ is used to search for any Country node. Here is the same example encoded using XML: ogc:Filter xmlns:ogc=http:http:www.opengis.netogc ogc:ClassifiedAs ogc:TypeName csw:Record ogc:TypeName ogc:ClassificationScheme GetClass ogc:ClassificationScheme Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved. 17 ogc:ClassificationNode GeoClassNorthAmericaOntario ogc:Classific ationNode ogc:ClassifiedAs ogc:Filter In order for catalogue clients to be able to determine which taxonomies are available, a catalogue implementation should advertise the list of available taxonomies in its capabilities document. If a query is executed against a non-existent taxonomy, then an exception should be raised.

6.2.4 Query language realization