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.
pycsw is very cool and we want to use it for our existing metadata.
We have a PostgreSQL database in which the metadata records are in XML (gmd:MD_Metadata).
We would like to use these in pycsw. As far as I know the data type xml is not supported in pycsw. But we can also use the datatype text. I think the mapping is not complete or wrong.
Could you help me in configuring the mapping please?
Environment
operating system: linux debian 10 buster
Python version: 3.7.3
pycsw version: 2.6.1
source/distribution
[ ] git clone
[ ] DebianGIS/UbuntuGIS
[ ] PyPI
[ x ] zip/tar.gz
[ ] other (please specify):
web server
[ x ] Apache/mod_wsgi
[ ] CGI
[ ] other (please specify):
Steps to Reproduce
Create Database with one dataset:
--drop table metadata.xml_test;
create table metadata.xml_test (
id uuid Primary Key,
data_iso text
);
GetCapabilities-Request is working: ?SERVICE=CSW&request=GetCapabilities&VERSION=2.0.2
GetRecords also: ?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecords&typeNames=gmd:MD_Metadata&constraintLanguage=CQL_TEXT&ElementSetName=full&resultType=hits
But GetRecordById not completly: ?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&id=3d84970f-99dc-4f63-b631-08ff838f8808&outputSchema=http://www.isotc211.org/2005/gmd
Wrong Output of GetRecordById:
3d84970f-99dc-4f63-b631-08ff838f8808ISO191152003/Cor.1:2006
# Additional Information
Description
Hi,
pycsw is very cool and we want to use it for our existing metadata. We have a PostgreSQL database in which the metadata records are in XML (gmd:MD_Metadata). We would like to use these in pycsw. As far as I know the data type xml is not supported in pycsw. But we can also use the datatype text. I think the mapping is not complete or wrong. Could you help me in configuring the mapping please?
Environment
Steps to Reproduce
Create Database with one dataset:
--drop table metadata.xml_test;
Configure mapping in etc/mappings.py
MD_CORE_MODEL = { 'typename': 'http://www.isotc211.org/2005/gmd', 'outputschema': 'http://pycsw.org/metadata', 'mappings': { 'pycsw:Identifier': 'id', 'pycsw:Typename': 'gmd:MD_Metadata', 'pycsw:Schema': 'http://www.isotc211.org/2005/gmd', 'pycsw:MdSource': 'data_iso', 'pycsw:InsertDate': '2023-02-22', 'pycsw:XML':'data_iso', 'pycsw:AnyText': 'data_iso', 'pycsw:Language': 'language', 'pycsw:Title': 'title', 'pycsw:Abstract': 'abstract', 'pycsw:Keywords': 'keywords', 'pycsw:KeywordType': 'keywordstype', 'pycsw:Format': 'format', 'pycsw:Source': 'source', 'pycsw:Date': 'date', 'pycsw:Modified': 'date_modified', 'pycsw:Type': 'type', 'pycsw:BoundingBox': 'id', 'pycsw:CRS': 'crs', 'pycsw:AlternateTitle': 'title_alternate', 'pycsw:RevisionDate': 'date_revision', 'pycsw:CreationDate': 'date_creation', 'pycsw:PublicationDate': 'date_publication', 'pycsw:OrganizationName': 'organization', 'pycsw:SecurityConstraints': 'securityconstraints', 'pycsw:ParentIdentifier': 'parentidentifier', 'pycsw:TopicCategory': 'topicategory', 'pycsw:ResourceLanguage': 'resourcelanguage', 'pycsw:GeographicDescriptionCode': 'geodescode', 'pycsw:Denominator': 'denominator', 'pycsw:DistanceValue': 'distancevalue', 'pycsw:DistanceUOM': 'distanceuom', 'pycsw:TempExtent_begin': 'time_begin', 'pycsw:TempExtent_end': 'time_end', 'pycsw:ServiceType': 'servicetype', 'pycsw:ServiceTypeVersion': 'servicetypeversion', 'pycsw:Operation': 'operation', 'pycsw:CouplingType': 'couplingtype', 'pycsw:OperatesOn': 'operateson', 'pycsw:OperatesOnIdentifier': 'operatesonidentifier', 'pycsw:OperatesOnName': 'operatesoname', 'pycsw:Degree': 'degree', 'pycsw:AccessConstraints': 'accessconstraints', 'pycsw:OtherConstraints': 'otherconstraints', 'pycsw:Classification': 'classification', 'pycsw:ConditionApplyingToAccessAndUse': 'conditionapplyingtoaccessanduse', 'pycsw:Lineage': 'lineage', 'pycsw:ResponsiblePartyRole': 'responsiblepartyrole', 'pycsw:SpecificationTitle': 'specificationtitle', 'pycsw:SpecificationDate': 'specificationdate', 'pycsw:SpecificationDateType': 'specificationdatetype', 'pycsw:Creator': 'creator', 'pycsw:Publisher': 'publisher', 'pycsw:Contributor': 'contributor', 'pycsw:Relation': 'relation', 'pycsw:Links': 'links', } }
Start pycsw service
python3 pycsw/wsgi.py
Run Get-Requests
GetCapabilities-Request is working: ?SERVICE=CSW&request=GetCapabilities&VERSION=2.0.2 GetRecords also: ?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecords&typeNames=gmd:MD_Metadata&constraintLanguage=CQL_TEXT&ElementSetName=full&resultType=hits But GetRecordById not completly: ?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&id=3d84970f-99dc-4f63-b631-08ff838f8808&outputSchema=http://www.isotc211.org/2005/gmd
Wrong Output of GetRecordById: