Chương 4. B lc (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 lc (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 chun (=, >, <, >=, <=, <>), còn có các phép toán
khác là <PropertyIsLike>, <PropertyIsBetween> <PropertyIsNull>
Phép toán <PropertyIsLike> được dùng để so sánh 1 chui vi 1 khuôn mu
nào đó. Mt mu được định nghĩa bi s kết hp ca 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 hoc là không có kí to. Kí t singleChar dùng để
tượng trưng cho 1 kí t duy nht. Kí t escapeChar được dùng loi b ý nghĩa ca
các kí t singleChar, wildCard và k c chính nó.
Chương 4. B lc (Filter)
82
Thành phn <PropertyIsNull> được dùng để kim tra xem giá tr trong ni
dung ca nó có rng hay không. Giá tr 0 là giá tr khác rng.
Thành phn <PropertyIsBetween> được dùng để kim tra xem 1 giá tr có nm
trong 1 khong được ch ra bi 2 thành phn là <LowerBoundary>
<UpperBoundary> hay không.
4.6. Các phép toán Logic
4.6.1. Gii thiu:
Các phép toán logic được dùng để kết hp các biu thc điu kin li vi nhau.
Phép toán AND s có giá tr là TRUE nếu như tt c các phép toán kết hp có giá tr
là TRUE. Phép toán OR s có giá tr là TRUE nếu như có ít nht 1 phép toán trong
s các phép toán kết hp có giá tr là TRUE. Phép toán NOT dùng để đảo ngược kết
qu ca 1 biu thc.
4.6.2. Mô t:
Dưới đây là đon 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 lc (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 phn <And> , <Or> hay <Not> được dùng để kết hp các biu thc
logic, biu thc không gian hay biu thc vô hướng để to ra 1 biu thc kết hp
phc tp.
4.7. Định danh ca Feature (Feature Identifier):
4.7.1. Gii thiu:
Mt định danh ca Feature được dùng để ch 1 Feature địa lý c th trong ng
cnh ca dch v web cha Feature này.
Chương 4. B lc (Filter)
84
4.7.2. Mô t:
Thành phn <FeatureId> được mô t bi đon 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 phn <FeatureId> được dùng để ch ra các Feature trong 1 biu thc
Filter hoc tong các tài liu XML khác.
4.8. Biu thc (Expressions):
4.8.1. Gii thiu:
Mt biu thc là 1 s kết hp ca 1 hoc nhiu biu tượng (symbol) và cho kết
qu là TRUE hoc là FALSE.
4.8.2. Mô t:
Mt biu thc có th được to nên bi các thành phn sau đây:
<Add>, <Sub>, <Mul>, <Div>, <PropertyName>, <Literal> và <Function>.
4.9. Các phép toán s hc:
4.9.1. Gii thiu:
Các thành phn được đề cp trong phn này gm có các phép toán cng, tr,
nhân, chia…. Đây là các phép toán 2 ngôi, nhn 2 tham s và tr v 1 kết qu.
4.9.2. Mô t:
Dưới đây là đon 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"/>