Dear Geonetwork community,
I faced some problems trying to filter a metadata catalog (Geonetwork version 3.4.2.0) through a CSW GetRecords POST-Request using XPaths. My problem is that I'm not sure how to implement XPaths in the request. I tried the following code:
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gmd="http://www.isotc211.org/2005/gmd" service="CSW" version="2.0.2" resultType="results" outputSchema="csw:IsoRecord" startPosition="1" maxRecords="10">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString</ogc:PropertyName>
<ogc:Literal>uuid_value</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
As you can see in the code I simply used the XPath for the <ogc:PropertyName> parameter (as defined in http://portal.opengeospatial.org/files/?artifact_id=20555 Page 154: 10.8.4.11.5 Property references).
The request always leads to 0 results so something has to be wrong with the GetRecords request.
Replacing the XPath with 'Identifier' makes the code work as it should:
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gmd="http://www.isotc211.org/2005/gmd" service="CSW" version="2.0.2" resultType="results" outputSchema="csw:IsoRecord" startPosition="1" maxRecords="10">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:Constraint version="1.1.0">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>Identifier</ogc:PropertyName>
<ogc:Literal>uuid_value</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
Does anyone know the proper (and most importantly working) way to solve my problem?
Kind regards
David