[OWSLib-users] OWSlib - CSW metadata

Tom Kralidis tomkralidis at gmail.com
Fri Sep 9 12:04:46 PDT 2016



On Fri, 9 Sep 2016, Henrik Schuller wrote:

> Date: Fri, 9 Sep 2016 15:11:10 +0200
> From: Henrik Schuller <hgs716 at gmail.com>
> To: Tom Kralidis <tomkralidis at gmail.com>, owslib-users at lists.osgeo.org
> Subject: Re: [OWSLib-users] OWSlib - CSW metadata
> 
> Thx alot Tom, now i got alot more information out of the CSW :)
>
> Maybe just me that is inexperienced, but how do i get information out of
> objects like the ones i get here:
>
> from owslib.csw import CatalogueServiceWeb
>
> csw = CatalogueServiceWeb('http://www.geonorge.no/geonetwork/srv/nor/csw-service?')
> csw.getrecords2(typenames='gmd:MD_Metadata', esn='full', resulttype="results",
>                outputschema="http://www.isotc211.org/2005/gmd", maxrecords=50)
>
> for rec in csw.records:
>    print((csw.records[rec].identification.contact))
>

Your best bet is to inspect OWSLib's ISO implementation [1] to see how we parse the XML
into Python objects.

[1] https://github.com/geopython/OWSLib/blob/master/owslib/iso.py

> From Henrik
>
>
>
> 2016-09-09 12:55 GMT+02:00 Tom Kralidis <tomkralidis at gmail.com>:
>
>>
>>
>> On Fri, 9 Sep 2016, Henrik Schuller wrote:
>>
>> Date: Fri, 9 Sep 2016 12:57:24 +0200
>>> From: Henrik Schuller <hgs716 at gmail.com>
>>> To: OWSLib-users at lists.osgeo.org
>>> Subject: [OWSLib-users] OWSlib - CSW metadata
>>>
>>> Hi,
>>>
>>>
>>>
>>> I am using OWSlib to GetRecords from a CSW
>>> (*http://www.geonorge.no/geonetwork/srv/nor/csw-service
>>> <http://www.geonorge.no/geonetwork/srv/nor/csw-service>*, but I would
>>> like
>>> to get more information about the records than what is given in dublin
>>> core. Is there any easy way that I could get information like
>>> gmd:individualName or srv:operatesOn for every record?
>>>
>>>
>>> I can see that this information is available in OWSlib - iso, but I don't
>>> see an easy way to implement it for the csw.records.
>>>
>>>
>> Try doing the getrecords2 request using ISO as the outputschema (Dublin
>> Core
>> is default):
>>
>> from owslib.csw import CatalogueServiceWeb
>>
>> csw = CatalogueServiceWeb('http://www.geonorge.no/geonetwork/srv/
>> nor/csw-service')
>>
>> csw.getrecords2(outputschema='http://www.isotc211.org/2005/gmd')
>>
>> The CSW will then return the ISO representation of matching metadata
>> records.
>>
>> Hope this helps
>>
>> ..Tom
>>
>>
>>>
>>> Henrik
>>>
>>>
>


More information about the OWSLib-users mailing list