I'm trying to figure out the syntax for various CSW GET requests that use CQL, for equivalent working CSW POST requests, but I seem to be going around in circles. I've seen posted on this list some similar questions relating to CSW GET requests, but none appear to have been fully answered.
The issue I have is how I write my CQL constraint, I seem to always get all the metadata records returned (or found), rather than the subset I want.
For example:
POST (to http://ogcdev.bgs.ac.uk/geonetwork/srv/en/csw?)
<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:apiso="http://www.opengis.net/cat/csw/apiso/1.0"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gmd="http://www.isotc211.org/2005/gmd" service="CSW"
resultType="results"
outputFormat="application/xml"
outputSchema="http://www.isotc211.org/2005/gmd"
startPosition="1" maxRecords="10">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:ElementSetName typeNames="gmd:MD_Metadata">brief</csw:ElementSetName>
<csw:Constraint version="1.1.0">
<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
<PropertyIsLike wildCard="%" singleChar="?" escapeChar="\">
<PropertyName>AnyText</PropertyName>
<Literal>%NERC_DDC%</Literal>
</PropertyIsLike>
</Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
Matches 321 results (and returns the first 10)
GET
I've tried this (which I assumed was equivalent):
But it matches 331 results.
I've tried several variants (as below)
&constraint=%22AnyText%20Like%20%25%NERC_DDC%%25%22 also matches 331 results.
&constraint=%22AnyText%20Like%20%25NERC_DDC%25%22 fails, as does
&constraint=%22AnyText%20Like%20NERC_DDC%22
prefixing csw: in front of AnyText doesn't seem to make any difference.
I was wondering whether the AnyText property wasn't supported so I've tried another query.
POST
<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:apiso="http://www.opengis.net/cat/csw/apiso/1.0"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
service="CSW" resultType="results"
outputFormat="application/xml"
outputSchema="http://www.isotc211.org/2005/gmd"
startPosition="1" maxRecords="10">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:ElementSetName
typeNames="gmd:MD_Metadata">brief</csw:ElementSetName>
<csw:Constraint version="1.1.0">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>apiso:ServiceType</ogc:PropertyName>
<ogc:Literal>view</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
Matches 7 records.
GET
Matches 331 records.
Have I got the syntax wrong? (if so what schoolboy error have I made)
thanks
James
--
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.