1、 INCITS/ISO 19143-2011 Geographic information Filter encoding INCITS/ISO 19143-2011 PDF disclaimer This PDF file may contain embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which are embedded are licensed
2、 to and installed on the computer performing the editing. In downloading this file, parties accept therein the responsibility of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Incorporated. Details of the s
3、oftware products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event that a problem relating to i
4、t is found, please inform the Central Secretariat at the address given below. Adopted by INCITS (InterNational Committee for Information Technology Standards) as an American National Standard. Date of ANSI Approval: 2/11/2011 Published by American National Standards Institute, 25 West 43rd Street, N
5、ew York, New York 10036 Copyright 2011 by Information Technology Industry Council (ITI). All rights reserved. These materials are subject to copyright claims of International Standardization Organization (ISO), International Electrotechnical Commission (IEC), American National Standards Institute (A
6、NSI), and Information Technology Industry Council (ITI). Not for resale. No part of this publication may be reproduced in any form, including an electronic retrieval system, without the prior written permission of ITI. All requests pertaining to this standard should be submitted to ITI, 1250 Eye Str
7、eet NW, Washington, DC 20005. Printed in the United States of America ii ITIC 2011 All rights reserved INCITS/ISO 19143-2011 ITIC 2011 All rights reserved iiiContents Page Foreword iv Introduction.v 1 Scope1 2 Conformance .2 3 Normative references3 4 Terms and definitions .3 5 Conventions.6 5.1 Abbr
8、eviated terms.6 5.2 UML notation7 5.3 Use of examples 8 5.4 Namespaces.8 5.5 KVP-encoded parameter lists 8 5.6 XML Schema fragments9 6 Query expressions 9 6.1 General .9 6.2 Abstract query expressions .9 6.3 Ad hoc query expression10 7 Filter13 7.1 General considerations.13 7.2 Encoding 14 7.3 Expre
9、ssions .14 7.4 Value references15 7.5 Literals17 7.6 Functions .18 7.7 Comparison operators19 7.8 Spatial operators .22 7.9 Temporal operators.26 7.10 Logical operators 28 7.11 Object identifiers .30 7.12 Extensions .31 7.13 Filter capabilities .33 7.14 Encoding 35 8 Sorting 42 8.1 General considera
10、tions.42 8.2 Encoding 42 8.3 Exceptions .43 Annex A (normative) Conformance testing44 Annex B (informative) Filter schema definitions .48 Annex C (informative) Examples .60 Annex D (informative) EBNF for XPath subset 80 Annex E (informative) Abstract model81 Bibliography82 INCITS/ISO 19143-2011 iv I
11、TIC 2011 All rights reservedForeword ISO (the International Organization for Standardization) is a worldwide federation of national standards bodies (ISO member bodies). The work of preparing International Standards is normally carried out through ISO technical committees. Each member body intereste
12、d in a subject for which a technical committee has been established has the right to be represented on that committee. International organizations, governmental and non-governmental, in liaison with ISO, also take part in the work. ISO collaborates closely with the International Electrotechnical Com
13、mission (IEC) on all matters of electrotechnical standardization. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of technical committees is to prepare International Standards. Draft International Standards adopted by the techni
14、cal committees are circulated to the member bodies for voting. Publication as an International Standard requires approval by at least 75 % of the member bodies casting a vote. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO sh
15、all not be held responsible for identifying any or all such patent rights. ISO 19143 was prepared by Technical Committee ISO/TC 211, Geographic information/Geomatics, in collaboration with the Open Geospatial Consortium Inc. (OGC). INCITS/ISO 19143-2011 ITIC 2011 All rights reserved vIntroduction Fi
16、lter encoding was originated within the OGC. A fundamental operation performed on a set of data or resources is that of querying in order to obtain a subset of the data which contains certain desired information that satisfies some query criteria and which is also, perhaps, sorted in some specified
17、manner. The term “projection clause” is used to describe an encoding for specifying which subset of resource properties are presented in the response to a query. The term “filter or selection clause” is used to describe an encoding of predicates which are typically used in query operations to specif
18、y how data instances in a source dataset should be filtered to produce a result set. Each data instance in the source set is evaluated using the filter expression. The overall filter expression always evaluates to true or false. If the expression evaluates to true, the data instance satisfies the ex
19、pression and is marked as being in the result set. If the overall filter expression evaluates to false, the data instance is not in the result set. Thus, the net effect of evaluating a filter expression is a set of data or resource identifiers which satisfy the predicates in the expression. The term
20、 “sorting clause” is used to describe an encoding for specifying how the data in a response is ordered prior to being presented. Such encodings are considered system neutral because using the numerous XML tools available today, XML encoded projection, selection and sorting clauses can be easily vali
21、dated, parsed and then transformed into whatever target query language is required to retrieve or modify resources stored in some persistent object store. For example an XML encoded query composed of a projection, selection and sorting clauses can be transformed into a SQL “SELECT FROM WHERE ORDER B
22、Y ” statement to fetch data stored in a SQL-based relational database. Similarly, the same XML encoded query expression can just as easily be transformed into an XQuery expression in order to retrieve data from XML document. The XML and KVP encodings of projection, selection and sorting clauses desc
23、ribed in this International Standard are common components which can be used together or as individually by a number of web services. Any service that requires the ability to query objects from a web-accessible repository can make use of the XML and KVP encodings of a query expression described in t
24、his International Standard. For example the GetFeature operation, defined in ISO 19142, uses the elements derived from definitions in this International Standard to encode query expressions. AMERICAN NATIONAL STANDARD INCITS/ISO 19143-2011 ITIC 2011 All rights reserved 1Geographic information Filter
25、 encoding 1 Scope This International Standard describes an XML and KVP encoding of a system neutral syntax for expressing projections, selection and sorting clauses collectively called a query expression. These components are modular and intended to be used together or individually by other standard
26、s which reference this International Standard. EXAMPLE 1 ISO 19142 makes use of some or all of these components. This International Standard defines an abstract component, named AbstractQueryExpression, from which other specifications can subclass concrete query elements to implement query operation
27、s. This International Standard also defines an additional abstract query component, named AbstractAdhocQueryExpresison, which is derived from AbstractQueryExpression and from which other specifications can subclass concrete query elements which follow the following query pattern: An abstract query e
28、lement from which service specifications can subclass a concrete query element that implements a query operation that allows a client to specify a list of resource types, an optional projection clause, an optional selection clause, and an optional sorting clause to query a subset of resources that s
29、atisfy the selection clause. This pattern is referred to as an ad hoc query pattern since the server is not aware of the query until it is submitted for processing. This is in contrast to a stored query expression, which is stored and can be invoked by name or identifier. This International Standard
30、 also describes an XML and KVP encoding of a system-neutral representation of a select clause. The XML representation is easily validated, parsed and transformed into a server-specific language required to retrieve or modify object instances stored in some persistent object store. EXAMPLE 2 An XML e
31、ncoded filter can be transformed into a WHERE clause for a SQL SELECT statement to fetch data stored in a SQL-based relational database. Similarly, and XML encoded filter expression can be transformed into an XPath or XPointer expression for fetching data from XML documents. This International Stand
32、ard defines the XML encoding for the following predicates. a) A standard set of logical predicates: and, or and not. b) A standard set of comparison predicates: equal to, not equal to, less than, less than or equal to, greater than, greater than or equal to, like, is null and between. c) A standard
33、set of spatial predicates: equal, disjoint, touches, within, overlaps, crosses, intersects, contains, within a specified distance, beyond a specified distance and BBOX. d) A standard set of temporal predicates: after, before, begins, begun by, contains, during, ends, equals, meets, met by, overlaps
34、and overlapped by. e) A predicate to test whether the identifier of an object matches the specified value. INCITS/ISO 19143-2011 2 ITIC 2011 All rights reservedThis International Standard defines the XML encoding of metadata that allows a service to declare which conformance classes, predicates, ope
35、rators, operands and functions it supports. This metadata is referred to as Filter Capabilities. 2 Conformance Few usage scenarios require the full implementation of this International Standard to work. Therefore, service providers may want to specify requirements for only the subset needed to fulfi
36、l their service. Or system developers may want to document which subset of this International Standard it is that that they have implemented and conform to. These named conformance classes help in specifying such subsets. This International Standard defines conformance classes based on the operation
37、s and behaviour that a filter encoding service claims to implement. Table 1 indicates which behaviour shall be implemented for each of the conformance classes. The described behaviour shall be implemented for the corresponding conformance class, and the name of the paragraph of the actual detailed a
38、bstract test suite in Annex A. Table 1 FE conformance classes Conformance class name Operation or behaviour Subclause of the abstract test suite Query Service that references this International Standard materializes a concrete query element that is substitutable for fes:AbstractQueryElement. A.1 Ad
39、hoc Query Service that references this International Standard materializes a concrete query element that is substitutable for fes:AbstractAdhocQueryElement and materializes a concrete selection clause element that is substitutable for fes:AbstractSelectionClause and materializes a concrete projectio
40、n clause element that is substitutable for fes:AbstractProjectionClause and materializes a concrete sorting clause element that is substitutable for fes:AbstractSortingClause. A.2 Functions Implements functions that are in addition to the operators defined in this International Standard. A.3 Resourc
41、e Identification Implements the ResourceId operator with the rid parameter to allow predicates to be written that allow a specific resource to be queried. A.4 Minimum Standard Filter Implements the comparison operators: PropertyIsEqualTo, PropertyIsNotEqualTo, PropertyIsLessThan, PropertyIsGreaterTh
42、an, PropertyIsLessThanOrEqualTo, PropertyIsGreaterThanOrEqualTo. Implements the logical operators. Does not implement any additional functions. A.5 Standard Filter Implements all the comparison and logical operators and may implement one or more additional functions. A.6 Minimum Spatial Filter Imple
43、ments only the BBOX spatial operator. A.7 Spatial Filter Implements the BBOX spatial operator and one or more of the other spatial operators. A.8 Minimum Temporal Filter Implements only the During temporal operator. A.9 Temporal Filter Implements the During temporal operator and one or more of the o
44、ther temporal operators. A.10 Version navigation Implements ResourceId operator with the parameters that allow versions of resources to be queried (version, startTime, endTime). A.11 Sorting Implements sorting of the resources in a response. A.12 Extended Operators Implements additional operators no
45、t defined in this International Standard. A.13 Minimum XPath Implements the minimum required set of XPath capabilities. A.14 Schema Element Function Implements the schema-element() XPath function. A.15 Other standards that include this International Standard shall declare what constitutes a “minimum
46、” filter by declaring the minimum set of conformance classes from Table 1 that shall be implemented. INCITS/ISO 19143-2011 ITIC 2011 All rights reserved 33 Normative references The following referenced documents are indispensable for the application of this document. For dated references, only the e
47、dition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. ISO 19108:2002, Geographic information Temporal schema ISO 19125-1:2004, Geographic information Simple feature access Part 1: Common architecture ISO 19136:2007, Geographic
48、 information Geography Markup Language (GML) IETF RFC 2396, Uniform Resource Identifiers (URN): Generic Syntax (August 1998) OGC 06-121r3, OGC Web Services Common Specification, OGC Implementation Specification (9 February 2009) W3C XML, Extensible Markup Language (XML) 1.0 (Third edition), W3C Reco
49、mmendation (4 February 2004) W3C XML, Namespaces, Namespaces in XML, W3C Recommendation (14 January 1999) W3C XML, Path Language, XML Path Language (XPath) 2.0, W3C Recommendation (23 January 2007) W3C XML, Schema Part 1, XML Schema Part 1: Structures, W3C Recommendation (2 May 2001) W3C XML, Schema Part 2, XML Schema Part 2: Datatypes, W3C Recommendation (2 May 2001) 4 Terms and definitions For the purposes of this document, the following terms a