geonode-pycsw 3.0.0b2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geonode_pycsw-3.0.0b2.dist-info/METADATA +73 -0
- geonode_pycsw-3.0.0b2.dist-info/RECORD +382 -0
- geonode_pycsw-3.0.0b2.dist-info/WHEEL +5 -0
- geonode_pycsw-3.0.0b2.dist-info/entry_points.txt +2 -0
- geonode_pycsw-3.0.0b2.dist-info/licenses/LICENSE.txt +26 -0
- geonode_pycsw-3.0.0b2.dist-info/top_level.txt +1 -0
- pycsw/__init__.py +33 -0
- pycsw/core/__init__.py +29 -0
- pycsw/core/admin.py +703 -0
- pycsw/core/config.py +621 -0
- pycsw/core/etree.py +43 -0
- pycsw/core/formats/__init__.py +29 -0
- pycsw/core/formats/fmt_json.py +69 -0
- pycsw/core/log.py +71 -0
- pycsw/core/metadata.py +1996 -0
- pycsw/core/pygeofilter_evaluate.py +83 -0
- pycsw/core/repository.py +941 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/_wrapper.xsd +14 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswAll.xsd +33 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswCommon.xsd +71 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetCapabilities.xsd +80 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetDomain.xsd +146 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetRecordById.xsd +58 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetRecords.xsd +391 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswHarvest.xsd +95 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswTransaction.xsd +187 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswUnHarvest.xsd +77 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/rec-dcmes.xsd +245 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/rec-dcterms.xsd +101 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/record.xsd +170 -0
- pycsw/core/schemas/ogc/csw/2.0.2/CSW-discovery.xsd +494 -0
- pycsw/core/schemas/ogc/csw/2.0.2/CSW-publication.xsd +242 -0
- pycsw/core/schemas/ogc/csw/2.0.2/rec-dcmes.xsd +199 -0
- pycsw/core/schemas/ogc/csw/2.0.2/rec-dcterms.xsd +94 -0
- pycsw/core/schemas/ogc/csw/2.0.2/record.xsd +138 -0
- pycsw/core/schemas/ogc/filter/1.1.0/expr.xsd +67 -0
- pycsw/core/schemas/ogc/filter/1.1.0/filter.xsd +265 -0
- pycsw/core/schemas/ogc/filter/1.1.0/filterCapabilities.xsd +171 -0
- pycsw/core/schemas/ogc/filter/1.1.0/sort.xsd +46 -0
- pycsw/core/schemas/ogc/filter/2.0/_wrapper.xsd +5 -0
- pycsw/core/schemas/ogc/filter/2.0/expr.xsd +44 -0
- pycsw/core/schemas/ogc/filter/2.0/filter.xsd +396 -0
- pycsw/core/schemas/ogc/filter/2.0/filterAll.xsd +23 -0
- pycsw/core/schemas/ogc/filter/2.0/filterCapabilities.xsd +286 -0
- pycsw/core/schemas/ogc/filter/2.0/query.xsd +70 -0
- pycsw/core/schemas/ogc/filter/2.0/sort.xsd +49 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/basicTypes.xsd +278 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateOperations.xsd +789 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateReferenceSystems.xsd +429 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateSystems.xsd +408 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coverage.xsd +451 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/dataQuality.xsd +129 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/datums.xsd +484 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/defaultStyle.xsd +454 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/dictionary.xsd +137 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/direction.xsd +72 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/dynamicFeature.xsd +115 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/feature.xsd +199 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryAggregates.xsd +430 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryBasic0d1d.xsd +602 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryBasic2d.xsd +213 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryComplexes.xsd +141 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryPrimitives.xsd +1609 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/gml.xsd +22 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/gmlBase.xsd +294 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/grids.xsd +76 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/measures.xsd +200 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/observation.xsd +96 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/referenceSystems.xsd +211 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/temporal.xsd +332 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/temporalReferenceSystems.xsd +251 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/temporalTopology.xsd +186 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/topology.xsd +459 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/units.xsd +170 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/valueObjects.xsd +361 -0
- pycsw/core/schemas/ogc/gml/3.1.1/smil/smil20-language.xsd +117 -0
- pycsw/core/schemas/ogc/gml/3.1.1/smil/smil20.xsd +234 -0
- pycsw/core/schemas/ogc/gml/3.2.1/basicTypes.xsd +268 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coordinateOperations.xsd +525 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coordinateReferenceSystems.xsd +373 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coordinateSystems.xsd +297 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coverage.xsd +292 -0
- pycsw/core/schemas/ogc/gml/3.2.1/datums.xsd +287 -0
- pycsw/core/schemas/ogc/gml/3.2.1/defaultStyle.xsd +453 -0
- pycsw/core/schemas/ogc/gml/3.2.1/deprecatedTypes.xsd +1133 -0
- pycsw/core/schemas/ogc/gml/3.2.1/dictionary.xsd +90 -0
- pycsw/core/schemas/ogc/gml/3.2.1/direction.xsd +84 -0
- pycsw/core/schemas/ogc/gml/3.2.1/dynamicFeature.xsd +109 -0
- pycsw/core/schemas/ogc/gml/3.2.1/feature.xsd +94 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryAggregates.xsd +197 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryBasic0d1d.xsd +277 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryBasic2d.xsd +124 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryComplexes.xsd +95 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryPrimitives.xsd +846 -0
- pycsw/core/schemas/ogc/gml/3.2.1/gml.xsd +20 -0
- pycsw/core/schemas/ogc/gml/3.2.1/gmlBase.xsd +185 -0
- pycsw/core/schemas/ogc/gml/3.2.1/grids.xsd +64 -0
- pycsw/core/schemas/ogc/gml/3.2.1/measures.xsd +68 -0
- pycsw/core/schemas/ogc/gml/3.2.1/observation.xsd +95 -0
- pycsw/core/schemas/ogc/gml/3.2.1/referenceSystems.xsd +70 -0
- pycsw/core/schemas/ogc/gml/3.2.1/temporal.xsd +269 -0
- pycsw/core/schemas/ogc/gml/3.2.1/temporalReferenceSystems.xsd +189 -0
- pycsw/core/schemas/ogc/gml/3.2.1/temporalTopology.xsd +119 -0
- pycsw/core/schemas/ogc/gml/3.2.1/topology.xsd +386 -0
- pycsw/core/schemas/ogc/gml/3.2.1/units.xsd +162 -0
- pycsw/core/schemas/ogc/gml/3.2.1/valueObjects.xsd +205 -0
- pycsw/core/schemas/ogc/ogcapi/records/part1/1.0/ogcapi-records-1.yaml +932 -0
- pycsw/core/schemas/ogc/ows/1.0.0/ows19115subset.xsd +222 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsAll.xsd +20 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsCommon.xsd +155 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsDataIdentification.xsd +112 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsExceptionReport.xsd +67 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsGetCapabilities.xsd +108 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsOperationsMetadata.xsd +161 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsServiceIdentification.xsd +55 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsServiceProvider.xsd +46 -0
- pycsw/core/schemas/ogc/ows/1.1.0/ows19115subset.xsd +236 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsAll.xsd +23 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsCommon.xsd +158 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsContents.xsd +87 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsDataIdentification.xsd +128 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsDomainType.xsd +280 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsExceptionReport.xsd +77 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsGetCapabilities.xsd +113 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsGetResourceByID.xsd +52 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsInputOutputData.xsd +60 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsManifest.xsd +125 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsOperationsMetadata.xsd +141 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsServiceIdentification.xsd +61 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsServiceProvider.xsd +48 -0
- pycsw/core/schemas/ogc/ows/2.0/ows19115subset.xsd +364 -0
- pycsw/core/schemas/ogc/ows/2.0/owsAdditionalParameters.xsd +114 -0
- pycsw/core/schemas/ogc/ows/2.0/owsAll.xsd +29 -0
- pycsw/core/schemas/ogc/ows/2.0/owsCommon.xsd +275 -0
- pycsw/core/schemas/ogc/ows/2.0/owsContents.xsd +163 -0
- pycsw/core/schemas/ogc/ows/2.0/owsDataIdentification.xsd +202 -0
- pycsw/core/schemas/ogc/ows/2.0/owsDomainType.xsd +388 -0
- pycsw/core/schemas/ogc/ows/2.0/owsExceptionReport.xsd +126 -0
- pycsw/core/schemas/ogc/ows/2.0/owsGetCapabilities.xsd +220 -0
- pycsw/core/schemas/ogc/ows/2.0/owsGetResourceByID.xsd +83 -0
- pycsw/core/schemas/ogc/ows/2.0/owsInputOutputData.xsd +98 -0
- pycsw/core/schemas/ogc/ows/2.0/owsManifest.xsd +181 -0
- pycsw/core/schemas/ogc/ows/2.0/owsOperationsMetadata.xsd +234 -0
- pycsw/core/schemas/ogc/ows/2.0/owsServiceIdentification.xsd +98 -0
- pycsw/core/schemas/ogc/ows/2.0/owsServiceProvider.xsd +64 -0
- pycsw/core/schemas/w3c/1999/xlink.xsd +271 -0
- pycsw/core/schemas/w3c/2001/xml.xsd +287 -0
- pycsw/core/util.py +552 -0
- pycsw/oaipmh.py +311 -0
- pycsw/ogc/__init__.py +29 -0
- pycsw/ogc/api/__init__.py +28 -0
- pycsw/ogc/api/oapi.py +558 -0
- pycsw/ogc/api/records.py +1414 -0
- pycsw/ogc/api/templates/_base.html +76 -0
- pycsw/ogc/api/templates/collection.html +44 -0
- pycsw/ogc/api/templates/collections.html +45 -0
- pycsw/ogc/api/templates/conformance.html +21 -0
- pycsw/ogc/api/templates/exception.html +8 -0
- pycsw/ogc/api/templates/item.html +228 -0
- pycsw/ogc/api/templates/items.html +337 -0
- pycsw/ogc/api/templates/landing_page.html +27 -0
- pycsw/ogc/api/templates/openapi.html +58 -0
- pycsw/ogc/api/templates/queryables.html +50 -0
- pycsw/ogc/api/templates/stac_items.html +173 -0
- pycsw/ogc/api/templates/static/favicon.ico +0 -0
- pycsw/ogc/api/templates/static/logo-horizontal.png +0 -0
- pycsw/ogc/api/templates/static/logo-vertical-darkbg.png +0 -0
- pycsw/ogc/api/util.py +252 -0
- pycsw/ogc/csw/__init__.py +29 -0
- pycsw/ogc/csw/cql.py +133 -0
- pycsw/ogc/csw/csw2.py +2042 -0
- pycsw/ogc/csw/csw3.py +2193 -0
- pycsw/ogc/fes/__init__.py +29 -0
- pycsw/ogc/fes/fes1.py +433 -0
- pycsw/ogc/fes/fes2.py +451 -0
- pycsw/ogc/gml/__init__.py +29 -0
- pycsw/ogc/gml/gml3.py +240 -0
- pycsw/ogc/gml/gml32.py +243 -0
- pycsw/opensearch.py +857 -0
- pycsw/plugins/__init__.py +29 -0
- pycsw/plugins/outputschemas/__init__.py +31 -0
- pycsw/plugins/outputschemas/atom.py +143 -0
- pycsw/plugins/outputschemas/datacite.py +375 -0
- pycsw/plugins/outputschemas/dif.py +213 -0
- pycsw/plugins/outputschemas/fgdc.py +180 -0
- pycsw/plugins/outputschemas/gm03.py +240 -0
- pycsw/plugins/profiles/__init__.py +29 -0
- pycsw/plugins/profiles/apiso/__init__.py +29 -0
- pycsw/plugins/profiles/apiso/apiso.py +757 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd +13 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/basicTypes.xsd +429 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/gco.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/gcoBase.xsd +61 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/applicationSchema.xsd +42 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/citation.xsd +275 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/constraints.xsd +106 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/content.xsd +188 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/dataQuality.xsd +554 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/distribution.xsd +202 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/extent.xsd +205 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/freeText.xsd +122 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/gmd.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/identification.xsd +348 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/maintenance.xsd +86 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataApplication.xsd +175 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataEntity.xsd +70 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataExtension.xsd +99 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/portrayalCatalogue.xsd +36 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/referenceSystem.xsd +100 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/spatialRepresentation.xsd +237 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/basicTypes.xsd +267 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateOperations.xsd +639 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateReferenceSystems.xsd +526 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateSystems.xsd +401 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coverage.xsd +462 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/datums.xsd +342 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/dictionary.xsd +129 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/direction.xsd +80 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/dynamicFeature.xsd +142 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/feature.xsd +215 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryAggregates.xsd +216 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryBasic0d1d.xsd +304 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryBasic2d.xsd +123 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryComplexes.xsd +89 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryPrimitives.xsd +892 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/gml.xsd +14 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/gmlBase.xsd +305 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/grids.xsd +58 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/measures.xsd +167 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/observation.xsd +90 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/referenceSystems.xsd +69 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporal.xsd +263 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporalReferenceSystems.xsd +183 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporalTopology.xsd +124 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/topology.xsd +372 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/units.xsd +156 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/valueObjects.xsd +212 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/catalogues.xsd +112 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/codelistItem.xsd +168 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/crsItem.xsd +1030 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/extendedTypes.xsd +75 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/gmx.xsd +2 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/gmxUsage.xsd +127 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/uomItem.xsd +162 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gsr/gsr.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gsr/spatialReferencing.xsd +24 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gss/geometry.xsd +35 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gss/gss.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gts/gts.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gts/temporalObjects.xsd +34 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/serviceMetadata.xsd +197 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/serviceModel.xsd +220 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/srv.xsd +13 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/basicTypes.xsd +431 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/gco.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/gcoBase.xsd +63 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/applicationSchema.xsd +43 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/citation.xsd +276 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/constraints.xsd +107 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/content.xsd +190 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/dataQuality.xsd +556 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/distribution.xsd +203 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/extent.xsd +206 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/freeText.xsd +123 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/gmd.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/identification.xsd +349 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/maintenance.xsd +87 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataApplication.xsd +176 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataEntity.xsd +71 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataExtension.xsd +100 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/portrayalCatalogue.xsd +37 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/referenceSystem.xsd +101 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/spatialRepresentation.xsd +238 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/catalogues.xsd +113 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/codelistItem.xsd +169 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/crsItem.xsd +1031 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/extendedTypes.xsd +76 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/gmx.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/gmxUsage.xsd +128 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/uomItem.xsd +163 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gsr/gsr.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gsr/spatialReferencing.xsd +25 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gss/geometry.xsd +36 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gss/gss.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gts/gts.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gts/temporalObjects.xsd +35 -0
- pycsw/plugins/profiles/ebrim/__init__.py +29 -0
- pycsw/plugins/profiles/ebrim/ebrim.py +174 -0
- pycsw/plugins/profiles/ebrim/schemas/ogc/csw/2.0.2/profiles/ebrim/1.0/csw-ebrim-iri.xsd +146 -0
- pycsw/plugins/profiles/ebrim/schemas/ogc/csw/2.0.2/profiles/ebrim/1.0/csw-ebrim.xsd +104 -0
- pycsw/plugins/profiles/iso19115p3/__init__.py +29 -0
- pycsw/plugins/profiles/iso19115p3/iso19115p3.py +854 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/cat.xsd +13 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/catalogues.xsd +53 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/codelistItem.xsd +54 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/crsItem.xsd +181 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/uomItem.xsd +38 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/1.0/cit.xsd +7 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/1.0/citation.xsd +514 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/2.0/cit.xsd +10 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/2.0/citation.xsd +523 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gco/1.0/baseTypes2014.xsd +530 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gco/1.0/gco.xsd +16 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/extendedTypes.xsd +92 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/extendedTypes_autoFromShapeChange.xsd +60 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/gcx.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gex/1.0/extent.xsd +241 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gex/1.0/gex.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gmw/1.0/gmlWrapperTypes2014.xsd +159 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gmw/1.0/gmw.xsd +14 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/lan/1.0/lan.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/lan/1.0/language.xsd +140 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/1.0/acquisitionInformationImagery.xsd +622 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/1.0/mac.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/acquisitionInformationImagery.xsd +590 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/event.xsd +108 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/mac.xsd +10 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mas/1.0/applicationSchema.xsd +61 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mas/1.0/mas.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/AbstractCommonClasses.xsd +358 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/commonClasses.xsd +220 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/mcc.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mco/1.0/constraints.xsd +188 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mco/1.0/mco.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md1/1.0/md1.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md1/1.0/metadataWExtendedType.xsd +4 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md2/1.0/md2.xsd +15 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md2/1.0/metadataWithExtensions.xsd +4 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mda/1.0/mda.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mda/1.0/metadataApplication.xsd +200 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/1.0/mdb.xsd +14 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/1.0/metadataBase.xsd +98 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/2.0/mdb.xsd +20 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/2.0/metadataBase.xsd +102 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mds/1.0/mds.xsd +22 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mds/1.0/metadataDataServices.xsd +4 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdt/1.0/mdt.xsd +13 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdt/1.0/metadataTransfer.xsd +111 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mex/1.0/metadataExtension.xsd +156 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mex/1.0/mex.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mmi/1.0/maintenance.xsd +76 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mmi/1.0/mmi.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mpc/1.0/mpc.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mpc/1.0/portrayalCatalogue.xsd +31 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/content.xsd +416 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/contentInformationImagery.xsd +185 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/mrc.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/content.xsd +419 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/contentInformationImagery.xsd +171 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/mrc.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrd/1.0/distribution.xsd +267 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrd/1.0/mrd.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mri/1.0/identification.xsd +517 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mri/1.0/mri.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/lineage.xsd +147 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/lineageImagery.xsd +236 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/mrl.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/lineage.xsd +147 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/lineageImagery.xsd +312 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/mrl.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrs/1.0/mrs.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrs/1.0/referenceSystem.xsd +47 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/msr.xsd +10 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/spatialRepresentation.xsd +375 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/spatialRepresentationImagery.xsd +119 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/msr.xsd +15 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/spatialRepresentation.xsd +381 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/spatialRepresentationImagery.xsd +120 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.0/serviceInformation.xsd +272 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.0/srv.xsd +6 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.1/serviceInformation.xsd +278 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.1/srv.xsd +6 -0
- pycsw/plugins/profiles/profile.py +141 -0
- pycsw/plugins/repository/__init__.py +29 -0
- pycsw/plugins/repository/odc/__init__.py +29 -0
- pycsw/plugins/repository/odc/odc.py +153 -0
- pycsw/server.py +938 -0
- pycsw/sru.py +217 -0
- pycsw/stac/__init__.py +29 -0
- pycsw/stac/api.py +571 -0
- pycsw/wsgi.py +233 -0
- pycsw/wsgi_flask.py +345 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# =================================================================
|
|
3
|
+
#
|
|
4
|
+
# Authors: Tom Kralidis <tomkralidis@gmail.com>
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2024 Tom Kralidis
|
|
7
|
+
#
|
|
8
|
+
# Permission is hereby granted, free of charge, to any person
|
|
9
|
+
# obtaining a copy of this software and associated documentation
|
|
10
|
+
# files (the "Software"), to deal in the Software without
|
|
11
|
+
# restriction, including without limitation the rights to use,
|
|
12
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
# copies of the Software, and to permit persons to whom the
|
|
14
|
+
# Software is furnished to do so, subject to the following
|
|
15
|
+
# conditions:
|
|
16
|
+
#
|
|
17
|
+
# The above copyright notice and this permission notice shall be
|
|
18
|
+
# included in all copies or substantial portions of the Software.
|
|
19
|
+
#
|
|
20
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
22
|
+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
24
|
+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
26
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
27
|
+
# OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
#
|
|
29
|
+
# =================================================================
|
|
30
|
+
|
|
31
|
+
from pycsw.core import util
|
|
32
|
+
from pycsw.core.etree import etree
|
|
33
|
+
|
|
34
|
+
NAMESPACE = 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'
|
|
35
|
+
NAMESPACES = {'dif': NAMESPACE}
|
|
36
|
+
|
|
37
|
+
XPATH_MAPPINGS = {
|
|
38
|
+
'pycsw:Title': 'dif:Entry_Title',
|
|
39
|
+
'pycsw:Creator': 'dif:Data_Set_Citation/dif:Dataset_Creator',
|
|
40
|
+
'pycsw:TopicCategory': 'dif:ISO_Topic_Category',
|
|
41
|
+
'pycsw:Keywords': 'dif:Keyword',
|
|
42
|
+
'pycsw:Abstract': 'dif:Summary',
|
|
43
|
+
'pycsw:Publisher': 'dif:Data_Set_Citation/dif:Dataset_Publisher',
|
|
44
|
+
'pycsw:OrganizationName': 'dif:Originating_Center',
|
|
45
|
+
'pycsw:CreationDate': 'dif:DIF_Creation_Date','pycsw:PublicationDate': 'dif:Data_Set_Citation/dif:Dataset_Release_Date',
|
|
46
|
+
'pycsw:Format': 'dif:Data_Set_Citation/dif:Data_Presentation_Form',
|
|
47
|
+
'pycsw:ResourceLanguage': 'dif:Data_Set_Language',
|
|
48
|
+
'pycsw:Relation': 'dif:Related_URL/dif:URL',
|
|
49
|
+
'pycsw:AccessConstraints': 'dif:Access_Constraints',
|
|
50
|
+
'pycsw:TempExtent_begin': 'dif:Temporal_Coverage/dif:Start_Date',
|
|
51
|
+
'pycsw:TempExtent_end': 'dif:Temporal_Coverage/dif:Stop_Date',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
def write_record(result, esn, context, url=None):
|
|
55
|
+
''' Return csw:SearchResults child as lxml.etree.Element '''
|
|
56
|
+
|
|
57
|
+
typename = util.getqattr(result, context.md_core_model['mappings']['pycsw:Typename'])
|
|
58
|
+
|
|
59
|
+
if esn == 'full' and typename == 'dif:DIF':
|
|
60
|
+
# dump record as is and exit
|
|
61
|
+
return etree.fromstring(util.getqattr(result, context.md_core_model['mappings']['pycsw:XML']), context.parser)
|
|
62
|
+
|
|
63
|
+
node = etree.Element(util.nspath_eval('dif:DIF', NAMESPACES))
|
|
64
|
+
node.attrib[util.nspath_eval('xsi:schemaLocation', context.namespaces)] = \
|
|
65
|
+
'%s http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/dif.xsd' % NAMESPACE
|
|
66
|
+
|
|
67
|
+
# identifier
|
|
68
|
+
etree.SubElement(node, util.nspath_eval('dif:Entry_ID', NAMESPACES)).text = util.getqattr(result, context.md_core_model['mappings']['pycsw:Identifier'])
|
|
69
|
+
|
|
70
|
+
# title
|
|
71
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Title'])
|
|
72
|
+
if not val:
|
|
73
|
+
val = ''
|
|
74
|
+
etree.SubElement(node, util.nspath_eval('dif:Entry_Title', NAMESPACES)).text = val
|
|
75
|
+
|
|
76
|
+
# citation
|
|
77
|
+
citation = etree.SubElement(node, util.nspath_eval('dif:Data_Set_Citation', NAMESPACES))
|
|
78
|
+
|
|
79
|
+
# creator
|
|
80
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Creator'])
|
|
81
|
+
etree.SubElement(citation, util.nspath_eval('dif:Dataset_Creator', NAMESPACES)).text = val
|
|
82
|
+
|
|
83
|
+
# date
|
|
84
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:PublicationDate'])
|
|
85
|
+
etree.SubElement(citation, util.nspath_eval('dif:Dataset_Release_Date', NAMESPACES)).text = val
|
|
86
|
+
|
|
87
|
+
# publisher
|
|
88
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Publisher'])
|
|
89
|
+
etree.SubElement(citation, util.nspath_eval('dif:Dataset_Publisher', NAMESPACES)).text = val
|
|
90
|
+
|
|
91
|
+
# format
|
|
92
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Format'])
|
|
93
|
+
etree.SubElement(citation, util.nspath_eval('dif:Data_Presentation_Form', NAMESPACES)).text = val
|
|
94
|
+
|
|
95
|
+
# keywords dif:Parameters
|
|
96
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Keywords'])
|
|
97
|
+
if val:
|
|
98
|
+
kws = val.split(',')
|
|
99
|
+
parameters_indexes = []
|
|
100
|
+
for index, kw in enumerate(kws):
|
|
101
|
+
if "Earth Science".lower() in kw.lower() and len(kw.split(">")) >= 2:
|
|
102
|
+
values = kw.upper().split(">")
|
|
103
|
+
parameters = etree.SubElement(node, util.nspath_eval('dif:Parameters', NAMESPACES)) # .text = kw
|
|
104
|
+
etree.SubElement(parameters, util.nspath_eval('dif:Category', NAMESPACES)).text = values[0].strip().upper()
|
|
105
|
+
etree.SubElement(parameters, util.nspath_eval('dif:Topic', NAMESPACES)).text = values[1].strip().upper()
|
|
106
|
+
etree.SubElement(parameters, util.nspath_eval('dif:Term', NAMESPACES)).text = values[2].strip().upper()
|
|
107
|
+
for i, v in enumerate(values[3:]):
|
|
108
|
+
etree.SubElement(parameters, util.nspath_eval(f'dif:Variable_Level_{i + 1}', NAMESPACES)).text = v.strip()
|
|
109
|
+
parameters_indexes.append(index)
|
|
110
|
+
# kws.pop(index)
|
|
111
|
+
|
|
112
|
+
# iso topic category
|
|
113
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:TopicCategory'])
|
|
114
|
+
etree.SubElement(node, util.nspath_eval('dif:ISO_Topic_Category', NAMESPACES)).text = val
|
|
115
|
+
|
|
116
|
+
# keywords dif:keywords
|
|
117
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Keywords'])
|
|
118
|
+
if val:
|
|
119
|
+
kws = val.split(',')
|
|
120
|
+
kws = [i for j, i in enumerate(kws) if j not in parameters_indexes]
|
|
121
|
+
for index, kw in enumerate(kws):
|
|
122
|
+
etree.SubElement(node, util.nspath_eval('dif:Keyword', NAMESPACES)).text = kw.strip()
|
|
123
|
+
|
|
124
|
+
# temporal
|
|
125
|
+
temporal = etree.SubElement(node, util.nspath_eval('dif:Temporal_Coverage', NAMESPACES))
|
|
126
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:TempExtent_begin'])
|
|
127
|
+
val2 = util.getqattr(result, context.md_core_model['mappings']['pycsw:TempExtent_end'])
|
|
128
|
+
etree.SubElement(temporal, util.nspath_eval('dif:Start_Date', NAMESPACES)).text = val
|
|
129
|
+
etree.SubElement(temporal, util.nspath_eval('dif:End_Date', NAMESPACES)).text = val2
|
|
130
|
+
|
|
131
|
+
# bbox extent
|
|
132
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:BoundingBox'])
|
|
133
|
+
bboxel = write_extent(val, NAMESPACES)
|
|
134
|
+
if bboxel is not None:
|
|
135
|
+
node.append(bboxel)
|
|
136
|
+
|
|
137
|
+
# access constraints
|
|
138
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:AccessConstraints'])
|
|
139
|
+
etree.SubElement(node, util.nspath_eval('dif:Access_Constraints', NAMESPACES)).text = val
|
|
140
|
+
|
|
141
|
+
# language
|
|
142
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:ResourceLanguage'])
|
|
143
|
+
etree.SubElement(node, util.nspath_eval('dif:Data_Set_Language', NAMESPACES)).text = val
|
|
144
|
+
|
|
145
|
+
# contributor
|
|
146
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:OrganizationName'])
|
|
147
|
+
etree.SubElement(node, util.nspath_eval('dif:Originating_Center', NAMESPACES)).text = val
|
|
148
|
+
|
|
149
|
+
# abstract
|
|
150
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Abstract'])
|
|
151
|
+
if not val:
|
|
152
|
+
val = ''
|
|
153
|
+
etree.SubElement(node, util.nspath_eval('dif:Summary', NAMESPACES)).text = val
|
|
154
|
+
|
|
155
|
+
# URL
|
|
156
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Relation'])
|
|
157
|
+
if val:
|
|
158
|
+
url = etree.SubElement(node, util.nspath_eval('dif:Related_URL', NAMESPACES))
|
|
159
|
+
etree.SubElement(url, util.nspath_eval('dif:URL', NAMESPACES)).text = val
|
|
160
|
+
|
|
161
|
+
rlinks = util.getqattr(result, context.md_core_model['mappings']['pycsw:Links'])
|
|
162
|
+
if rlinks:
|
|
163
|
+
for link in util.jsonify_links(rlinks):
|
|
164
|
+
url2 = etree.SubElement(node, util.nspath_eval('dif:Related_URL', NAMESPACES))
|
|
165
|
+
|
|
166
|
+
urltype = etree.SubElement(url2, util.nspath_eval('dif:URL_Content_Type', NAMESPACES))
|
|
167
|
+
if link['protocol'] == 'download':
|
|
168
|
+
etree.SubElement(urltype, util.nspath_eval('dif:Type', NAMESPACES)).text = 'GET DATA'
|
|
169
|
+
elif link['protocol'] == 'OPENDAP:OPENDAP':
|
|
170
|
+
etree.SubElement(urltype, util.nspath_eval('dif:Type', NAMESPACES)).text = 'GET DATA'
|
|
171
|
+
etree.SubElement(urltype, util.nspath_eval('dif:Subtype', NAMESPACES)).text = 'OPENDAP DATA (DODS)'
|
|
172
|
+
elif link['protocol'] == 'OGC:WMS':
|
|
173
|
+
etree.SubElement(urltype, util.nspath_eval('dif:Type', NAMESPACES)).text = 'GET SERVICE'
|
|
174
|
+
etree.SubElement(urltype, util.nspath_eval('dif:Subtype', NAMESPACES)).text = 'GET WEB MAP SERVICE (WMS)'
|
|
175
|
+
else:
|
|
176
|
+
etree.SubElement(urltype, util.nspath_eval('dif:Type', NAMESPACES)).text = 'GET DATA'
|
|
177
|
+
|
|
178
|
+
etree.SubElement(url2, util.nspath_eval('dif:URL', NAMESPACES)).text = link['url']
|
|
179
|
+
if link['description']:
|
|
180
|
+
etree.SubElement(url2, util.nspath_eval('dif:Description', NAMESPACES)).text = link['description']
|
|
181
|
+
|
|
182
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Source'])
|
|
183
|
+
if val:
|
|
184
|
+
url2 = etree.SubElement(node, util.nspath_eval('dif:Related_URL', NAMESPACES))
|
|
185
|
+
urltype = etree.SubElement(url2, util.nspath_eval('dif:URL_Content_Type', NAMESPACES))
|
|
186
|
+
etree.SubElement(urltype, util.nspath_eval('dif:Type', NAMESPACES)).text = 'DATASET LANDING PAGE'
|
|
187
|
+
etree.SubElement(url2, util.nspath_eval('dif:URL', NAMESPACES)).text = val
|
|
188
|
+
|
|
189
|
+
etree.SubElement(node, util.nspath_eval('dif:Metadata_Name', NAMESPACES)).text = 'CEOS IDN DIF'
|
|
190
|
+
etree.SubElement(node, util.nspath_eval('dif:Metadata_Version', NAMESPACES)).text = '9.7'
|
|
191
|
+
|
|
192
|
+
# date
|
|
193
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:CreationDate'])
|
|
194
|
+
etree.SubElement(node, util.nspath_eval('dif:DIF_Creation_Date', NAMESPACES)).text = val
|
|
195
|
+
|
|
196
|
+
return node
|
|
197
|
+
|
|
198
|
+
def write_extent(bbox, nsmap):
|
|
199
|
+
''' Generate BBOX extent '''
|
|
200
|
+
|
|
201
|
+
if bbox is not None:
|
|
202
|
+
try:
|
|
203
|
+
bbox2 = util.wkt2geom(bbox)
|
|
204
|
+
except Exception as err:
|
|
205
|
+
LOGGER.debug(f'Geometry parsing error: {err}')
|
|
206
|
+
return None
|
|
207
|
+
extent = etree.Element(util.nspath_eval('dif:Spatial_Coverage', nsmap))
|
|
208
|
+
etree.SubElement(extent, util.nspath_eval('dif:Southernmost_Latitude', nsmap)).text = str(bbox2[1])
|
|
209
|
+
etree.SubElement(extent, util.nspath_eval('dif:Northernmost_Latitude', nsmap)).text = str(bbox2[3])
|
|
210
|
+
etree.SubElement(extent, util.nspath_eval('dif:Westernmost_Longitude', nsmap)).text = str(bbox2[0])
|
|
211
|
+
etree.SubElement(extent, util.nspath_eval('dif:Easternmost_Longitude', nsmap)).text = str(bbox2[2])
|
|
212
|
+
return extent
|
|
213
|
+
return None
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# =================================================================
|
|
3
|
+
#
|
|
4
|
+
# Authors: Tom Kralidis <tomkralidis@gmail.com>
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2024 Tom Kralidis
|
|
7
|
+
#
|
|
8
|
+
# Permission is hereby granted, free of charge, to any person
|
|
9
|
+
# obtaining a copy of this software and associated documentation
|
|
10
|
+
# files (the "Software"), to deal in the Software without
|
|
11
|
+
# restriction, including without limitation the rights to use,
|
|
12
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
# copies of the Software, and to permit persons to whom the
|
|
14
|
+
# Software is furnished to do so, subject to the following
|
|
15
|
+
# conditions:
|
|
16
|
+
#
|
|
17
|
+
# The above copyright notice and this permission notice shall be
|
|
18
|
+
# included in all copies or substantial portions of the Software.
|
|
19
|
+
#
|
|
20
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
22
|
+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
24
|
+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
26
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
27
|
+
# OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
#
|
|
29
|
+
# =================================================================
|
|
30
|
+
|
|
31
|
+
from pycsw.core import util
|
|
32
|
+
from pycsw.core.etree import etree
|
|
33
|
+
|
|
34
|
+
#NAMESPACE = 'http://www.fgdc.gov/metadata/csdgm'
|
|
35
|
+
NAMESPACE = 'http://www.opengis.net/cat/csw/csdgm'
|
|
36
|
+
NAMESPACES = {'fgdc': NAMESPACE}
|
|
37
|
+
|
|
38
|
+
XPATH_MAPPINGS = {
|
|
39
|
+
'pycsw:Identifier': 'idinfo/datasetid',
|
|
40
|
+
'pycsw:Title': 'idinfo/citation/citeinfo/title',
|
|
41
|
+
'pycsw:Creator': 'idinfo/citation/citeinfo/origin',
|
|
42
|
+
'pycsw:Publisher': 'idinfo/citation/citeinfo/publinfo/publish',
|
|
43
|
+
'pycsw:Abstract': 'idinfo/descript/abstract',
|
|
44
|
+
'pycsw:Format': 'idinfo/citation/citeinfo/geoform',
|
|
45
|
+
'pycsw:PublicationDate': 'idinfo/citation/citeinfo/pubdate',
|
|
46
|
+
'pycsw:Keywords': 'idinfo/keywords/theme/themekey',
|
|
47
|
+
'pycsw:TempExtent_begin': 'idinfo/timeperd/timeinfo/rngdates/begdate',
|
|
48
|
+
'pycsw:TempExtent_end': 'idinfo/timeperd/timeinfo/rngdates/enddate',
|
|
49
|
+
'pycsw:Contributor': 'idinfo/datacred',
|
|
50
|
+
'pycsw:AccessConstraints': 'idinfo/accconst',
|
|
51
|
+
'pycsw:Modified': 'metainfo/metd',
|
|
52
|
+
'pycsw:Type': 'spdoinfo/direct',
|
|
53
|
+
'pycsw:Source': 'lineage/srcinfo/srccite/citeinfo/title',
|
|
54
|
+
'pycsw:Relation': 'idinfo/citation/citeinfo/onlink',
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
def write_record(recobj, esn, context, url=None):
|
|
58
|
+
''' Return csw:SearchResults child as lxml.etree.Element '''
|
|
59
|
+
typename = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Typename'])
|
|
60
|
+
if esn == 'full' and typename == 'fgdc:metadata':
|
|
61
|
+
# dump record as is and exit
|
|
62
|
+
return etree.fromstring(util.getqattr(recobj, context.md_core_model['mappings']['pycsw:XML']), context.parser)
|
|
63
|
+
|
|
64
|
+
node = etree.Element('metadata')
|
|
65
|
+
node.attrib[util.nspath_eval('xsi:noNamespaceSchemaLocation', context.namespaces)] = \
|
|
66
|
+
'http://www.fgdc.gov/metadata/fgdc-std-001-1998.xsd'
|
|
67
|
+
|
|
68
|
+
idinfo = etree.SubElement(node, 'idinfo')
|
|
69
|
+
# identifier
|
|
70
|
+
etree.SubElement(idinfo, 'datasetid').text = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Identifier'])
|
|
71
|
+
|
|
72
|
+
citation = etree.SubElement(idinfo, 'citation')
|
|
73
|
+
citeinfo = etree.SubElement(citation, 'citeinfo')
|
|
74
|
+
|
|
75
|
+
# title
|
|
76
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Title'])
|
|
77
|
+
etree.SubElement(citeinfo, 'title').text = val
|
|
78
|
+
|
|
79
|
+
# publisher
|
|
80
|
+
publinfo = etree.SubElement(citeinfo, 'publinfo')
|
|
81
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Publisher']) or ''
|
|
82
|
+
etree.SubElement(publinfo, 'publish').text = val
|
|
83
|
+
|
|
84
|
+
# origin
|
|
85
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Creator']) or ''
|
|
86
|
+
etree.SubElement(citeinfo, 'origin').text = val
|
|
87
|
+
|
|
88
|
+
# keywords
|
|
89
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Keywords'])
|
|
90
|
+
if val:
|
|
91
|
+
keywords = etree.SubElement(idinfo, 'keywords')
|
|
92
|
+
theme = etree.SubElement(keywords, 'theme')
|
|
93
|
+
for v in val.split(','):
|
|
94
|
+
etree.SubElement(theme, 'themekey').text = v
|
|
95
|
+
|
|
96
|
+
# accessconstraints
|
|
97
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:AccessConstraints']) or ''
|
|
98
|
+
etree.SubElement(idinfo, 'accconst').text = val
|
|
99
|
+
|
|
100
|
+
# abstract
|
|
101
|
+
descript = etree.SubElement(idinfo, 'descript')
|
|
102
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Abstract']) or ''
|
|
103
|
+
etree.SubElement(descript, 'abstract').text = val
|
|
104
|
+
|
|
105
|
+
# time
|
|
106
|
+
datebegin = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:TempExtent_begin'])
|
|
107
|
+
dateend = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:TempExtent_end'])
|
|
108
|
+
if all([datebegin, dateend]):
|
|
109
|
+
timeperd = etree.SubElement(idinfo, 'timeperd')
|
|
110
|
+
timeinfo = etree.SubElement(timeperd, 'timeinfo')
|
|
111
|
+
rngdates = etree.SubElement(timeinfo, 'timeinfo')
|
|
112
|
+
begdate = etree.SubElement(rngdates, 'begdate').text = datebegin
|
|
113
|
+
enddate = etree.SubElement(rngdates, 'enddate').text = dateend
|
|
114
|
+
|
|
115
|
+
# bbox extent
|
|
116
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:BoundingBox'])
|
|
117
|
+
bboxel = write_extent(val)
|
|
118
|
+
if bboxel is not None:
|
|
119
|
+
idinfo.append(bboxel)
|
|
120
|
+
|
|
121
|
+
# contributor
|
|
122
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Contributor']) or ''
|
|
123
|
+
etree.SubElement(idinfo, 'datacred').text = val
|
|
124
|
+
|
|
125
|
+
# direct
|
|
126
|
+
spdoinfo = etree.SubElement(idinfo, 'spdoinfo')
|
|
127
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Type']) or ''
|
|
128
|
+
etree.SubElement(spdoinfo, 'direct').text = val
|
|
129
|
+
|
|
130
|
+
# formname
|
|
131
|
+
distinfo = etree.SubElement(node, 'distinfo')
|
|
132
|
+
stdorder = etree.SubElement(distinfo, 'stdorder')
|
|
133
|
+
digform = etree.SubElement(stdorder, 'digform')
|
|
134
|
+
digtinfo = etree.SubElement(digform, 'digtinfo')
|
|
135
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Format']) or ''
|
|
136
|
+
etree.SubElement(digtinfo, 'formname').text = val
|
|
137
|
+
etree.SubElement(citeinfo, 'geoform').text = val
|
|
138
|
+
|
|
139
|
+
# source
|
|
140
|
+
lineage = etree.SubElement(node, 'lineage')
|
|
141
|
+
srcinfo = etree.SubElement(lineage, 'srcinfo')
|
|
142
|
+
srccite = etree.SubElement(srcinfo, 'srccite')
|
|
143
|
+
sciteinfo = etree.SubElement(srccite, 'citeinfo')
|
|
144
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Source']) or ''
|
|
145
|
+
etree.SubElement(sciteinfo, 'title').text = val
|
|
146
|
+
|
|
147
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Relation']) or ''
|
|
148
|
+
etree.SubElement(citeinfo, 'onlink').text = val
|
|
149
|
+
|
|
150
|
+
# links
|
|
151
|
+
rlinks = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Links'])
|
|
152
|
+
if rlinks:
|
|
153
|
+
for link in util.jsonify_links(rlinks):
|
|
154
|
+
etree.SubElement(citeinfo, 'onlink', type=link['protocol']).text = link['url']
|
|
155
|
+
|
|
156
|
+
# metd
|
|
157
|
+
metainfo = etree.SubElement(node, 'metainfo')
|
|
158
|
+
val = util.getqattr(recobj, context.md_core_model['mappings']['pycsw:Modified']) or ''
|
|
159
|
+
etree.SubElement(metainfo, 'metd').text = val
|
|
160
|
+
|
|
161
|
+
return node
|
|
162
|
+
|
|
163
|
+
def write_extent(bbox):
|
|
164
|
+
''' Generate BBOX extent '''
|
|
165
|
+
|
|
166
|
+
if bbox is not None:
|
|
167
|
+
try:
|
|
168
|
+
bbox2 = util.wkt2geom(bbox)
|
|
169
|
+
except Exception as err:
|
|
170
|
+
LOGGER.debug(f'Geometry parsing error: {err}')
|
|
171
|
+
return None
|
|
172
|
+
|
|
173
|
+
spdom = etree.Element('spdom')
|
|
174
|
+
bounding = etree.SubElement(spdom, 'bounding')
|
|
175
|
+
etree.SubElement(bounding, 'westbc').text = str(bbox2[0])
|
|
176
|
+
etree.SubElement(bounding, 'eastbc').text = str(bbox2[2])
|
|
177
|
+
etree.SubElement(bounding, 'northbc').text = str(bbox2[3])
|
|
178
|
+
etree.SubElement(bounding, 'southbc').text = str(bbox2[1])
|
|
179
|
+
return spdom
|
|
180
|
+
return None
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# =================================================================
|
|
3
|
+
#
|
|
4
|
+
# Authors: Tom Kralidis <tomkralidis@gmail.com>
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2024 Tom Kralidis
|
|
7
|
+
#
|
|
8
|
+
# Permission is hereby granted, free of charge, to any person
|
|
9
|
+
# obtaining a copy of this software and associated documentation
|
|
10
|
+
# files (the "Software"), to deal in the Software without
|
|
11
|
+
# restriction, including without limitation the rights to use,
|
|
12
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
# copies of the Software, and to permit persons to whom the
|
|
14
|
+
# Software is furnished to do so, subject to the following
|
|
15
|
+
# conditions:
|
|
16
|
+
#
|
|
17
|
+
# The above copyright notice and this permission notice shall be
|
|
18
|
+
# included in all copies or substantial portions of the Software.
|
|
19
|
+
#
|
|
20
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
22
|
+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
24
|
+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
26
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
27
|
+
# OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
#
|
|
29
|
+
# =================================================================
|
|
30
|
+
|
|
31
|
+
from pycsw.core import util
|
|
32
|
+
from pycsw.core.etree import etree
|
|
33
|
+
|
|
34
|
+
NAMESPACE = 'http://www.interlis.ch/INTERLIS2.3'
|
|
35
|
+
NAMESPACES = {'gm03': NAMESPACE}
|
|
36
|
+
|
|
37
|
+
XPATH_MAPPINGS = {}
|
|
38
|
+
|
|
39
|
+
def write_record(result, esn, context, url=None):
|
|
40
|
+
''' Return csw:SearchResults child as lxml.etree.Element '''
|
|
41
|
+
|
|
42
|
+
typename = util.getqattr(result, context.md_core_model['mappings']['pycsw:Typename'])
|
|
43
|
+
|
|
44
|
+
if typename == 'gm03:TRANSFER':
|
|
45
|
+
# dump record as is and exit
|
|
46
|
+
# TODO: provide brief and summary elementsetname's
|
|
47
|
+
return etree.fromstring(util.getqattr(result, context.md_core_model['mappings']['pycsw:XML']), context.parser)
|
|
48
|
+
|
|
49
|
+
node = etree.Element(util.nspath_eval('gm03:TRANSFER', NAMESPACES), nsmap=NAMESPACES)
|
|
50
|
+
|
|
51
|
+
header = etree.SubElement(node, util.nspath_eval('gm03:HEADERSECTION', NAMESPACES))
|
|
52
|
+
header.attrib['version'] = '2.3'
|
|
53
|
+
header.attrib['sender'] = 'pycsw'
|
|
54
|
+
|
|
55
|
+
etree.SubElement(header, util.nspath_eval('gm03:MODELS', NAMESPACES))
|
|
56
|
+
|
|
57
|
+
data = etree.SubElement(node, util.nspath_eval('gm03:DATASECTION', NAMESPACES))
|
|
58
|
+
|
|
59
|
+
core = etree.SubElement(data, util.nspath_eval('gm03:GM03_2_1Core.Core', NAMESPACES))
|
|
60
|
+
core_meta = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.MD_Metadata', NAMESPACES))
|
|
61
|
+
|
|
62
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Identifier'])
|
|
63
|
+
etree.SubElement(core_meta, util.nspath_eval('gm03:fileIdentifier', NAMESPACES)).text = val
|
|
64
|
+
|
|
65
|
+
language = util.getqattr(result, context.md_core_model['mappings']['pycsw:Language'])
|
|
66
|
+
etree.SubElement(core_meta, util.nspath_eval('gm03:language', NAMESPACES)).text = language
|
|
67
|
+
|
|
68
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Modified'])
|
|
69
|
+
etree.SubElement(core_meta, util.nspath_eval('gm03:dateStamp', NAMESPACES)).text = val
|
|
70
|
+
|
|
71
|
+
hierarchy_level_val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Type'])
|
|
72
|
+
|
|
73
|
+
# metadata standard name
|
|
74
|
+
standard = etree.SubElement(core_meta, util.nspath_eval('gm03:metadataStandardName', NAMESPACES)).text = 'GM03'
|
|
75
|
+
|
|
76
|
+
# metadata standard version
|
|
77
|
+
standardver = etree.SubElement(core_meta, util.nspath_eval('gm03:metadataStandardVersion', NAMESPACES)).text = '2.3'
|
|
78
|
+
|
|
79
|
+
# hierarchy level
|
|
80
|
+
hierarchy_level = etree.SubElement(core_meta, util.nspath_eval('gm03:hierarchyLevel', NAMESPACES))
|
|
81
|
+
scope_code = etree.SubElement(hierarchy_level, util.nspath_eval('gm03:GM03_2_1Core.Core.MD_ScopeCode_', NAMESPACES))
|
|
82
|
+
etree.SubElement(scope_code, util.nspath_eval('gm03:value', NAMESPACES)).text = hierarchy_level_val
|
|
83
|
+
|
|
84
|
+
# parent identifier
|
|
85
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:ParentIdentifier'])
|
|
86
|
+
parent_identifier = etree.SubElement(core_meta, util.nspath_eval('gm03:parentIdentifier', NAMESPACES))
|
|
87
|
+
scope_code = etree.SubElement(parent_identifier, util.nspath_eval('gm03:GM03_2_1Core.Core.MD_ScopeCode_', NAMESPACES))
|
|
88
|
+
etree.SubElement(scope_code, util.nspath_eval('gm03:value', NAMESPACES)).text = val
|
|
89
|
+
|
|
90
|
+
# title
|
|
91
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Title'])
|
|
92
|
+
citation = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.CI_Citation', NAMESPACES))
|
|
93
|
+
title = etree.SubElement(citation, util.nspath_eval('gm03:title', NAMESPACES))
|
|
94
|
+
title.append(_get_pt_freetext(val, language))
|
|
95
|
+
|
|
96
|
+
# abstract
|
|
97
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Abstract'])
|
|
98
|
+
data_ident = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.MD_DataIdentification', NAMESPACES))
|
|
99
|
+
abstract = etree.SubElement(data_ident, util.nspath_eval('gm03:abstract', NAMESPACES))
|
|
100
|
+
abstract.append(_get_pt_freetext(val, language))
|
|
101
|
+
|
|
102
|
+
# resource language
|
|
103
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:ResourceLanguage'])
|
|
104
|
+
if val:
|
|
105
|
+
topicategory = etree.SubElement(data_ident, util.nspath_eval('gm03:language', NAMESPACES))
|
|
106
|
+
cat_code = etree.SubElement(topicategory, util.nspath_eval('gm03:CodeISO.LanguageCodeISO_', NAMESPACES))
|
|
107
|
+
etree.SubElement(cat_code, util.nspath_eval('gm03:value', NAMESPACES)).text = val
|
|
108
|
+
|
|
109
|
+
# topic category
|
|
110
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:TopicCategory'])
|
|
111
|
+
if val:
|
|
112
|
+
topicategory = etree.SubElement(data_ident, util.nspath_eval('gm03:topicCategory', NAMESPACES))
|
|
113
|
+
cat_code = etree.SubElement(topicategory, util.nspath_eval('gm03:GM03_2_1Core.Core.MD_TopicCategoryCode_', NAMESPACES))
|
|
114
|
+
etree.SubElement(cat_code, util.nspath_eval('gm03:value', NAMESPACES)).text = val
|
|
115
|
+
|
|
116
|
+
# keywords
|
|
117
|
+
keywords_val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Keywords'])
|
|
118
|
+
|
|
119
|
+
if keywords_val:
|
|
120
|
+
md_keywords = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.MD_Keywords', NAMESPACES))
|
|
121
|
+
|
|
122
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:KeywordType'])
|
|
123
|
+
if val:
|
|
124
|
+
etree.SubElement(md_keywords, util.nspath_eval('gm03:type', NAMESPACES)).text = val
|
|
125
|
+
|
|
126
|
+
keyword = etree.SubElement(md_keywords, util.nspath_eval('gm03:keyword', NAMESPACES))
|
|
127
|
+
for kw in keywords_val.split(','):
|
|
128
|
+
keyword.append(_get_pt_freetext(kw, language))
|
|
129
|
+
|
|
130
|
+
# format
|
|
131
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:Format'])
|
|
132
|
+
if val:
|
|
133
|
+
md_format = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.MD_Format', NAMESPACES))
|
|
134
|
+
etree.SubElement(md_format, util.nspath_eval('gm03:name', NAMESPACES)).text = val
|
|
135
|
+
|
|
136
|
+
# creation date
|
|
137
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:CreationDate'])
|
|
138
|
+
if val:
|
|
139
|
+
ci_date = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.CI_Date', NAMESPACES))
|
|
140
|
+
etree.SubElement(ci_date, util.nspath_eval('gm03:date', NAMESPACES)).text = val
|
|
141
|
+
etree.SubElement(ci_date, util.nspath_eval('gm03:dateType', NAMESPACES)).text = 'creation'
|
|
142
|
+
|
|
143
|
+
# revision date
|
|
144
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:RevisionDate'])
|
|
145
|
+
if val:
|
|
146
|
+
ci_date = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.CI_Date', NAMESPACES))
|
|
147
|
+
etree.SubElement(ci_date, util.nspath_eval('gm03:date', NAMESPACES)).text = val
|
|
148
|
+
etree.SubElement(ci_date, util.nspath_eval('gm03:dateType', NAMESPACES)).text = 'revision'
|
|
149
|
+
|
|
150
|
+
# publication date
|
|
151
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:PublicationDate'])
|
|
152
|
+
if val:
|
|
153
|
+
ci_date = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.CI_Date', NAMESPACES))
|
|
154
|
+
etree.SubElement(ci_date, util.nspath_eval('gm03:date', NAMESPACES)).text = val
|
|
155
|
+
etree.SubElement(ci_date, util.nspath_eval('gm03:dateType', NAMESPACES)).text = 'publication'
|
|
156
|
+
|
|
157
|
+
# bbox extent
|
|
158
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:BoundingBox'])
|
|
159
|
+
bboxel = write_extent(val, context.namespaces)
|
|
160
|
+
if bboxel is not None:
|
|
161
|
+
core.append(bboxel)
|
|
162
|
+
|
|
163
|
+
# geographic description
|
|
164
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:GeographicDescriptionCode'])
|
|
165
|
+
if val:
|
|
166
|
+
geo_desc = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.EX_GeographicDescription', NAMESPACES))
|
|
167
|
+
etree.SubElement(geo_desc, util.nspath_eval('gm03:geographicIdentifier', NAMESPACES)).text = val
|
|
168
|
+
|
|
169
|
+
# crs
|
|
170
|
+
val = util.getqattr(result, context.md_core_model['mappings']['pycsw:CRS'])
|
|
171
|
+
if val:
|
|
172
|
+
rs_identifier = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.RS_Identifier', NAMESPACES))
|
|
173
|
+
rs_code = etree.SubElement(rs_identifier, util.nspath_eval('gm03:code', NAMESPACES))
|
|
174
|
+
rs_code.append(_get_pt_freetext(val, language))
|
|
175
|
+
|
|
176
|
+
# temporal extent
|
|
177
|
+
time_begin = util.getqattr(result, context.md_core_model['mappings']['pycsw:TempExtent_begin'])
|
|
178
|
+
time_end = util.getqattr(result, context.md_core_model['mappings']['pycsw:TempExtent_end'])
|
|
179
|
+
if time_begin:
|
|
180
|
+
temp_ext = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.EX_TemporalExtent', NAMESPACES))
|
|
181
|
+
extent = etree.SubElement(temp_ext, util.nspath_eval('gm03:extent', NAMESPACES))
|
|
182
|
+
tm_primitive = etree.SubElement(extent, util.nspath_eval('gm03:GM03_2_1Core.Core.TM_Primitive', NAMESPACES))
|
|
183
|
+
etree.SubElement(tm_primitive, util.nspath_eval('gm03:begin', NAMESPACES)).text = time_begin
|
|
184
|
+
if time_end:
|
|
185
|
+
etree.SubElement(tm_primitive, util.nspath_eval('gm03:end', NAMESPACES)).text = time_end
|
|
186
|
+
|
|
187
|
+
# links
|
|
188
|
+
rlinks = util.getqattr(result, context.md_core_model['mappings']['pycsw:Links'])
|
|
189
|
+
if rlinks:
|
|
190
|
+
for link in util.jsonify_links(rlinks):
|
|
191
|
+
online_resource = etree.SubElement(core, util.nspath_eval('gm03:GM03_2_1Core.Core.OnlineResource', NAMESPACES))
|
|
192
|
+
if link['protocol']:
|
|
193
|
+
etree.SubElement(online_resource, util.nspath_eval('gm03:protocol', NAMESPACES)).text = link['protocol']
|
|
194
|
+
if link['description']:
|
|
195
|
+
desc = etree.SubElement(online_resource, util.nspath_eval('gm03:description', NAMESPACES))
|
|
196
|
+
desc.append(_get_pt_freetext(link['description'], language))
|
|
197
|
+
if link['name']:
|
|
198
|
+
name_el = etree.SubElement(online_resource, util.nspath_eval('gm03:name', NAMESPACES))
|
|
199
|
+
name_el.append(_get_pt_freetext(link['name'], language))
|
|
200
|
+
linkage = etree.SubElement(online_resource, util.nspath_eval('gm03:linkage', NAMESPACES))
|
|
201
|
+
linkage.append(_get_pt_freeurl(link['url'], language))
|
|
202
|
+
|
|
203
|
+
return node
|
|
204
|
+
|
|
205
|
+
def _get_pt_freetext(val, language):
|
|
206
|
+
freetext = etree.Element(util.nspath_eval('gm03:GM03_2_1Core.Core.PT_FreeText', NAMESPACES))
|
|
207
|
+
textgroup = etree.SubElement(freetext, util.nspath_eval('gm03:textGroup', NAMESPACES))
|
|
208
|
+
ptgroup = etree.SubElement(textgroup, util.nspath_eval('gm03:GM03_2_1Core.Core.PT_Group', NAMESPACES))
|
|
209
|
+
if language:
|
|
210
|
+
etree.SubElement(ptgroup, util.nspath_eval('gm03:language', NAMESPACES)).text = language
|
|
211
|
+
etree.SubElement(ptgroup, util.nspath_eval('gm03:plainText', NAMESPACES)).text = val
|
|
212
|
+
|
|
213
|
+
return freetext
|
|
214
|
+
|
|
215
|
+
def _get_pt_freeurl(val, language):
|
|
216
|
+
freeurl = etree.Element(util.nspath_eval('gm03:GM03_2_1Core.Core.PT_FreeURL', NAMESPACES))
|
|
217
|
+
urlgroup = etree.SubElement(freeurl, util.nspath_eval('gm03:URLGroup', NAMESPACES))
|
|
218
|
+
ptgroup = etree.SubElement(urlgroup, util.nspath_eval('gm03:GM03_2_1Core.Core.PT_URLGroup', NAMESPACES))
|
|
219
|
+
if language:
|
|
220
|
+
etree.SubElement(ptgroup, util.nspath_eval('gm03:language', NAMESPACES)).text = language
|
|
221
|
+
etree.SubElement(ptgroup, util.nspath_eval('gm03:plainURL', NAMESPACES)).text = val
|
|
222
|
+
|
|
223
|
+
return freeurl
|
|
224
|
+
|
|
225
|
+
def write_extent(bbox, nsmap):
|
|
226
|
+
''' Generate BBOX extent '''
|
|
227
|
+
|
|
228
|
+
if bbox is not None:
|
|
229
|
+
try:
|
|
230
|
+
bbox2 = util.wkt2geom(bbox)
|
|
231
|
+
except Exception as err:
|
|
232
|
+
LOGGER.debug(f'Geometry parsing error: {err}')
|
|
233
|
+
return None
|
|
234
|
+
bounding_box = etree.Element(util.nspath_eval('gm03:GM03_2_1Core.Core.EX_GeographicBoundingBox', NAMESPACES))
|
|
235
|
+
etree.SubElement(bounding_box, util.nspath_eval('gm03:northBoundLatitude', nsmap)).text = str(bbox2[3])
|
|
236
|
+
etree.SubElement(bounding_box, util.nspath_eval('gm03:southBoundLatitude', nsmap)).text = str(bbox2[1])
|
|
237
|
+
etree.SubElement(bounding_box, util.nspath_eval('gm03:eastBoundLongitude', nsmap)).text = str(bbox2[0])
|
|
238
|
+
etree.SubElement(bounding_box, util.nspath_eval('gm03:westBoundLongitude', nsmap)).text = str(bbox2[2])
|
|
239
|
+
return bounding_box
|
|
240
|
+
return None
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# =================================================================
|
|
3
|
+
#
|
|
4
|
+
# Authors: Tom Kralidis <tomkralidis@gmail.com>
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2015 Tom Kralidis
|
|
7
|
+
#
|
|
8
|
+
# Permission is hereby granted, free of charge, to any person
|
|
9
|
+
# obtaining a copy of this software and associated documentation
|
|
10
|
+
# files (the "Software"), to deal in the Software without
|
|
11
|
+
# restriction, including without limitation the rights to use,
|
|
12
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
# copies of the Software, and to permit persons to whom the
|
|
14
|
+
# Software is furnished to do so, subject to the following
|
|
15
|
+
# conditions:
|
|
16
|
+
#
|
|
17
|
+
# The above copyright notice and this permission notice shall be
|
|
18
|
+
# included in all copies or substantial portions of the Software.
|
|
19
|
+
#
|
|
20
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
22
|
+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
24
|
+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
26
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
27
|
+
# OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
#
|
|
29
|
+
# =================================================================
|