[OWSLib-users] Handling "AND", "OR" and "NOT" in CSW

Signell, Richard rsignell at usgs.gov
Mon Feb 17 10:38:22 PST 2014


OWSlib folks,

I think Kyle meant to answer this question so I'm repeating it here:
:
"You should be able to use the fes.And and fes.Or methods for creating
a specific query.

https://github.com/geopython/OWSLib/blob/master/tests/doctests/fes_ogc_filters.txt#L68
https://github.com/geopython/OWSLib/blob/master/tests/doctests/fes_ogc_filters.txt#L83"

With this help, I was able to successfully repeat my complex UI
geoportal query with OWSlib CSW,
displayed here in an IPython Notebook:

http://nbviewer.ipython.org/gist/rsignell-usgs/9053867

Thanks Kyle!!!

-Rich



On Fri, Feb 14, 2014 at 11:27 AM, Signell, Richard <rsignell at usgs.gov> wrote:
> If I query via a user interface on a geoportal server that has a CSW
> interface, such as www.nodc.noaa.gov/geoportal, I can search on
>
> (roms OR hycom) AND pacioos NOT regridded
>
> but how can I do this using OWSLib CSW?
>
> I see here
> https://github.com/geopython/OWSLib/blob/master/owslib/fes.py#L130
> that you can do:
>
>                        [a,b,c]
>                        a || b || c
>
>                        [[a,b,c]]
>                        a && b && c
>
>                        [[a,b],[c],[d],[e]] or [[a,b],c,d,e]
>                        (a && b) || c || d || e
>
> but I couldn't figure out how to do
>
> (a || b ) && (c) && !d
>
> Thanks,
> Rich
> --
> Dr. Richard P. Signell   (508) 457-2229
> USGS, 384 Woods Hole Rd.
> Woods Hole, MA 02543-1598



-- 
Dr. Richard P. Signell   (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598


More information about the OWSLib-users mailing list