[GeoNetwork-devel] CSW and Xpath on ElementName MD_Keywords issue

Hi list

I am facing an issue using Xpath on an ElementName in a csw GetRecords query.

when using
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords</csw:ElementName>

the response only contains the first Keyword (I have other I’m expecting to receive)

Trying to use : csw:ElementName//gmd:MD_Keywords</csw:ElementName>
does not solve the issue. It even removes the only Keyword I got back :frowning:

I’m running a 2.6.0, could this be solved deploying a 2.6.4 (see http://trac.osgeo.org/geonetwork/ticket/492) ?

To reproduce, you can try
here : http://services.sandre.eaufrance.fr/geonetwork_CSW/srv/en/csw
this :

<csw:GetRecords xmlns:csw=“http://www.opengis.net/cat/csw/2.0.2” xmlns:gco=“http://www.isotc211.org/2005/gco” xmlns:gmd=“http://www.isotc211.org/2005/gmd” xmlns:gmx=“http://www.isotc211.org/2005/gmx” service=“CSW” version=“2.0.2” resultType=“results” startPosition=“1” maxRecords=“1” outputSchema=“csw:IsoRecord”>
<csw:Query typeNames=“csw:Record”>
csw:ElementName/gmd:MD_Metadata/gmd:fileIdentifier/</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:dateStamp/</csw:ElementName>
<ogc:SortBy xmlns:ogc=“http://www.opengis.net/ogc”>
ogc:SortProperty
ogc:PropertyNamerelevance</ogc:PropertyName>
ogc:SortOrderD</ogc:SortOrder>
</ogc:SortProperty>
</ogc:SortBy>
<csw:Constraint version=“1.0.0”>
<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc”>
ogc:And
ogc:PropertyIsEqualTo
ogc:PropertyNameAnyText</ogc:PropertyName>
ogc:Literalmasses</ogc:Literal>
</ogc:PropertyIsEqualTo>
ogc:Intersects
ogc:PropertyNameows:BoundingBox</ogc:PropertyName>
<gml:Box xmlns:gml=“http://www.opengis.net/gml”>
<gml:coordinates decimal=“.” cs=“,” ts=" ">-180,-90 180,90</gml:coordinates>
</gml:Box>
</ogc:Intersects>
</ogc:And>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>

Thanks
Sylvain

Hi Sylvain,

I had a look at your issue, and it looks weird!
As you mention, we only get the first keyword using xpaths and ElementName elements in your GetRecords request.

What looks also stange to me is that we have different behavior when trying to access the metadata using XML services and CSW…I mean I’m not able to get the full metadata using CSW requests (GetRecords or GetRecordById), compare to the XML request using the UUID…

The following request retrieves the full metadata :
http://services.sandre.eaufrance.fr/geonetwork_CSW/srv/en/xml.metadata.get?uuid=a8d8771f-db98-4dfd-a977-5bb53efe2a5a

Compare to this CSW request which retrieves only partial metadata (keywords missing):

<?xml version="1.0"?>

<csw:GetRecordById xmlns:csw=“http://www.opengis.net/cat/csw/2.0.2” service=“CSW” version=“2.0.2” outputSchema=“csw:IsoRecord”>
csw:Ida8d8771f-db98-4dfd-a977-5bb53efe2a5a</csw:Id>
</csw:GetRecordById>

Are you using a specific ISO profil ? or any xlinks into your metadata?

Cheers,
Mathieu

On Wed, Jul 20, 2011 at 4:08 PM, Sylvain Grellet <s.grellet@anonymised.com…> wrote:

Hi list

I am facing an issue using Xpath on an ElementName in a csw GetRecords query.

when using
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords</csw:ElementName>

the response only contains the first Keyword (I have other I’m expecting to receive)

Trying to use : csw:ElementName//gmd:MD_Keywords</csw:ElementName>
does not solve the issue. It even removes the only Keyword I got back :frowning:

I’m running a 2.6.0, could this be solved deploying a 2.6.4 (see http://trac.osgeo.org/geonetwork/ticket/492) ?

To reproduce, you can try
here : http://services.sandre.eaufrance.fr/geonetwork_CSW/srv/en/csw
this :

<csw:GetRecords xmlns:csw=“http://www.opengis.net/cat/csw/2.0.2” xmlns:gco=“http://www.isotc211.org/2005/gco” xmlns:gmd=“http://www.isotc211.org/2005/gmd” xmlns:gmx=“http://www.isotc211.org/2005/gmx” service=“CSW” version=“2.0.2” resultType=“results” startPosition=“1” maxRecords=“1” outputSchema=“csw:IsoRecord”>
<csw:Query typeNames=“csw:Record”>
csw:ElementName/gmd:MD_Metadata/gmd:fileIdentifier/</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:dateStamp/</csw:ElementName>
<ogc:SortBy xmlns:ogc=“http://www.opengis.net/ogc”>
ogc:SortProperty
ogc:PropertyNamerelevance</ogc:PropertyName>
ogc:SortOrderD</ogc:SortOrder>
</ogc:SortProperty>
</ogc:SortBy>
<csw:Constraint version=“1.0.0”>
<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc”>
ogc:And
ogc:PropertyIsEqualTo
ogc:PropertyNameAnyText</ogc:PropertyName>
ogc:Literalmasses</ogc:Literal>
</ogc:PropertyIsEqualTo>
ogc:Intersects
ogc:PropertyNameows:BoundingBox</ogc:PropertyName>
<gml:Box xmlns:gml=“http://www.opengis.net/gml”>
<gml:coordinates decimal=“.” cs=“,” ts=" ">-180,-90 180,90</gml:coordinates>
</gml:Box>
</ogc:Intersects>
</ogc:And>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>

Thanks
Sylvain


10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi Mathieu,

I had also noticed this behavior but was not thinking it was somehow related.

I am not using any specific ISO profil. When I refactored Sandre’s metadata I used the 'Template for Vector data in ISO 19139 (preferred!)" with a GN 2.6.0 RC1.
Afterward I moved to the stable 2.6.0.

I am also not using xlinks.

By the way, I also have an issue using ElementName and pointing to dc:date but I’ll send another e-mail not to mix things.

Sylvain

Le 20/07/2011 17:42, Mathieu Coudert a écrit :

Hi Sylvain,

I had a look at your issue, and it looks weird!
As you mention, we only get the first keyword using xpaths and ElementName elements in your GetRecords request.

What looks also stange to me is that we have different behavior when trying to access the metadata using XML services and CSW…I mean I’m not able to get the full metadata using CSW requests (GetRecords or GetRecordById), compare to the XML request using the UUID…

The following request retrieves the full metadata :
http://services.sandre.eaufrance.fr/geonetwork_CSW/srv/en/xml.metadata.get?uuid=a8d8771f-db98-4dfd-a977-5bb53efe2a5a

Compare to this CSW request which retrieves only partial metadata (keywords missing):

<?xml version="1.0"?>

<csw:GetRecordById xmlns:csw=“http://www.opengis.net/cat/csw/2.0.2” service=“CSW” version=“2.0.2” outputSchema=“csw:IsoRecord”>
csw:Ida8d8771f-db98-4dfd-a977-5bb53efe2a5a</csw:Id>
</csw:GetRecordById>

Are you using a specific ISO profil ? or any xlinks into your metadata?

Cheers,
Mathieu

On Wed, Jul 20, 2011 at 4:08 PM, Sylvain Grellet <s.grellet@anonymised.com> wrote:

Hi list

I am facing an issue using Xpath on an ElementName in a csw GetRecords query.

when using
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords</csw:ElementName>

the response only contains the first Keyword (I have other I’m expecting to receive)

Trying to use : csw:ElementName//gmd:MD_Keywords</csw:ElementName>
does not solve the issue. It even removes the only Keyword I got back :frowning:

I’m running a 2.6.0, could this be solved deploying a 2.6.4 (see http://trac.osgeo.org/geonetwork/ticket/492) ?

To reproduce, you can try
here : http://services.sandre.eaufrance.fr/geonetwork_CSW/srv/en/csw
this :

<csw:GetRecords xmlns:csw=“http://www.opengis.net/cat/csw/2.0.2” xmlns:gco=“http://www.isotc211.org/2005/gco” xmlns:gmd=“http://www.isotc211.org/2005/gmd” xmlns:gmx=“http://www.isotc211.org/2005/gmx” service=“CSW” version=“2.0.2” resultType=“results” startPosition=“1” maxRecords=“1” outputSchema=“csw:IsoRecord”>
<csw:Query typeNames=“csw:Record”>
csw:ElementName/gmd:MD_Metadata/gmd:fileIdentifier/</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords</csw:ElementName>
csw:ElementName/gmd:MD_Metadata/gmd:dateStamp/</csw:ElementName>
<ogc:SortBy xmlns:ogc=“http://www.opengis.net/ogc”>
ogc:SortProperty
ogc:PropertyNamerelevance</ogc:PropertyName>
ogc:SortOrderD</ogc:SortOrder>
</ogc:SortProperty>
</ogc:SortBy>
<csw:Constraint version=“1.0.0”>
<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc”>
ogc:And
ogc:PropertyIsEqualTo
ogc:PropertyNameAnyText</ogc:PropertyName>
ogc:Literalmasses</ogc:Literal>
</ogc:PropertyIsEqualTo>
ogc:Intersects
ogc:PropertyNameows:BoundingBox</ogc:PropertyName>
<gml:Box xmlns:gml=“http://www.opengis.net/gml”>
<gml:coordinates decimal=“.” cs=“,” ts=" ">-180,-90 180,90</gml:coordinates>
</gml:Box>
</ogc:Intersects>
</ogc:And>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>

Thanks
Sylvain


10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

I forgot to mention that I face the same issue using
csw:ElementName/gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource</csw:ElementName>

It only provides the first CI_OnlineResource.