[pycsw-devel] Constraint parameter

Tom Kralidis tomkralidis at hotmail.com
Fri Jun 3 16:35:26 EDT 2011



(FYI I inadvertently replied offlist, sorry)

Hi Adrià: This was happening in the absence of an ISO <-> DC mapping for this use case (i.e. querying csw:Record, asking for ISO back).  I've committed the ISO to DC serializer in the code (and at the same time ended up refactoring the csw:Record serializer, which was occurring in two places -- thanks!).  Can you test this and let us know if this works for you?

Thanks much for testing and feedback!

..Tom


> Date: Fri, 3 Jun 2011 15:42:58 +0100
> From: amercader.dev at gmail.com
> To: pycsw-devel at lists.sourceforge.net
> Subject: [pycsw-devel]  Constraint parameter
> 
> Hi Tom,
> Yes, that worked nicely thank you. But I'm getting another error :)
> I loaded the example records provided in the data/cite directory (I'm
> using Postgres 8.4 as db backend) and when doing this query:
> 
> http://localhost/csw/csw.py?REQUEST=GetRecords&SERVICE=CSW&VERSION=2.0.2&CONSTRAINTLANGUAGE=CQL_TEXT&TYPENAMES=csw:Record&RESULTTYPE=results&OUTPUTSCHEMA=http://www.isotc211.org/2005/gmd&CONSTRAINT_LANGUAGE_VERSION=1.1.0&elementSetName=summary
> 
> I get this:
> 
> Traceback (most recent call last):
>  File "/var/www/apps/pycsw/trunk/csw.py", line 40, in <module>
>    CSW.dispatch()
>  File "/var/www/apps/pycsw/trunk/server/server.py", line 243, in dispatch
>    self.response = self.getrecords()
>  File "/var/www/apps/pycsw/trunk/server/server.py", line 926, in getrecords
>    self.repository.queryables['_all']))
>  File "/var/www/apps/pycsw/trunk/server/profiles/apiso/apiso.py",
> line 375, in write_record
>    codeSpace = CODESPACE).text = val
>  File "lxml.etree.pyx", line 2437, in lxml.etree.SubElement
> (src/lxml/lxml.etree.c:47709)
>  File "apihelpers.pxi", line 210, in lxml.etree._makeSubElement
> (src/lxml/lxml.etree.c:11413)
>  File "apihelpers.pxi", line 205, in lxml.etree._makeSubElement
> (src/lxml/lxml.etree.c:11349)
>  File "apihelpers.pxi", line 283, in lxml.etree._initNodeAttributes
> (src/lxml/lxml.etree.c:12184)
>  File "apihelpers.pxi", line 1293, in lxml.etree._utf8
> (src/lxml/lxml.etree.c:20190)
> TypeError: Argument must be string or unicode.
> 
> val is None in apiso.py. If I check for val in line 371, the records
> are returned nicely. (Of course I don't know the implications of this
> fix)
> 
> Thanks,
> 
> Adrià
> 
> 
> On 3 June 2011 15:13, Tom Kralidis <tomkralidis at hotmail.com> wrote:
> >
> >
> >> Date: Fri, 3 Jun 2011 14:43:54 +0100
> >> From: amercader.dev at gmail.com
> >> To: pycsw-devel at lists.sourceforge.net
> >> Subject: [pycsw-devel] Constraint parameter
> >>
> >> Hi all,
> >> I'm using the latest svn trunk, and when doing a GetRecords query like
> >> the following I get a 500 error with the following traceback:
> >>
> >>
> >> http://localhost/csw/csw.py?REQUEST=GetRecords&SERVICE=CSW&VERSION=2.0.2&CONSTRAINTLANGUAGE=CQL_TEXT&TYPENAMES=csw:Record&RESULTTYPE=results&OUTPUTSCHEMA=http://www.isotc211.org/2005/gmd&CONSTRAINT_LANGUAGE_VERSION=1.1.0&ELEMENTSETNAME=brief
> >>
> >> Traceback (most recent call last):
> >> File "/var/www/apps/pycsw/trunk/csw.py", line 40, in <module>
> >> CSW.dispatch()
> >> File "/var/www/apps/pycsw/trunk/server/server.py", line 243, in dispatch
> >> self.response = self.getrecords()
> >> File "/var/www/apps/pycsw/trunk/server/server.py", line 834, in getrecords
> >> (self.kvp['constraint'], self.kvp['sortby'], self.kvp['typenames']))
> >> KeyError: 'constraint'
> >>
> >> If I add something like "&CONSTRAINT=1" to the query I get the
> >> records. AFAIK, constraint is an optional parameter of the getrecords
> >> request, so maybe this is a bug?
> >>
> >> Cheers,
> >>
> >> Adrià
> >>
> >
> > Hi Adrià: thanks for the info.  I've applied a fix in trunk.  Can you test
> > and let me know if this works for you?
> >
> > ..Tom
> >
> >
> 
> 
> 
> --
> 
> 
> Adrià Mercader
> -----------------------------
> http://amercader.net
> 
> 
> 
> -- 
> 
> 
> Adrià Mercader
> -----------------------------
> http://amercader.net
> 
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger.
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Discover what all the cheering's about.
> Get your free trial download today. 
> http://p.sf.net/sfu/quest-dev2dev2 
> _______________________________________________
> pycsw-devel mailing list
> pycsw-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pycsw-devel
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pycsw-devel/attachments/20110603/86179920/attachment.html


More information about the Pycsw-devel mailing list