GeoServer

GeoServer KVP filter parser turns property filter into literal comparisons

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.6.3
  • Fix Version/s: None
  • Component/s: WFS
  • Labels:
    None
  • Number of attachments :
    0

Description

Trying to hit GeoServer with the following GetFeature:

http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&propertyName=STATE_NAME,PERSONS&filter=%3Cogc%3AFilter%20xmlns%3Aogc%3D%22http%3A//ogc.org%22%20xmlns%3Agml%3D%22http%3A//www.opengis.net/gml%22%3E%3Cogc%3APropertyIsEqualTo%3E%3Cogc%3APropertyName%3ESTATE_NAME%3C/ogc%3APropertyName%3E%3Cogc%3ALiteral%3ENew%20York%3C/ogc%3ALiteral%3E%3C/ogc%3APropertyIsEqualTo%3E%3C/ogc%3AFilter%3E%20

results in the FilterKVPParser successfully using the new XML filter parser, which in turn generates a IsEqualsTo implementation against two literals, "STATE_NAME" and "New York", instead of generating an IsEqualsTo between a property name and a literal.
Doing the same query with a POST request works fine. Wild guess is that the new parser may need to know the target feature type to properly parse this kind of filter?

Issue Links

Activity

Hide
Andrea Aime added a comment -

Hum, I found out what makes the new parser break, the ogc namespace is not properly declared:
http://www.opengis.org/ogc
instead of
http://www.opengis.net/ogc

Yet, the result of the parse is a valid filter, making it very hard to properly guess what's wrong in the filter. I'm wondering if we should just start shipping with strict parsing on, and allow for lax parsing as an option.

Show
Andrea Aime added a comment - Hum, I found out what makes the new parser break, the ogc namespace is not properly declared: http://www.opengis.org/ogc instead of http://www.opengis.net/ogc Yet, the result of the parse is a valid filter, making it very hard to properly guess what's wrong in the filter. I'm wondering if we should just start shipping with strict parsing on, and allow for lax parsing as an option.
Hide
Andrea Aime added a comment -

Two observations. I'm leaving the issue at this priority level until you can review what's going on.
The second one is that more often than not people state the common prefix right (ogc) but end up writing the xmlns wrong. Wondering if, in non strict mode and when a full match using xmlns + element name fila, it would be good for the parser to try and infer the xmlns from the common prefix.

Show
Andrea Aime added a comment - Two observations. I'm leaving the issue at this priority level until you can review what's going on. The second one is that more often than not people state the common prefix right (ogc) but end up writing the xmlns wrong. Wondering if, in non strict mode and when a full match using xmlns + element name fila, it would be good for the parser to try and infer the xmlns from the common prefix.
Hide
Andrea Aime added a comment -

Toning down to "major" since I'm receiving no feedback on this one

Show
Andrea Aime added a comment - Toning down to "major" since I'm receiving no feedback on this one
Hide
Andrea Aime added a comment -

Assigning to you since it looks like a XML parsing issue. Not sure if it's still reproducable btw

Show
Andrea Aime added a comment - Assigning to you since it looks like a XML parsing issue. Not sure if it's still reproducable btw
Hide
Justin Deoliveira added a comment -

Could not reproduce.

Show
Justin Deoliveira added a comment - Could not reproduce.
Hide
Victor Tey added a comment -

I found the same issue with Filter_1_1_0_KvpParser which extends FilterKvpParser

The attribute was turned to a literalExpression

below is my filter

http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=test:Test&filter=
<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>
test:objectIdentifier/test:Identifier/test:localId
</ogc:PropertyName>
<ogc:Literal>id1</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>

Show
Victor Tey added a comment - I found the same issue with Filter_1_1_0_KvpParser which extends FilterKvpParser The attribute was turned to a literalExpression below is my filter http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=test:Test&filter= <ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml"> <ogc:PropertyIsEqualTo> <ogc:PropertyName> test:objectIdentifier/test:Identifier/test:localId </ogc:PropertyName> <ogc:Literal>id1</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter>
Hide
Andrea Aime added a comment -

Victor, in your case just as in mine the ogc prefix declaration is using the wrong uri. See my comments above.

Show
Andrea Aime added a comment - Victor, in your case just as in mine the ogc prefix declaration is using the wrong uri. See my comments above.
Hide
Andrea Aime added a comment -

Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

Show
Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: