ioos / ckanext-ioos-theme

IOOS Catalog as a CKAN extension
GNU Affero General Public License v3.0
7 stars 14 forks source link

How do we search for regions with the new IOOS catalog CSW? #132

Closed rsignell-usgs closed 7 years ago

rsignell-usgs commented 7 years ago

To address this OWSlib issue here: https://github.com/geopython/OWSLib/issues/357, I started trying to modify the CSW tests and ran into a problem accessing IOOS data by region here: https://github.com/geopython/OWSLib/blob/master/tests/doctests/csw_uuid_constrain.txt#L21 We no longer use the NGDC geoportal, and I can change the endpoint, but what is the query in the new IOOS catalog CSW to grab, say, all the AOOS data?

mwengren commented 7 years ago

I don't believe there's a way to filter by RA from the new Catalog CS-W. This is due to pycsw service only the raw ISO records as harvested by CKAN. The organization construct in the CKAN framework is not propagated to pycsw. There is a way to filter by organization from the CKAN API however, if you're inclined to use that native API instead.

We'd have to connect with pycsw developers to research options for extending it to support this. I think Angelos may have done some work into extending pycsw to use CKAN database natively, but I don't remember if this was completed.

rsignell-usgs commented 7 years ago

Well, that sounds interesting. @kalxas, is there a way to access the CKAN info via CSW?

kalxas commented 7 years ago

In order to do this kind of query, you would need to bake that information into the ISO record (parent identifier etc) We have implemented tight pycsw integration with CKAN on our PublicaMundi project. https://github.com/PublicaMundi/ckanext-publicamundi Once you update the organization information or publish a dataset from scratch, the organization field gets populated in the ISO record. http://geodata.gov.gr/en/

lukecampbell commented 7 years ago

@mwengren we might be able to patch the ISO records from the registry. We already patch the geometry to be a box if it's not a proper box.

lukecampbell commented 7 years ago

Done

lukecampbell commented 7 years ago
from owslib.csw import CatalogueServiceWeb
csw = CatalogueServiceWeb('https://data.ioos.us/csw')
from owslib.fes import PropertyIsEqualTo, PropertyIsLike
query = PropertyIsEqualTo('apiso:OrganisationName', 'aoos')
csw.getrecords2(constraints=[query], maxrecords=100, startposition=10)
for rec in csw.records:
    print csw.records[rec].title
rsignell-usgs commented 7 years ago

Woohoo! :champagne: