[mapserver-users] Interpretation of OGC filter encoding
Eichner, Andreas - SID-NLKM
Andreas.Eichner at sid.sachsen.de
Mon Jan 25 09:04:37 EST 2010
while reading the OGC filter encoding specification I was wondering how
the part about properties should be interpreted. I thought it would be a
good idea to ask other users about their thoughts and may be one or the
other hacker has an eye on the list too...
The specs states in part 6 Properties that "The <PropertyName> element
is used to encode the name of any property of an object." and that "a
filter expression processor must use the subset of XPath 
expressions defined in this document" Those expressions are basically
relative location paths using abbreviated sytnax and "5. Each step in
the path may optionally contain a predicate composed of the predicate
delimiters '[' and ']' and a number indicating which child of the
context node is to be selected."
The example with the Person feature type shows two <phone> elements:
<myns:spouse SIN="444555666" />
What would happen if I use a filter like:
<PropertyIsLike escapeChar="!" singleChar="?" wildCard="*"
Since the XPath given in the PropertyName addresses more than one
element, how should the filter work? Does it select any feature
containing at least one phone element with content matching the pattern
and therefore being a SQLish filter? Or does it work like the
string/number/boolean functions from the XPath spec and convert the
first node in document order which would be the concatenation of every
descendant text node of the first phone element (in the example exactly
one but the mailAddress element's value would be "\n \n Main St.\n
5\n SomeCity\n SomeProvince\n X1X 1X1\n Canada\n
\n"). Or should a predicate of "" be implied?
I believe the SQLish behaviour is better usable but the XPath one does
more conform to the XML-based standards. I checked the specs again and
again but couldn't find any hint how that should be handled neither
within the "6. Properties" section nor within the sections dealing with
This fuzzy definition of a "Property" becomes a big problem when dealing
with SQL data mapped to XML especially if you try to build SQL filters
out of the OGC filters...
If there are any thoughts, please let me know.
More information about the mapserver-users