Dear List,
I'm not too good at reading BKF in the OGI spec, so some working CSW queries would be useful - anyone know of any?
For example, what am I doing wrong here? I'm just trying to get these two records (I repeated the first one to get one without an <or>) thinking perhaps that was my problem...). GeoNetwork only returns the first one.
Am using a recent trunk.
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="csw:IsoRecord" maxRecords="1000">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:ElementSetName>full</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="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%01b5b9b8-a948-4ac8-aa4a-5f345a71e833%</Literal>
</PropertyIsLike>
<or xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="%" singleChar="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%01b5b9b8-a948-4ac8-aa4a-5f345a71e833%</Literal>
</PropertyIsLike>
</or>
<or xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="%" singleChar="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%08d97c64-baa0-4be2-85e6-9c20897b0b7e%</Literal>
</PropertyIsLike>
</or>
</Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
Hi Roger,
Please see my response below...
On Tue, Jun 2, 2009 at 4:24 PM, Roger Bedell <sylvanascent@anonymised.com>wrote:
Dear List,
I'm not too good at reading BKF in the OGI spec, so some working CSW
queries would be useful - anyone know of any?
For example, what am I doing wrong here? I'm just trying to get these two
records (I repeated the first one to get one without an <or>) thinking
perhaps that was my problem...). GeoNetwork only returns the first one.
Am using a recent trunk.
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
service="CSW" version="2.0.2" resultType="results"
outputSchema="csw:IsoRecord" maxRecords="1000">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:ElementSetName>full</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="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%01b5b9b8-a948-4ac8-aa4a-5f345a71e833%</Literal>
</PropertyIsLike>
Any property in metadata should be matched with the literal... This is more
like Contains clause in string handling function of programming language...
If you want any specific property to be matched you need to specify that in
PropertyName and you can enter partial string in Literal tag surrounded by
"%" to get desired results...
<or xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="%" singleChar="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%01b5b9b8-a948-4ac8-aa4a-5f345a71e833%</Literal>
</PropertyIsLike>
</or>
<or xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="%" singleChar="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%08d97c64-baa0-4be2-85e6-9c20897b0b7e%</Literal>
</PropertyIsLike>
</or>
</Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork
-----Original Message-----
From: Roger Bedell [mailto:sylvanascent@anonymised.com]
Sent: Tuesday, 02 June 2009 06:54
To: geonetwork-users@lists.sourceforge.net
Subject: [GeoNetwork-users] CSW Examples?
Dear List,
I'm not too good at reading BKF in the OGI spec, so some
working CSW queries would be useful - anyone know of any?
For example, what am I doing wrong here? I'm just trying to
get these two records (I repeated the first one to get one
without an <or>) thinking perhaps that was my problem...).
GeoNetwork only returns the first one.
Am using a recent trunk.
<csw:GetRecords
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
service="CSW" version="2.0.2" resultType="results"
outputSchema="csw:IsoRecord" maxRecords="1000">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:ElementSetName>full</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="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%01b5b9b8-a948-4ac8-aa4a-5f345a71e833%</Literal>
</PropertyIsLike>
<or xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="%" singleChar="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%01b5b9b8-a948-4ac8-aa4a-5f345a71e833%</Literal>
</PropertyIsLike>
</or>
<or xmlns="http://www.opengis.net/ogc">
<PropertyIsLike wildCard="%" singleChar="_" escape="\">
<PropertyName>AnyText</PropertyName>
<Literal>%08d97c64-baa0-4be2-85e6-9c20897b0b7e%</Literal>
</PropertyIsLike>
</or>
</Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
You need to put your comparison operators within a single ogc:Or
element. Here's a modified request:
<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
service="CSW" version="2.0.2" resultType="results"
outputSchema="csw:IsoRecord" maxRecords="1000"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
<csw:Query typeNames="gmd:MD_Metadata">
<csw:ElementSetName>full</csw:ElementSetName>
<csw:Constraint version="1.1.0">
<ogc:Filter xmlns="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml">
<ogc:Or>
<ogc:PropertyIsLike wildCard="%" singleChar="_"
escapeChar="\">
<ogc:PropertyName>AnyText</ogc:PropertyName>
<ogc:Literal>%01b5b9b8-a948-4ac8-aa4a-5f345a71e833%</ogc:Literal>
</ogc:PropertyIsLike>
<ogc:PropertyIsLike wildCard="%" singleChar="_"
escapeChar="\">
<ogc:PropertyName>AnyText</ogc:PropertyName>
<ogc:Literal>%08d97c64-baa0-4be2-85e6-9c20897b0b7e%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Or>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
..Tom