
Chương 4. Bộ lọc (Filter)
80
<xsd:extension base="ogc:ComparisonOpsType">
<xsd:sequence>
<xsd:element ref="ogc:PropertyName"/>
<xsd:element ref="ogc:Literal"/>
</xsd:sequence>
<xsd:attribute name="wildCard"
type="xsd:string" use="required"/>
<xsd:attribute name="singleChar"
type="xsd:string" use="required"/>
<xsd:attribute name="escape" type="xsd:string"
use="required"/>
</x sd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="PropertyIsNullType">
<xsd:complexContent>
<xsd:extension base="ogc:ComparisonOpsType">
<xsd:choice>
<xsd:element ref="ogc:PropertyName"/>
<xsd:element ref="ogc:Literal"/>
</xsd:choice>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="PropertyIsBetweenType">
<xsd:complexContent>
<xsd:extension base="ogc:ComparisonOpsType">
<xsd:sequence>
<xsd:element ref="ogc:expression"/>

Chương 4. Bộ lọc (Filter)
81
<xsd:element name="LowerBoundary"
type="ogc:LowerBoundaryType"/>
<xsd:element name="UpperBoundary"
type="ogc:UpperBoundaryType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="LowerBoundaryType">
<xsd:choice>
<xsd:element ref="ogc:expression"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="UpperBoundaryType">
<xsd:sequence>
<xsd:element ref="ogc:expression"/>
</xsd:sequence>
</xsd:complexType>
Ngoài các phép toán so sánh chuẩn (=, >, <, >=, <=, <>), còn có các phép toán
khác là <PropertyIsLike>, <PropertyIsBetween> và <PropertyIsNull>
Phép toán <PropertyIsLike> được dùng để so sánh 1 chuỗi với 1 khuôn mẫu
nào đó. Một mẫu được định nghĩa bởi sự kết hợp của các kí tự thông thường như
các kí tự wildCard, singleChar, escapeChar. Kí tự wildCard được dùng để tượng
trưng cho 1 nhóm các kí tự hoặc là không có kí tự nào. Kí tự singleChar dùng để
tượng trưng cho 1 kí tự duy nhất. Kí tự escapeChar được dùng loại bỏ ý nghĩa của
các kí tự singleChar, wildCard và kể cả chính nó.

Chương 4. Bộ lọc (Filter)
82
Thành phần <PropertyIsNull> được dùng để kiểm tra xem giá trị trong nội
dung của nó có rỗng hay không. Giá trị 0 là giá trị khác rỗng.
Thành phần <PropertyIsBetween> được dùng để kiểm tra xem 1 giá trị có nằm
trong 1 khoảng được chỉ ra bởi 2 thành phần là <LowerBoundary> và
<UpperBoundary> hay không.
4.6. Các phép toán Logic
4.6.1. Giới thiệu:
Các phép toán logic được dùng để kết hợp các biểu thức điều kiện lại với nhau.
Phép toán AND sẽ có giá trị là TRUE nếu như tất cả các phép toán kết hợp có giá trị
là TRUE. Phép toán OR sẽ có giá trị là TRUE nếu như có ít nhất 1 phép toán trong
số các phép toán kết hợp có giá trị là TRUE. Phép toán NOT dùng để đảo ngược kết
quả của 1 biểu thức.
4.6.2. Mô tả:
Dưới đây là đoạn lược đồ XML mô tả các phép toán so sánh này:
<xsd:element name="And" type="ogc:BinaryLogicOpType"
substitutionGroup="ogc:logicOps"/>
<xsd:element name="Or" type="ogc:BinaryLogicOpType"
substitutionGroup="ogc:logicOps"/>
<xsd:element name="Not" type="ogc:UnaryLogicOpType"
substitutionGroup="ogc:logicOps"/>
<xsd:element name="logicOps" type="ogc:LogicOpsType"
abstract="true"/>
<xsd:complexType name="LogicOpsType" abstract="true"/>
<xsd:complexType name="BinaryLogicOpType">
<xsd:complexContent>
<xsd:extension base="ogc:LogicOpsType">
<xsd:choice minOccurs="2"
maxOccurs="unbounded">

Chương 4. Bộ lọc (Filter)
83
<xsd:element ref="ogc:comparisonOps"/>
<xsd:element ref="ogc:spatialOps"/>
<xsd:element ref="ogc:logicOps"/>
</xsd:choice>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="UnaryLogicOpType">
<xsd:complexContent>
<xsd:extension base="ogc:LogicOpsType">
<xsd:sequence>
<xsd:choice>
<xsd:element
ref="ogc:comparisonOps"/>
<xsd:element ref="ogc:spatialOps"/>
<xsd:element ref="ogc:logicOps"/>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Các thành phần <And> , <Or> hay <Not> được dùng để kết hợp các biểu thức
logic, biểu thức không gian hay biểu thức vô hướng để tạo ra 1 biểu thức kết hợp
phức tạp.
4.7. Định danh của Feature (Feature Identifier):
4.7.1. Giới thiệu:
Một định danh của Feature được dùng để chỉ 1 Feature địa lý cụ thể trong ngữ
cảnh của dịch vụ web chứa Feature này.

Chương 4. Bộ lọc (Filter)
84
4.7.2. Mô tả:
Thành phần <FeatureId> được mô tả bởi đoạn lược đồ XML sau:
<xsd:element name="FeatureId" type="ogc:FeatureIdType"/>
<xsd:complexType name="FeatureIdType">
<xsd:attribute name="fid" type="xsd:anyURI"
use="required"/>
</xsd:complexType>
Thành phần <FeatureId> được dùng để chỉ ra các Feature trong 1 biểu thức
Filter hoặc tong các tài liệu XML khác.
4.8. Biểu thức (Expressions):
4.8.1. Giới thiệu:
Một biểu thức là 1 sự kết hợp của 1 hoặc nhiều biểu tượng (symbol) và cho kết
quả là TRUE hoặc là FALSE.
4.8.2. Mô tả:
Một biểu thức có thể được tạo nên bởi các thành phần sau đây:
<Add>, <Sub>, <Mul>, <Div>, <PropertyName>, <Literal> và <Function>.
4.9. Các phép toán số học:
4.9.1. Giới thiệu:
Các thành phần được đề cập trong phần này gồm có các phép toán cộng, trừ,
nhân, chia…. Đây là các phép toán 2 ngôi, nhận 2 tham số và trả về 1 kết quả.
4.9.2. Mô tả:
Dưới đây là đoạn lược đồ XML mô tả các phép toán này:
<xsd:element name="Add"
type="ogc:BinaryOperatorType"
substitutionGroup="ogc:expression"/>
<xsd:element name="Sub"
type="ogc:BinaryOperatorType"
substitutionGroup="ogc:expression"/>