Closed mohmad-null closed 1 year ago
Pretty much same here (I used queries that work against GeoNetwork), would be great to get some more helpful error messages instead of just "invalid filter syntax"...
As mentioned here, sample requests can be found in the tests directory: for CSW 2.0.2 and CSW 3.
E.g. (CSW 2.0.2): title like '%Agriculture%'
Hi all: I'm not able to reproduce. The following URLs return records (and not exceptions):
Can someone test and report back with an example that can be demonstrated against http://demo.pycsw.org ?
With regard to error messages, this is by design for security purposes. pycsw allows for server logging, which will provide deeper error messages to the administrator of the endpoint.
here some examples to reproduce:
same works fine on other csw implementations: https://www.geoportal-bw.de/geonetwork/srv/ger/csw?REQUEST=GetRecords&VERSION=2.0.2&SERVICE=CSW&typenames=gmd:MD_Metadata&resultType=hits&constraintLanguage=CQL_TEXT&Constraint=Type='dataset'&CONSTRAINT_LANGUAGE_VERSION=1.1.0
same on xml filter:
results in:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- pycsw 2.3.dev0 -->
<ows:ExceptionReport xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" language="de-DE" version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode="InvalidParameterValue" locator="constraint">
<ows:ExceptionText>Invalid Filter query: Exception: document not valid.
Error: Invalid PropertyName: Type. 'Type'.</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
found my issue:
You need to place spaces between property name, operator, and literal, and the property name needs to be bound to a namespace prefix, so:
A note on ogcapi-records, supported filter languages (for now) are :
I'm trying to do a CQL_FILTER via a GET request, but no matter what I put as the constraint, I always get back an exception "Invalid Filter syntax".
These are all against the demo pycsw deployment demo.pycsw.org
I've tried: The CQL from the GeoNetwork documentation: https://geonetwork-opensource.org/manuals/2.10.4/eng/developer/xml_services/csw_services.html#getrecords (That query is actually invalid anyway because it is missing the ElementSetName=full, but once you add it, you'll get the exception back)
Very basic examples built around this query: this: http://demo.pycsw.org/gisdata/csw?service=CSW&version=2.0.2&resultType=results&startPosition=1&maxRecords=10&typeNames=csw:Record&request=GetRecords&typeNames=csw:Record&ElementSetName=full&constraintlanguage=CQL_TEXT
with any of these constraints: &constraint=title%3Ddinosaur &constraint=dc%3Atitle%3Ddinosaur &constraint="dc:title%3Ddinosaur" &constraint=%22dc%3Atitle%3Ddinosaur%22
&CONSTRAINT=”prop1!=10” &CONSTRAINT=%22prop1!=10%22
The last one is copied and pasted straight from the CSW 2.0.2 spec.
Admittedly there's no real documentation out there for CQL ("pycsw cql constraint" finds nothing) so maybe my queries are wrong, but surely one of them should work given they appear valid, and one is in the spec. Especially after I've done the URL % encoding.