geopython / pycsw

pycsw is an OGC CSW server implementation written in Python. pycsw fully implements the OpenGIS Catalogue Service Implementation Specification [Catalogue Service for the Web]. Initial development started in 2010 (more formally announced in 2011). The project is certified OGC Compliant, and is an OGC Reference Implementation. pycsw allows for the publishing and discovery of geospatial metadata via numerous APIs (CSW 2/CSW 3, OpenSearch, OAI-PMH, SRU). Existing repositories of geospatial metadata can also be exposed, providing a standards-based metadata and catalogue component of spatial data infrastructures. pycsw is Open Source, released under an MIT license, and runs on all major platforms (Windows, Linux, Mac OS X). Please read the docs at https://pycsw.org/docs for more information.
https://pycsw.org
MIT License
196 stars 153 forks source link

Values of Dataquality sections of metadata are not saved into database #923

Open radochudy opened 7 months ago

radochudy commented 7 months ago

Description

Values of Dataquality sections (lineage, specificationtitle..) of metadata are not saved into database. For repository is used PostgrelSQL. We use it in production enviroment https://rpi.gov.sk/en as well as I made test in my local env. I made a check of parser ISO.py from owslib and it works OK. Thanks a lot.

Environment : production / dev

Steps to Reproduce

Try to load to pycsw this record and check specificationtitle in the database. testxml.zip

Additional Information

radochudy commented 6 months ago

@tomkralidis I found error in code https://github.com/geopython/pycsw/blob/027fe70c186988d3ddb44f03f855a5d79548bad0/pycsw/core/metadata.py#L1352 . There is bad definition of condition if hasattr(md.identification, 'dataquality'): ... dataquality is not part of md.identification and condition should be defined if hasattr(md, 'dataquality')...

Also following part of code from line 1356 is bad.

` if hasattr(md.dataquality, 'specificationdate'): _set(context, recobj, 'pycsw:specificationDate', md.dataquality.specificationdate[0].date) _set(context, recobj, 'pycsw:SpecificationDateType', md.dataquality.specificationdate[0].datetype)

`

specificationdate doesn't have attributes date and datetype defined in owslib iso parser. It is also necessary change definition of specificationdate in owslib iso parser