OWSLib icon indicating copy to clipboard operation
OWSLib copied to clipboard

gmd:name/gmx:MimeFileType not supported

Open jeanpommier opened this issue 5 years ago • 0 comments

Harvesting a geonetwork node using CSW (oswlib.csw), I encounter cases when instead of

<gmd:name>
  <gco:CharacterString>
    Fichier KMZ à télécharger
   </gco:CharacterString>
</gmd:name>

I have

<gmd:name>
  <**gmx:MimeFileType** type="application/octet-stream">
    Fichier KMZ à télécharger
  </gmx:MimeFileType>
</gmd:name>

According to the ISO 10139 standard, this is allowed (see gmx extendedElements). But during harvesting, the tag gmx:MimeFileType is not retrieved and I get an empty name in the csw record

It indeed seems that the iso.py code does not look for MimeFileType tags : https://github.com/geopython/OWSLib/blob/master/owslib/iso.py#L668

The following snippet allows to check it:

import owslib
from owslib.csw import CatalogueServiceWeb
from owslib.csw import namespaces
csw = CatalogueServiceWeb('https://www.pigma.org/geonetwork/srv/fre/csw-pnrml')
kwa = {
  "esn": "full",
  "outputschema": namespaces["gmd"],
}
csw.getrecordbyid(id=['89e34d8b-ac2e-4ebf-a720-7ace0fd00058'], **kwa)
r = csw.records['89e34d8b-ac2e-4ebf-a720-7ace0fd00058']
print("Retrieved online resource name is '{}' when it should instead give '129com.zip'".format(r.distribution.online[0].name))

Tested on owslib 0.18.0 with python 3.5

jeanpommier avatar Aug 29 '19 14:08 jeanpommier