Hi all, I’m looking for a bit of help constructing a query against a GeoNetwork CSW server.
One aspect: with the new OGC website, I can’t find the CQL 1.1 spec. It’s all very well promoting the new ones (in this case CQL 2 as used in OGC API Features), but there are thousands of implementations out there which still implement the old ones.
But my actual question is how to constrain the results by date, so I only get back the records modified since a particular date (e.g. the data I last ‘harvested’ from that server).
Your expression of the date was right I believe. The “after” operator and “modified” keywords do not seem to be supported by GeoNetwork, I could get a similar query to work like so:
Thanks for the quick input. It seems to move my issue “forward” a bit, but for me it now gives a different error - rather than an error parsing from CQL to JSON, I now get a Java crash /JSON parsing error reported:
java.lang.RuntimeException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('' (code 92)): expected a valid value (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’) at [Source: (String)“{ “bool”: { “must”: [ { “range” : { “changeDate” : { “gte” : "2025-01-01T00:00:00Z" } } },{“query_string”: { “fields”: [“any.*”], “query”: “OGL” }} ] ,“filter”:{“query_string”:{“query”:”(op0:(1) ) AND (isTemplate:n) AND (draft:n OR draft:e)“}}}}”; line: 6, column: 26]
So, the %27 around the date gets parsed to " and the JSON parser doesn’t like the escape character in front of the quotation mark.