[GeoNetwork-users] CSW GET Request - all records

Hi,

I was wondering that if there is a GET request to show all records in the
database?

I've tried to do a GetRecords by keyword:
http://localhost:8080/geonetwork/srv/en/csw?request=GetRecords&service=CSW&version=2.0.2&namespace=xmlns(csw=http://www.opengis.net/cat/csw/2.0.2),xmlns(gmd=http://www.isotc211.org/2005/gmd)&constraint=AnyText+like+�rica%&constraintLanguage=CQL\_TEXT&constraint\_language\_version=1\.1\.0&typeNames=csw:Record

But I receive an error with "AnyText+like" part. I just want to try to get
all the records without a constraint now.

Thanks for your help.

KM
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5698815.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

hi KM,

what error exactly do you get, and what version of GeoNetwork are you using
?

When I tried your request, I got no error. Instead I got

<csw:GetRecordsResponse xsi:schemaLocation="
http://www.opengis.net/cat/csw/2.0.2
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd&quot;&gt;
<csw:SearchStatus timestamp="2010-11-02T20:31:35"/>
<csw:SearchResults numberOfRecordsMatched="21" numberOfRecordsReturned="10"
elementSet="summary" nextRecord="11"/>
</csw:GetRecordsResponse>

meaning, it matched *all* of my metadata, even though I have only 1 that
contains the word "Africa". Maybe not exactly what you'd expect but at least
I got all the metadata :wink:

Kind regards,
Heikki Doeleman

On Tue, Nov 2, 2010 at 8:27 PM, KM <haroku91@anonymised.com> wrote:

Hi,

I was wondering that if there is a GET request to show all records in the
database?

I've tried to do a GetRecords by keyword:

http://localhost:8080/geonetwork/srv/en/csw?request=GetRecords&service=CSW&version=2.0.2&namespace=xmlns(csw=http://www.opengis.net/cat/csw/2.0.2),xmlns(gmd=http://www.isotc211.org/2005/gmd)&constraint=AnyText+like+�rica%&amp;constraintLanguage=CQL\_TEXT&amp;constraint\_language\_version=1\.1\.0&amp;typeNames=csw:Record&lt;http://localhost:8080/geonetwork/srv/en/csw?request=GetRecords&service=CSW&version=2.0.2&namespace=xmlns(csw=http://www.opengis.net/cat/csw/2.0.2),xmlns(gmd=http://www.isotc211.org/2005/gmd)&constraint=AnyText+like+�rica%&amp;constraintLanguage=CQL\_TEXT&amp;constraint\_language\_version=1\.1\.0&amp;typeNames=csw:Record&gt;

But I receive an error with "AnyText+like" part. I just want to try to get
all the records without a constraint now.

Thanks for your help.

KM
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5698815.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America
contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in
marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
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

come to think of it, it is not only strange this matches all my metadata,
but even so then I should expect to see summary records for the first 10.

I'll look further into this. Meanwhile, you might try to use POST request
(for example using the excellent Firefox add-on "Poster"). This request, for
example, should match all your metadata, if you post it to
http://localhost:8080/geonetwork/srv/en/csw?request=GetRecords&service=CSW&version=2.0.2:

<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot; xmlns:ogc="
http://www.opengis.net/ogc&quot; resultType="results" service="CSW"
version="2.0.2">
   <csw:Query typeNames="csw:Record" elementSet="full">
       <csw:Constraint version="1.1.0">
           <Filter xmlns="http://www.opengis.net/ogc&quot; xmlns:gml="
http://www.opengis.net/gml&quot;&gt;
               <PropertyIsLike wildCard="*" singleChar="_" escapeChar="\">
                   <PropertyName>AnyText</PropertyName>
                   <Literal>*</Literal>
               </PropertyIsLike>
           </Filter>
       </csw:Constraint>
   </csw:Query>
</csw:GetRecords>

Be aware though that wildcard search is broken in 2.6.0, so this might not
work for you. Alternatively, try to post

<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot; xmlns:ogc="
http://www.opengis.net/ogc&quot; resultType="results" service="CSW"
version="2.0.2">
   <csw:Query typeNames="csw:Record" elementSet="full">
       <csw:Constraint version="1.1.0">
           <Filter xmlns="http://www.opengis.net/ogc&quot; xmlns:gml="
http://www.opengis.net/gml&quot;&gt;
           </Filter>
       </csw:Constraint>
   </csw:Query>
</csw:GetRecords>

this should probably work.

Let us know ?

Kind regards
Heikki Doeleman

On Tue, Nov 2, 2010 at 8:55 PM, heikki <tropicano@anonymised.com> wrote:

hi KM,

what error exactly do you get, and what version of GeoNetwork are you using
?

When I tried your request, I got no error. Instead I got

<csw:GetRecordsResponse xsi:schemaLocation="
http://www.opengis.net/cat/csw/2.0.2
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd&quot;&gt;
<csw:SearchStatus timestamp="2010-11-02T20:31:35"/>
<csw:SearchResults numberOfRecordsMatched="21" numberOfRecordsReturned="10"
elementSet="summary" nextRecord="11"/>
</csw:GetRecordsResponse>

meaning, it matched *all* of my metadata, even though I have only 1 that
contains the word "Africa". Maybe not exactly what you'd expect but at least
I got all the metadata :wink:

Kind regards,
Heikki Doeleman

On Tue, Nov 2, 2010 at 8:27 PM, KM <haroku91@anonymised.com> wrote:

Hi,

I was wondering that if there is a GET request to show all records in the
database?

I've tried to do a GetRecords by keyword:

http://localhost:8080/geonetwork/srv/en/csw?request=GetRecords&service=CSW&version=2.0.2&namespace=xmlns(csw=http://www.opengis.net/cat/csw/2.0.2),xmlns(gmd=http://www.isotc211.org/2005/gmd)&constraint=AnyText+like+�rica%&amp;constraintLanguage=CQL\_TEXT&amp;constraint\_language\_version=1\.1\.0&amp;typeNames=csw:Record&lt;http://localhost:8080/geonetwork/srv/en/csw?request=GetRecords&service=CSW&version=2.0.2&namespace=xmlns(csw=http://www.opengis.net/cat/csw/2.0.2),xmlns(gmd=http://www.isotc211.org/2005/gmd)&constraint=AnyText+like+�rica%%26constraintLanguage%3DCQL\_TEXT%26constraint\_language\_version%3D1\.1\.0%26typeNames%3Dcsw:Record&gt;

But I receive an error with "AnyText+like" part. I just want to try to get
all the records without a constraint now.

Thanks for your help.

KM
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5698815.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America
contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in
marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
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

Thanks for the reply Heikki,

The error I get is:
<ows:ExceptionReport version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/ows
http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd&quot;&gt;

<ows:Exception exceptionCode="NoApplicableCode">

<ows:ExceptionText>
Error during CQL to Filter conversion :
org.geotools.filter.text.cql2.CQLException: Lexical error at line 1, column
14. Encountered: "\ufffd" (65533), after : "", Current Token : AnyText
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

And I'm running GeoNetwork 2.4

Also, is it possible to return all matched records instead of the default
number, 10?

I will try the POST meanwhile, thanks.

Regards,
KM
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5701024.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi,

Also, is it possible to return all matched records instead of the default
number, 10?

Yes, it is. You have the *maxResults **parameter for the GetRecords
operation. *
*Default is 10 in GeoNetwork.*
*
*
*Cheers,*
*
*
*Mathieu*

Hi Heikki,

If you have any idea what the problem with my GET request is, please let me
know. The POST request does work, but what I really need to get working is
the GET request.

Thanks,
KM
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5702859.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

I used Poster for Firefox and received this error while trying out the GET
request in my first post:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 400 Cannot build ServiceRequest
Cause : The data "AnyText like ?rica onstraintLanguage=CQL_TEXT" is not
legal for a JDOM character content: 0xc is not a legal XML character.
Error : org.jdom.IllegalDataException
</title>
</head>
<body><h2>HTTP ERROR: 400</h2><pre>Cannot build ServiceRequest
Cause : The data "AnyText like ?rica onstraintLanguage=CQL_TEXT" is not
legal for a JDOM character content: 0xc is not a legal XML character.
Error : org.jdom.IllegalDataException
</pre>
<p>RequestURI=/geonetwork/srv/en/csw</p><p><small> http://jetty.mortbay.org/
Powered by Jetty:// </small></p><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

</body>
</html>

Can anyone shed some light of this problem?

Much thanks,

KM

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5705762.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Thanks Mathieu,

When I tried to put:
Name: maxResults Value: 100 into "Parameters" tab in Poster for FireFox, I
still only get 10 records returned.

What is the procedure to change the maxResults parameter?

Regards,
KM
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5705783.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Below is an example of using maxRecords in the GetRecords XML Post request

<?xml version="1.0"?><csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot; xmlns:gmd="http://www.isotc211.org/2005/gmd&quot; service="CSW" version="2.0.2" resultType="results" outputSchema="csw:IsoRecord" maxRecords="100"><csw:Query typeNames="gmd:MD_Metadata"><csw:Constraint version="1.1.0"><Filter xmlns="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;PropertyIsLike wildCard="%" singleChar="_" escapeChar="\"><PropertyName>AnyText</PropertyName><Literal>%blah%</Literal></PropertyIsLike></Filter></csw:Constraint></csw:Query></csw:GetRecords>

-Dave

On 11/4/2010 9:46 AM, KM wrote:

Thanks Mathieu,

When I tried to put:
Name: maxResults Value: 100 into "Parameters" tab in Poster for FireFox, I
still only get 10 records returned.

What is the procedure to change the maxResults parameter?

Regards,
KM

Thanks Dave, that worked great.

Do you by any chance know what is the problem with my GET request and the
error I am getting?

Regards,
KM
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-GET-Request-all-records-tp5698815p5706141.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

KM,

Couldn't reproduce the error message you received in your GET request, but below is the equivalent to the earlier POST example:

http://localhost:8080/geonetwork/srv/en/csw?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecords&constraintlanguage=CQL_TEXT&constraint="csw:AnyText%20Like%20'%blah%'"&amp;resultType=results&amp;maxRecords=100&amp;outputSchema=csw:IsoRecord&amp;typeNames=gmd:MD\_Metadata

-Dave

On 11/4/2010 11:14 AM, KM wrote:

Thanks Dave, that worked great.

Do you by any chance know what is the problem with my GET request and the
error I am getting?

Regards,
KM