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.
Files changed (382) hide show
  1. geonode_pycsw-3.0.0b2.dist-info/METADATA +73 -0
  2. geonode_pycsw-3.0.0b2.dist-info/RECORD +382 -0
  3. geonode_pycsw-3.0.0b2.dist-info/WHEEL +5 -0
  4. geonode_pycsw-3.0.0b2.dist-info/entry_points.txt +2 -0
  5. geonode_pycsw-3.0.0b2.dist-info/licenses/LICENSE.txt +26 -0
  6. geonode_pycsw-3.0.0b2.dist-info/top_level.txt +1 -0
  7. pycsw/__init__.py +33 -0
  8. pycsw/core/__init__.py +29 -0
  9. pycsw/core/admin.py +703 -0
  10. pycsw/core/config.py +621 -0
  11. pycsw/core/etree.py +43 -0
  12. pycsw/core/formats/__init__.py +29 -0
  13. pycsw/core/formats/fmt_json.py +69 -0
  14. pycsw/core/log.py +71 -0
  15. pycsw/core/metadata.py +1996 -0
  16. pycsw/core/pygeofilter_evaluate.py +83 -0
  17. pycsw/core/repository.py +941 -0
  18. pycsw/core/schemas/ogc/cat/csw/3.0/_wrapper.xsd +14 -0
  19. pycsw/core/schemas/ogc/cat/csw/3.0/cswAll.xsd +33 -0
  20. pycsw/core/schemas/ogc/cat/csw/3.0/cswCommon.xsd +71 -0
  21. pycsw/core/schemas/ogc/cat/csw/3.0/cswGetCapabilities.xsd +80 -0
  22. pycsw/core/schemas/ogc/cat/csw/3.0/cswGetDomain.xsd +146 -0
  23. pycsw/core/schemas/ogc/cat/csw/3.0/cswGetRecordById.xsd +58 -0
  24. pycsw/core/schemas/ogc/cat/csw/3.0/cswGetRecords.xsd +391 -0
  25. pycsw/core/schemas/ogc/cat/csw/3.0/cswHarvest.xsd +95 -0
  26. pycsw/core/schemas/ogc/cat/csw/3.0/cswTransaction.xsd +187 -0
  27. pycsw/core/schemas/ogc/cat/csw/3.0/cswUnHarvest.xsd +77 -0
  28. pycsw/core/schemas/ogc/cat/csw/3.0/rec-dcmes.xsd +245 -0
  29. pycsw/core/schemas/ogc/cat/csw/3.0/rec-dcterms.xsd +101 -0
  30. pycsw/core/schemas/ogc/cat/csw/3.0/record.xsd +170 -0
  31. pycsw/core/schemas/ogc/csw/2.0.2/CSW-discovery.xsd +494 -0
  32. pycsw/core/schemas/ogc/csw/2.0.2/CSW-publication.xsd +242 -0
  33. pycsw/core/schemas/ogc/csw/2.0.2/rec-dcmes.xsd +199 -0
  34. pycsw/core/schemas/ogc/csw/2.0.2/rec-dcterms.xsd +94 -0
  35. pycsw/core/schemas/ogc/csw/2.0.2/record.xsd +138 -0
  36. pycsw/core/schemas/ogc/filter/1.1.0/expr.xsd +67 -0
  37. pycsw/core/schemas/ogc/filter/1.1.0/filter.xsd +265 -0
  38. pycsw/core/schemas/ogc/filter/1.1.0/filterCapabilities.xsd +171 -0
  39. pycsw/core/schemas/ogc/filter/1.1.0/sort.xsd +46 -0
  40. pycsw/core/schemas/ogc/filter/2.0/_wrapper.xsd +5 -0
  41. pycsw/core/schemas/ogc/filter/2.0/expr.xsd +44 -0
  42. pycsw/core/schemas/ogc/filter/2.0/filter.xsd +396 -0
  43. pycsw/core/schemas/ogc/filter/2.0/filterAll.xsd +23 -0
  44. pycsw/core/schemas/ogc/filter/2.0/filterCapabilities.xsd +286 -0
  45. pycsw/core/schemas/ogc/filter/2.0/query.xsd +70 -0
  46. pycsw/core/schemas/ogc/filter/2.0/sort.xsd +49 -0
  47. pycsw/core/schemas/ogc/gml/3.1.1/base/basicTypes.xsd +278 -0
  48. pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateOperations.xsd +789 -0
  49. pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateReferenceSystems.xsd +429 -0
  50. pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateSystems.xsd +408 -0
  51. pycsw/core/schemas/ogc/gml/3.1.1/base/coverage.xsd +451 -0
  52. pycsw/core/schemas/ogc/gml/3.1.1/base/dataQuality.xsd +129 -0
  53. pycsw/core/schemas/ogc/gml/3.1.1/base/datums.xsd +484 -0
  54. pycsw/core/schemas/ogc/gml/3.1.1/base/defaultStyle.xsd +454 -0
  55. pycsw/core/schemas/ogc/gml/3.1.1/base/dictionary.xsd +137 -0
  56. pycsw/core/schemas/ogc/gml/3.1.1/base/direction.xsd +72 -0
  57. pycsw/core/schemas/ogc/gml/3.1.1/base/dynamicFeature.xsd +115 -0
  58. pycsw/core/schemas/ogc/gml/3.1.1/base/feature.xsd +199 -0
  59. pycsw/core/schemas/ogc/gml/3.1.1/base/geometryAggregates.xsd +430 -0
  60. pycsw/core/schemas/ogc/gml/3.1.1/base/geometryBasic0d1d.xsd +602 -0
  61. pycsw/core/schemas/ogc/gml/3.1.1/base/geometryBasic2d.xsd +213 -0
  62. pycsw/core/schemas/ogc/gml/3.1.1/base/geometryComplexes.xsd +141 -0
  63. pycsw/core/schemas/ogc/gml/3.1.1/base/geometryPrimitives.xsd +1609 -0
  64. pycsw/core/schemas/ogc/gml/3.1.1/base/gml.xsd +22 -0
  65. pycsw/core/schemas/ogc/gml/3.1.1/base/gmlBase.xsd +294 -0
  66. pycsw/core/schemas/ogc/gml/3.1.1/base/grids.xsd +76 -0
  67. pycsw/core/schemas/ogc/gml/3.1.1/base/measures.xsd +200 -0
  68. pycsw/core/schemas/ogc/gml/3.1.1/base/observation.xsd +96 -0
  69. pycsw/core/schemas/ogc/gml/3.1.1/base/referenceSystems.xsd +211 -0
  70. pycsw/core/schemas/ogc/gml/3.1.1/base/temporal.xsd +332 -0
  71. pycsw/core/schemas/ogc/gml/3.1.1/base/temporalReferenceSystems.xsd +251 -0
  72. pycsw/core/schemas/ogc/gml/3.1.1/base/temporalTopology.xsd +186 -0
  73. pycsw/core/schemas/ogc/gml/3.1.1/base/topology.xsd +459 -0
  74. pycsw/core/schemas/ogc/gml/3.1.1/base/units.xsd +170 -0
  75. pycsw/core/schemas/ogc/gml/3.1.1/base/valueObjects.xsd +361 -0
  76. pycsw/core/schemas/ogc/gml/3.1.1/smil/smil20-language.xsd +117 -0
  77. pycsw/core/schemas/ogc/gml/3.1.1/smil/smil20.xsd +234 -0
  78. pycsw/core/schemas/ogc/gml/3.2.1/basicTypes.xsd +268 -0
  79. pycsw/core/schemas/ogc/gml/3.2.1/coordinateOperations.xsd +525 -0
  80. pycsw/core/schemas/ogc/gml/3.2.1/coordinateReferenceSystems.xsd +373 -0
  81. pycsw/core/schemas/ogc/gml/3.2.1/coordinateSystems.xsd +297 -0
  82. pycsw/core/schemas/ogc/gml/3.2.1/coverage.xsd +292 -0
  83. pycsw/core/schemas/ogc/gml/3.2.1/datums.xsd +287 -0
  84. pycsw/core/schemas/ogc/gml/3.2.1/defaultStyle.xsd +453 -0
  85. pycsw/core/schemas/ogc/gml/3.2.1/deprecatedTypes.xsd +1133 -0
  86. pycsw/core/schemas/ogc/gml/3.2.1/dictionary.xsd +90 -0
  87. pycsw/core/schemas/ogc/gml/3.2.1/direction.xsd +84 -0
  88. pycsw/core/schemas/ogc/gml/3.2.1/dynamicFeature.xsd +109 -0
  89. pycsw/core/schemas/ogc/gml/3.2.1/feature.xsd +94 -0
  90. pycsw/core/schemas/ogc/gml/3.2.1/geometryAggregates.xsd +197 -0
  91. pycsw/core/schemas/ogc/gml/3.2.1/geometryBasic0d1d.xsd +277 -0
  92. pycsw/core/schemas/ogc/gml/3.2.1/geometryBasic2d.xsd +124 -0
  93. pycsw/core/schemas/ogc/gml/3.2.1/geometryComplexes.xsd +95 -0
  94. pycsw/core/schemas/ogc/gml/3.2.1/geometryPrimitives.xsd +846 -0
  95. pycsw/core/schemas/ogc/gml/3.2.1/gml.xsd +20 -0
  96. pycsw/core/schemas/ogc/gml/3.2.1/gmlBase.xsd +185 -0
  97. pycsw/core/schemas/ogc/gml/3.2.1/grids.xsd +64 -0
  98. pycsw/core/schemas/ogc/gml/3.2.1/measures.xsd +68 -0
  99. pycsw/core/schemas/ogc/gml/3.2.1/observation.xsd +95 -0
  100. pycsw/core/schemas/ogc/gml/3.2.1/referenceSystems.xsd +70 -0
  101. pycsw/core/schemas/ogc/gml/3.2.1/temporal.xsd +269 -0
  102. pycsw/core/schemas/ogc/gml/3.2.1/temporalReferenceSystems.xsd +189 -0
  103. pycsw/core/schemas/ogc/gml/3.2.1/temporalTopology.xsd +119 -0
  104. pycsw/core/schemas/ogc/gml/3.2.1/topology.xsd +386 -0
  105. pycsw/core/schemas/ogc/gml/3.2.1/units.xsd +162 -0
  106. pycsw/core/schemas/ogc/gml/3.2.1/valueObjects.xsd +205 -0
  107. pycsw/core/schemas/ogc/ogcapi/records/part1/1.0/ogcapi-records-1.yaml +932 -0
  108. pycsw/core/schemas/ogc/ows/1.0.0/ows19115subset.xsd +222 -0
  109. pycsw/core/schemas/ogc/ows/1.0.0/owsAll.xsd +20 -0
  110. pycsw/core/schemas/ogc/ows/1.0.0/owsCommon.xsd +155 -0
  111. pycsw/core/schemas/ogc/ows/1.0.0/owsDataIdentification.xsd +112 -0
  112. pycsw/core/schemas/ogc/ows/1.0.0/owsExceptionReport.xsd +67 -0
  113. pycsw/core/schemas/ogc/ows/1.0.0/owsGetCapabilities.xsd +108 -0
  114. pycsw/core/schemas/ogc/ows/1.0.0/owsOperationsMetadata.xsd +161 -0
  115. pycsw/core/schemas/ogc/ows/1.0.0/owsServiceIdentification.xsd +55 -0
  116. pycsw/core/schemas/ogc/ows/1.0.0/owsServiceProvider.xsd +46 -0
  117. pycsw/core/schemas/ogc/ows/1.1.0/ows19115subset.xsd +236 -0
  118. pycsw/core/schemas/ogc/ows/1.1.0/owsAll.xsd +23 -0
  119. pycsw/core/schemas/ogc/ows/1.1.0/owsCommon.xsd +158 -0
  120. pycsw/core/schemas/ogc/ows/1.1.0/owsContents.xsd +87 -0
  121. pycsw/core/schemas/ogc/ows/1.1.0/owsDataIdentification.xsd +128 -0
  122. pycsw/core/schemas/ogc/ows/1.1.0/owsDomainType.xsd +280 -0
  123. pycsw/core/schemas/ogc/ows/1.1.0/owsExceptionReport.xsd +77 -0
  124. pycsw/core/schemas/ogc/ows/1.1.0/owsGetCapabilities.xsd +113 -0
  125. pycsw/core/schemas/ogc/ows/1.1.0/owsGetResourceByID.xsd +52 -0
  126. pycsw/core/schemas/ogc/ows/1.1.0/owsInputOutputData.xsd +60 -0
  127. pycsw/core/schemas/ogc/ows/1.1.0/owsManifest.xsd +125 -0
  128. pycsw/core/schemas/ogc/ows/1.1.0/owsOperationsMetadata.xsd +141 -0
  129. pycsw/core/schemas/ogc/ows/1.1.0/owsServiceIdentification.xsd +61 -0
  130. pycsw/core/schemas/ogc/ows/1.1.0/owsServiceProvider.xsd +48 -0
  131. pycsw/core/schemas/ogc/ows/2.0/ows19115subset.xsd +364 -0
  132. pycsw/core/schemas/ogc/ows/2.0/owsAdditionalParameters.xsd +114 -0
  133. pycsw/core/schemas/ogc/ows/2.0/owsAll.xsd +29 -0
  134. pycsw/core/schemas/ogc/ows/2.0/owsCommon.xsd +275 -0
  135. pycsw/core/schemas/ogc/ows/2.0/owsContents.xsd +163 -0
  136. pycsw/core/schemas/ogc/ows/2.0/owsDataIdentification.xsd +202 -0
  137. pycsw/core/schemas/ogc/ows/2.0/owsDomainType.xsd +388 -0
  138. pycsw/core/schemas/ogc/ows/2.0/owsExceptionReport.xsd +126 -0
  139. pycsw/core/schemas/ogc/ows/2.0/owsGetCapabilities.xsd +220 -0
  140. pycsw/core/schemas/ogc/ows/2.0/owsGetResourceByID.xsd +83 -0
  141. pycsw/core/schemas/ogc/ows/2.0/owsInputOutputData.xsd +98 -0
  142. pycsw/core/schemas/ogc/ows/2.0/owsManifest.xsd +181 -0
  143. pycsw/core/schemas/ogc/ows/2.0/owsOperationsMetadata.xsd +234 -0
  144. pycsw/core/schemas/ogc/ows/2.0/owsServiceIdentification.xsd +98 -0
  145. pycsw/core/schemas/ogc/ows/2.0/owsServiceProvider.xsd +64 -0
  146. pycsw/core/schemas/w3c/1999/xlink.xsd +271 -0
  147. pycsw/core/schemas/w3c/2001/xml.xsd +287 -0
  148. pycsw/core/util.py +552 -0
  149. pycsw/oaipmh.py +311 -0
  150. pycsw/ogc/__init__.py +29 -0
  151. pycsw/ogc/api/__init__.py +28 -0
  152. pycsw/ogc/api/oapi.py +558 -0
  153. pycsw/ogc/api/records.py +1414 -0
  154. pycsw/ogc/api/templates/_base.html +76 -0
  155. pycsw/ogc/api/templates/collection.html +44 -0
  156. pycsw/ogc/api/templates/collections.html +45 -0
  157. pycsw/ogc/api/templates/conformance.html +21 -0
  158. pycsw/ogc/api/templates/exception.html +8 -0
  159. pycsw/ogc/api/templates/item.html +228 -0
  160. pycsw/ogc/api/templates/items.html +337 -0
  161. pycsw/ogc/api/templates/landing_page.html +27 -0
  162. pycsw/ogc/api/templates/openapi.html +58 -0
  163. pycsw/ogc/api/templates/queryables.html +50 -0
  164. pycsw/ogc/api/templates/stac_items.html +173 -0
  165. pycsw/ogc/api/templates/static/favicon.ico +0 -0
  166. pycsw/ogc/api/templates/static/logo-horizontal.png +0 -0
  167. pycsw/ogc/api/templates/static/logo-vertical-darkbg.png +0 -0
  168. pycsw/ogc/api/util.py +252 -0
  169. pycsw/ogc/csw/__init__.py +29 -0
  170. pycsw/ogc/csw/cql.py +133 -0
  171. pycsw/ogc/csw/csw2.py +2042 -0
  172. pycsw/ogc/csw/csw3.py +2193 -0
  173. pycsw/ogc/fes/__init__.py +29 -0
  174. pycsw/ogc/fes/fes1.py +433 -0
  175. pycsw/ogc/fes/fes2.py +451 -0
  176. pycsw/ogc/gml/__init__.py +29 -0
  177. pycsw/ogc/gml/gml3.py +240 -0
  178. pycsw/ogc/gml/gml32.py +243 -0
  179. pycsw/opensearch.py +857 -0
  180. pycsw/plugins/__init__.py +29 -0
  181. pycsw/plugins/outputschemas/__init__.py +31 -0
  182. pycsw/plugins/outputschemas/atom.py +143 -0
  183. pycsw/plugins/outputschemas/datacite.py +375 -0
  184. pycsw/plugins/outputschemas/dif.py +213 -0
  185. pycsw/plugins/outputschemas/fgdc.py +180 -0
  186. pycsw/plugins/outputschemas/gm03.py +240 -0
  187. pycsw/plugins/profiles/__init__.py +29 -0
  188. pycsw/plugins/profiles/apiso/__init__.py +29 -0
  189. pycsw/plugins/profiles/apiso/apiso.py +757 -0
  190. pycsw/plugins/profiles/apiso/schemas/ogc/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd +13 -0
  191. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/basicTypes.xsd +429 -0
  192. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/gco.xsd +12 -0
  193. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/gcoBase.xsd +61 -0
  194. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/applicationSchema.xsd +42 -0
  195. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/citation.xsd +275 -0
  196. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/constraints.xsd +106 -0
  197. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/content.xsd +188 -0
  198. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/dataQuality.xsd +554 -0
  199. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/distribution.xsd +202 -0
  200. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/extent.xsd +205 -0
  201. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/freeText.xsd +122 -0
  202. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/gmd.xsd +12 -0
  203. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/identification.xsd +348 -0
  204. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/maintenance.xsd +86 -0
  205. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataApplication.xsd +175 -0
  206. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataEntity.xsd +70 -0
  207. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataExtension.xsd +99 -0
  208. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/portrayalCatalogue.xsd +36 -0
  209. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/referenceSystem.xsd +100 -0
  210. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/spatialRepresentation.xsd +237 -0
  211. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/basicTypes.xsd +267 -0
  212. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateOperations.xsd +639 -0
  213. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateReferenceSystems.xsd +526 -0
  214. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateSystems.xsd +401 -0
  215. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coverage.xsd +462 -0
  216. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/datums.xsd +342 -0
  217. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/dictionary.xsd +129 -0
  218. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/direction.xsd +80 -0
  219. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/dynamicFeature.xsd +142 -0
  220. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/feature.xsd +215 -0
  221. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryAggregates.xsd +216 -0
  222. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryBasic0d1d.xsd +304 -0
  223. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryBasic2d.xsd +123 -0
  224. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryComplexes.xsd +89 -0
  225. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryPrimitives.xsd +892 -0
  226. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/gml.xsd +14 -0
  227. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/gmlBase.xsd +305 -0
  228. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/grids.xsd +58 -0
  229. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/measures.xsd +167 -0
  230. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/observation.xsd +90 -0
  231. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/referenceSystems.xsd +69 -0
  232. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporal.xsd +263 -0
  233. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporalReferenceSystems.xsd +183 -0
  234. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporalTopology.xsd +124 -0
  235. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/topology.xsd +372 -0
  236. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/units.xsd +156 -0
  237. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/valueObjects.xsd +212 -0
  238. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/catalogues.xsd +112 -0
  239. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/codelistItem.xsd +168 -0
  240. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/crsItem.xsd +1030 -0
  241. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/extendedTypes.xsd +75 -0
  242. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/gmx.xsd +2 -0
  243. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/gmxUsage.xsd +127 -0
  244. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/uomItem.xsd +162 -0
  245. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gsr/gsr.xsd +12 -0
  246. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gsr/spatialReferencing.xsd +24 -0
  247. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gss/geometry.xsd +35 -0
  248. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gss/gss.xsd +12 -0
  249. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gts/gts.xsd +12 -0
  250. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gts/temporalObjects.xsd +34 -0
  251. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/serviceMetadata.xsd +197 -0
  252. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/serviceModel.xsd +220 -0
  253. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/srv.xsd +13 -0
  254. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/basicTypes.xsd +431 -0
  255. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/gco.xsd +12 -0
  256. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/gcoBase.xsd +63 -0
  257. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/applicationSchema.xsd +43 -0
  258. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/citation.xsd +276 -0
  259. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/constraints.xsd +107 -0
  260. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/content.xsd +190 -0
  261. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/dataQuality.xsd +556 -0
  262. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/distribution.xsd +203 -0
  263. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/extent.xsd +206 -0
  264. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/freeText.xsd +123 -0
  265. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/gmd.xsd +12 -0
  266. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/identification.xsd +349 -0
  267. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/maintenance.xsd +87 -0
  268. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataApplication.xsd +176 -0
  269. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataEntity.xsd +71 -0
  270. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataExtension.xsd +100 -0
  271. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/portrayalCatalogue.xsd +37 -0
  272. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/referenceSystem.xsd +101 -0
  273. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/spatialRepresentation.xsd +238 -0
  274. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/catalogues.xsd +113 -0
  275. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/codelistItem.xsd +169 -0
  276. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/crsItem.xsd +1031 -0
  277. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/extendedTypes.xsd +76 -0
  278. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/gmx.xsd +12 -0
  279. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/gmxUsage.xsd +128 -0
  280. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/uomItem.xsd +163 -0
  281. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gsr/gsr.xsd +12 -0
  282. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gsr/spatialReferencing.xsd +25 -0
  283. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gss/geometry.xsd +36 -0
  284. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gss/gss.xsd +12 -0
  285. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gts/gts.xsd +12 -0
  286. pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gts/temporalObjects.xsd +35 -0
  287. pycsw/plugins/profiles/ebrim/__init__.py +29 -0
  288. pycsw/plugins/profiles/ebrim/ebrim.py +174 -0
  289. pycsw/plugins/profiles/ebrim/schemas/ogc/csw/2.0.2/profiles/ebrim/1.0/csw-ebrim-iri.xsd +146 -0
  290. pycsw/plugins/profiles/ebrim/schemas/ogc/csw/2.0.2/profiles/ebrim/1.0/csw-ebrim.xsd +104 -0
  291. pycsw/plugins/profiles/iso19115p3/__init__.py +29 -0
  292. pycsw/plugins/profiles/iso19115p3/iso19115p3.py +854 -0
  293. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/cat.xsd +13 -0
  294. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/catalogues.xsd +53 -0
  295. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/codelistItem.xsd +54 -0
  296. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/crsItem.xsd +181 -0
  297. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/uomItem.xsd +38 -0
  298. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/1.0/cit.xsd +7 -0
  299. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/1.0/citation.xsd +514 -0
  300. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/2.0/cit.xsd +10 -0
  301. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/2.0/citation.xsd +523 -0
  302. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gco/1.0/baseTypes2014.xsd +530 -0
  303. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gco/1.0/gco.xsd +16 -0
  304. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/extendedTypes.xsd +92 -0
  305. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/extendedTypes_autoFromShapeChange.xsd +60 -0
  306. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/gcx.xsd +8 -0
  307. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gex/1.0/extent.xsd +241 -0
  308. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gex/1.0/gex.xsd +9 -0
  309. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gmw/1.0/gmlWrapperTypes2014.xsd +159 -0
  310. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gmw/1.0/gmw.xsd +14 -0
  311. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/lan/1.0/lan.xsd +8 -0
  312. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/lan/1.0/language.xsd +140 -0
  313. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/1.0/acquisitionInformationImagery.xsd +622 -0
  314. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/1.0/mac.xsd +11 -0
  315. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/acquisitionInformationImagery.xsd +590 -0
  316. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/event.xsd +108 -0
  317. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/mac.xsd +10 -0
  318. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mas/1.0/applicationSchema.xsd +61 -0
  319. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mas/1.0/mas.xsd +9 -0
  320. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/AbstractCommonClasses.xsd +358 -0
  321. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/commonClasses.xsd +220 -0
  322. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/mcc.xsd +8 -0
  323. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mco/1.0/constraints.xsd +188 -0
  324. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mco/1.0/mco.xsd +8 -0
  325. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md1/1.0/md1.xsd +9 -0
  326. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md1/1.0/metadataWExtendedType.xsd +4 -0
  327. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md2/1.0/md2.xsd +15 -0
  328. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md2/1.0/metadataWithExtensions.xsd +4 -0
  329. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mda/1.0/mda.xsd +8 -0
  330. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mda/1.0/metadataApplication.xsd +200 -0
  331. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/1.0/mdb.xsd +14 -0
  332. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/1.0/metadataBase.xsd +98 -0
  333. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/2.0/mdb.xsd +20 -0
  334. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/2.0/metadataBase.xsd +102 -0
  335. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mds/1.0/mds.xsd +22 -0
  336. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mds/1.0/metadataDataServices.xsd +4 -0
  337. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdt/1.0/mdt.xsd +13 -0
  338. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdt/1.0/metadataTransfer.xsd +111 -0
  339. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mex/1.0/metadataExtension.xsd +156 -0
  340. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mex/1.0/mex.xsd +8 -0
  341. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mmi/1.0/maintenance.xsd +76 -0
  342. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mmi/1.0/mmi.xsd +8 -0
  343. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mpc/1.0/mpc.xsd +8 -0
  344. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mpc/1.0/portrayalCatalogue.xsd +31 -0
  345. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/content.xsd +416 -0
  346. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/contentInformationImagery.xsd +185 -0
  347. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/mrc.xsd +11 -0
  348. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/content.xsd +419 -0
  349. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/contentInformationImagery.xsd +171 -0
  350. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/mrc.xsd +11 -0
  351. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrd/1.0/distribution.xsd +267 -0
  352. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrd/1.0/mrd.xsd +8 -0
  353. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mri/1.0/identification.xsd +517 -0
  354. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mri/1.0/mri.xsd +9 -0
  355. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/lineage.xsd +147 -0
  356. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/lineageImagery.xsd +236 -0
  357. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/mrl.xsd +9 -0
  358. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/lineage.xsd +147 -0
  359. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/lineageImagery.xsd +312 -0
  360. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/mrl.xsd +11 -0
  361. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrs/1.0/mrs.xsd +8 -0
  362. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrs/1.0/referenceSystem.xsd +47 -0
  363. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/msr.xsd +10 -0
  364. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/spatialRepresentation.xsd +375 -0
  365. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/spatialRepresentationImagery.xsd +119 -0
  366. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/msr.xsd +15 -0
  367. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/spatialRepresentation.xsd +381 -0
  368. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/spatialRepresentationImagery.xsd +120 -0
  369. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.0/serviceInformation.xsd +272 -0
  370. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.0/srv.xsd +6 -0
  371. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.1/serviceInformation.xsd +278 -0
  372. pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.1/srv.xsd +6 -0
  373. pycsw/plugins/profiles/profile.py +141 -0
  374. pycsw/plugins/repository/__init__.py +29 -0
  375. pycsw/plugins/repository/odc/__init__.py +29 -0
  376. pycsw/plugins/repository/odc/odc.py +153 -0
  377. pycsw/server.py +938 -0
  378. pycsw/sru.py +217 -0
  379. pycsw/stac/__init__.py +29 -0
  380. pycsw/stac/api.py +571 -0
  381. pycsw/wsgi.py +233 -0
  382. pycsw/wsgi_flask.py +345 -0
@@ -0,0 +1,757 @@
1
+ # -*- coding: utf-8 -*-
2
+ # =================================================================
3
+ #
4
+ # Authors: Tom Kralidis <tomkralidis@gmail.com>
5
+ # Angelos Tzotsos <tzotsos@gmail.com>
6
+ #
7
+ # Copyright (c) 2024 Tom Kralidis
8
+ # Copyright (c) 2015 Angelos Tzotsos
9
+ #
10
+ # Permission is hereby granted, free of charge, to any person
11
+ # obtaining a copy of this software and associated documentation
12
+ # files (the "Software"), to deal in the Software without
13
+ # restriction, including without limitation the rights to use,
14
+ # copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the
16
+ # Software is furnished to do so, subject to the following
17
+ # conditions:
18
+ #
19
+ # The above copyright notice and this permission notice shall be
20
+ # included in all copies or substantial portions of the Software.
21
+ #
22
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
24
+ # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26
+ # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
27
+ # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29
+ # OTHER DEALINGS IN THE SOFTWARE.
30
+ #
31
+ # =================================================================
32
+
33
+ import os
34
+ from pycsw.core import util
35
+ from pycsw.core.etree import etree
36
+ from pycsw.plugins.profiles import profile
37
+
38
+ CODELIST = 'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml'
39
+ CODESPACE = 'ISOTC211/19115'
40
+
41
+ class APISO(profile.Profile):
42
+ ''' APISO class '''
43
+ def __init__(self, model, namespaces, context):
44
+ self.context = context
45
+
46
+ self.namespaces = {
47
+ 'apiso': 'http://www.opengis.net/cat/csw/apiso/1.0',
48
+ 'gco': 'http://www.isotc211.org/2005/gco',
49
+ 'gmd': 'http://www.isotc211.org/2005/gmd',
50
+ 'srv': 'http://www.isotc211.org/2005/srv',
51
+ 'xlink': 'http://www.w3.org/1999/xlink'
52
+ }
53
+
54
+ self.inspire_namespaces = {
55
+ 'inspire_ds': 'http://inspire.ec.europa.eu/schemas/inspire_ds/1.0',
56
+ 'inspire_common': 'http://inspire.ec.europa.eu/schemas/common/1.0'
57
+ }
58
+
59
+
60
+ self.repository = {
61
+ 'gmd:MD_Metadata': {
62
+ 'outputschema': 'http://www.isotc211.org/2005/gmd',
63
+ 'queryables': {
64
+ 'SupportedISOQueryables': {
65
+ 'apiso:Subject': {'xpath': 'gmd:identificationInfo/gmd:MD_Identification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gco:CharacterString|gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:Keywords']},
66
+ 'apiso:Title': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Title']},
67
+ 'apiso:Abstract': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Abstract']},
68
+ 'apiso:Edition': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:edition/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Edition']},
69
+ 'apiso:Format': {'xpath': 'gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Format']},
70
+ 'apiso:Identifier': {'xpath': 'gmd:fileIdentifier/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Identifier']},
71
+ 'apiso:Modified': {'xpath': 'gmd:dateStamp/gco:Date', 'dbcol': self.context.md_core_model['mappings']['pycsw:Modified']},
72
+ 'apiso:Type': {'xpath': 'gmd:hierarchyLevel/gmd:MD_ScopeCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:Type']},
73
+ 'apiso:BoundingBox': {'xpath': 'apiso:BoundingBox', 'dbcol': self.context.md_core_model['mappings']['pycsw:BoundingBox']},
74
+ 'apiso:CRS': {'xpath': 'concat("urn:ogc:def:crs:","gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString",":","gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:version/gco:CharacterString",":","gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:code/gco:CharacterString")', 'dbcol': self.context.md_core_model['mappings']['pycsw:CRS']},
75
+ 'apiso:AlternateTitle': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:AlternateTitle']},
76
+ 'apiso:RevisionDate': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date[gmd:dateType/gmd:CI_DateTypeCode/@codeListValue="revision"]/gmd:date/gco:Date', 'dbcol': self.context.md_core_model['mappings']['pycsw:RevisionDate']},
77
+ 'apiso:CreationDate': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date[gmd:dateType/gmd:CI_DateTypeCode/@codeListValue="creation"]/gmd:date/gco:Date', 'dbcol': self.context.md_core_model['mappings']['pycsw:CreationDate']},
78
+ 'apiso:PublicationDate': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date[gmd:dateType/gmd:CI_DateTypeCode/@codeListValue="publication"]/gmd:date/gco:Date', 'dbcol': self.context.md_core_model['mappings']['pycsw:PublicationDate']},
79
+ 'apiso:OrganisationName': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:OrganizationName']},
80
+ 'apiso:HasSecurityConstraints': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_SecurityConstraints', 'dbcol': self.context.md_core_model['mappings']['pycsw:SecurityConstraints']},
81
+ 'apiso:Language': {'xpath': 'gmd:language/gmd:LanguageCode|gmd:language/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Language']},
82
+ 'apiso:ParentIdentifier': {'xpath': 'gmd:parentIdentifier/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:ParentIdentifier']},
83
+ 'apiso:KeywordType': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:KeywordType']},
84
+ 'apiso:TopicCategory': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:TopicCategory']},
85
+ 'apiso:ResourceLanguage': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:code/gmd:MD_LanguageTypeCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:ResourceLanguage']},
86
+ 'apiso:GeographicDescriptionCode': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicDescription/gmd:geographicIdentifier/gmd:MD_Identifier/gmd:code/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:GeographicDescriptionCode']},
87
+ 'apiso:Denominator': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale/gmd:MD_RepresentativeFraction/gmd:denominator/gco:Integer', 'dbcol': self.context.md_core_model['mappings']['pycsw:Denominator']},
88
+ 'apiso:DistanceValue': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution/gmd:MD_Resolution/gmd:distance/gco:Distance', 'dbcol': self.context.md_core_model['mappings']['pycsw:DistanceValue']},
89
+ 'apiso:DistanceUOM': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution/gmd:MD_Resolution/gmd:distance/gco:Distance/@uom', 'dbcol': self.context.md_core_model['mappings']['pycsw:DistanceUOM']},
90
+ 'apiso:TempExtent_begin': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition', 'dbcol': self.context.md_core_model['mappings']['pycsw:TempExtent_begin']},
91
+ 'apiso:TempExtent_end': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition', 'dbcol': self.context.md_core_model['mappings']['pycsw:TempExtent_end']},
92
+ 'apiso:AnyText': {'xpath': '//', 'dbcol': self.context.md_core_model['mappings']['pycsw:AnyText']},
93
+ 'apiso:ServiceType': {'xpath': 'gmd:identificationInfo/srv:SV_ServiceIdentification/srv:serviceType/gco:LocalName', 'dbcol': self.context.md_core_model['mappings']['pycsw:ServiceType']},
94
+ 'apiso:ServiceTypeVersion': {'xpath': 'gmd:identificationInfo/srv:SV_ServiceIdentification/srv:serviceTypeVersion/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:ServiceTypeVersion']},
95
+ 'apiso:Operation': {'xpath': 'gmd:identificationInfo/srv:SV_ServiceIdentification/srv:containsOperations/srv:SV_OperationMetadata/srv:operationName/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Operation']},
96
+ 'apiso:CouplingType': {'xpath': 'gmd:identificationInfo/srv:SV_ServiceIdentification/srv:couplingType/srv:SV_CouplingType', 'dbcol': self.context.md_core_model['mappings']['pycsw:CouplingType']},
97
+ 'apiso:OperatesOn': {'xpath': 'gmd:identificationInfo/srv:SV_ServiceIdentification/srv:operatesOn/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:OperatesOn']},
98
+ 'apiso:OperatesOnIdentifier': {'xpath': 'gmd:identificationInfo/srv:SV_ServiceIdentification/srv:coupledResource/srv:SV_CoupledResource/srv:identifier/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:OperatesOnIdentifier']},
99
+ 'apiso:OperatesOnName': {'xpath': 'gmd:identificationInfo/srv:SV_ServiceIdentification/srv:coupledResource/srv:SV_CoupledResource/srv:operationName/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:OperatesOnName']},
100
+ },
101
+ 'AdditionalQueryables': {
102
+ 'apiso:Degree': {'xpath': 'gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:pass/gco:Boolean', 'dbcol': self.context.md_core_model['mappings']['pycsw:Degree']},
103
+ 'apiso:AccessConstraints': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints/gmd:MD_RestrictionCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:AccessConstraints']},
104
+ 'apiso:OtherConstraints': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:OtherConstraints']},
105
+ 'apiso:Classification': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints/gmd:MD_ClassificationCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:Classification']},
106
+ 'apiso:ConditionApplyingToAccessAndUse': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:useLimitation/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:ConditionApplyingToAccessAndUse']},
107
+ 'apiso:Lineage': {'xpath': 'gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:lineage/gmd:LI_Lineage/gmd:statement/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Lineage']},
108
+ 'apiso:ResponsiblePartyRole': {'xpath': 'gmd:contact/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:ResponsiblePartyRole']},
109
+ 'apiso:SpecificationTitle': {'xpath': 'gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:SpecificationTitle']},
110
+ 'apiso:SpecificationDate': {'xpath': 'gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:Date', 'dbcol': self.context.md_core_model['mappings']['pycsw:SpecificationDate']},
111
+ 'apiso:SpecificationDateType': {'xpath': 'gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode', 'dbcol': self.context.md_core_model['mappings']['pycsw:SpecificationDateType']},
112
+ 'apiso:Creator': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty/gmd:organisationName[gmd:role/gmd:CI_RoleCode/@codeListValue="originator"]/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Creator']},
113
+ 'apiso:Publisher': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty/gmd:organisationName[gmd:role/gmd:CI_RoleCode/@codeListValue="publisher"]/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Publisher']},
114
+ 'apiso:Contributor': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact/gmd:CI_ResponsibleParty/gmd:organisationName[gmd:role/gmd:CI_RoleCode/@codeListValue="contributor"]/gco:CharacterString', 'dbcol': self.context.md_core_model['mappings']['pycsw:Contributor']},
115
+ 'apiso:Relation': {'xpath': 'gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo', 'dbcol': self.context.md_core_model['mappings']['pycsw:Relation']},
116
+ # 19115-2
117
+ 'apiso:Platform': {'xpath': 'gmi:acquisitionInfo/gmi:MI_AcquisitionInformation/gmi:platform/gmi:MI_Platform/gmi:identifier', 'dbcol': self.context.md_core_model['mappings']['pycsw:Platform']},
118
+ 'apiso:Instrument': {'xpath': 'gmi:acquisitionInfo/gmi:MI_AcquisitionInformation/gmi:platform/gmi:MI_Platform/gmi:instrument/gmi:MI_Instrument/gmi:identifier', 'dbcol': self.context.md_core_model['mappings']['pycsw:Instrument']},
119
+ 'apiso:SensorType': {'xpath': 'gmi:acquisitionInfo/gmi:MI_AcquisitionInformation/gmi:platform/gmi:MI_Platform/gmi:instrument/gmi:MI_Instrument/gmi:type', 'dbcol': self.context.md_core_model['mappings']['pycsw:SensorType']},
120
+ 'apiso:CloudCover': {'xpath': 'gmd:contentInfo/gmd:MD_ImageDescription/gmd:cloudCoverPercentage', 'dbcol': self.context.md_core_model['mappings']['pycsw:CloudCover']},
121
+ 'apiso:Bands': {'xpath': 'gmd:contentInfo/gmd:MD_ImageDescription/gmd:dimension/MD_Band/@id', 'dbcol': self.context.md_core_model['mappings']['pycsw:Bands']},
122
+ }
123
+ },
124
+ 'mappings': {
125
+ 'csw:Record': {
126
+ # map APISO queryables to DC queryables
127
+ 'apiso:Title': 'dc:title',
128
+ 'apiso:Creator': 'dc:creator',
129
+ 'apiso:Subject': 'dc:subject',
130
+ 'apiso:Abstract': 'dct:abstract',
131
+ 'apiso:Publisher': 'dc:publisher',
132
+ 'apiso:Contributor': 'dc:contributor',
133
+ 'apiso:Modified': 'dct:modified',
134
+ #'apiso:Date': 'dc:date',
135
+ 'apiso:Type': 'dc:type',
136
+ 'apiso:Format': 'dc:format',
137
+ 'apiso:Language': 'dc:language',
138
+ 'apiso:Relation': 'dc:relation',
139
+ 'apiso:AccessConstraints': 'dc:rights',
140
+ }
141
+ }
142
+ }
143
+ }
144
+
145
+ profile.Profile.__init__(self,
146
+ name='apiso',
147
+ version='1.0.0',
148
+ title='ISO Metadata Application Profile',
149
+ url='http://portal.opengeospatial.org/files/?artifact_id=21460',
150
+ namespace=self.namespaces['gmd'],
151
+ typename='gmd:MD_Metadata',
152
+ outputschema=self.namespaces['gmd'],
153
+ prefixes=['apiso', 'gmd'],
154
+ model=model,
155
+ core_namespaces=namespaces,
156
+ added_namespaces=self.namespaces,
157
+ repository=self.repository['gmd:MD_Metadata'])
158
+
159
+ def extend_core(self, model, namespaces, config):
160
+ ''' Extend core configuration '''
161
+
162
+ # update INSPIRE vars
163
+ self.context.namespaces.update(self.inspire_namespaces)
164
+
165
+ # update harvest resource types with WMS, since WMS is not a typename,
166
+ if 'Harvest' in model['operations']:
167
+ model['operations']['Harvest']['parameters']['ResourceType']['values'].append('http://www.isotc211.org/schemas/2005/gmd/')
168
+
169
+ # set INSPIRE config
170
+ if config['metadata']['inspire']['enabled']:
171
+ self.inspire_config = {}
172
+ self.inspire_config['languages_supported'] = config['metadata']['inspire']['languages_supported']
173
+ self.inspire_config['default_language'] = config['metadata']['inspire']['default_language']
174
+ self.inspire_config['date'] = config['metadata']['inspire']['date']
175
+ self.inspire_config['gemet_keywords'] = config['metadata']['inspire']['gemet_keywords']
176
+ self.inspire_config['conformity_service'] = config['metadata']['inspire']['conformity_service']
177
+ self.inspire_config['contact_name'] = config['metadata']['inspire']['contact_name']
178
+ self.inspire_config['contact_email'] = config['metadata']['inspire']['contact_email']
179
+ self.inspire_config['temp_extent'] = config['metadata']['inspire']['temp_extent']
180
+ else:
181
+ self.inspire_config = None
182
+
183
+ self.ogc_schemas_base = config['server']['ogc_schemas_base']
184
+ self.url = config['server']['url']
185
+
186
+ def check_parameters(self, kvp):
187
+ '''Check for Language parameter in GetCapabilities request'''
188
+
189
+ if self.inspire_config is not None:
190
+ result = None
191
+ if 'language' not in kvp:
192
+ self.inspire_config['current_language'] = self.inspire_config['default_language']
193
+ else:
194
+ if kvp['language'] not in self.inspire_config['languages_supported']:
195
+ text = 'Requested Language not supported, Supported languages: %s' % self.inspire_config['languages_supported']
196
+ return {'error': 'true', 'locator': 'language', 'code': 'InvalidParameterValue', 'text': text}
197
+ else:
198
+ self.inspire_config['current_language'] = kvp['language']
199
+ return None
200
+ return None
201
+ return None
202
+
203
+ def get_extendedcapabilities(self):
204
+ ''' Add child to ows:OperationsMetadata Element '''
205
+
206
+ if self.inspire_config is not None:
207
+
208
+ ex_caps = etree.Element(
209
+ util.nspath_eval('inspire_ds:ExtendedCapabilities', self.inspire_namespaces))
210
+
211
+ ex_caps.attrib[util.nspath_eval('xsi:schemaLocation', self.context.namespaces)] = \
212
+ '%s %s/inspire_ds.xsd' % \
213
+ (self.inspire_namespaces['inspire_ds'], self.inspire_namespaces['inspire_ds'])
214
+
215
+ # Resource Locator
216
+ res_loc = etree.SubElement(ex_caps,
217
+ util.nspath_eval('inspire_common:ResourceLocator', self.inspire_namespaces))
218
+
219
+ etree.SubElement(res_loc,
220
+ util.nspath_eval('inspire_common:URL', self.inspire_namespaces)).text = '%sservice=CSW&version=2.0.2&request=GetCapabilities' % (util.bind_url(self.url))
221
+
222
+ etree.SubElement(res_loc,
223
+ util.nspath_eval('inspire_common:MediaType', self.inspire_namespaces)).text = 'application/xml'
224
+
225
+ # Resource Type
226
+ etree.SubElement(ex_caps,
227
+ util.nspath_eval('inspire_common:ResourceType', self.inspire_namespaces)).text = 'service'
228
+
229
+ # Temporal Reference
230
+ temp_ref = etree.SubElement(ex_caps,
231
+ util.nspath_eval('inspire_common:TemporalReference', self.inspire_namespaces))
232
+
233
+ temp_extent = etree.SubElement(temp_ref,
234
+ util.nspath_eval('inspire_common:TemporalExtent', self.inspire_namespaces))
235
+
236
+ val = self.inspire_config['temp_extent']
237
+
238
+ interval_dates = etree.SubElement(temp_extent,
239
+ util.nspath_eval('inspire_common:IntervalOfDates', self.inspire_namespaces))
240
+
241
+ etree.SubElement(interval_dates,
242
+ util.nspath_eval('inspire_common:StartingDate', self.inspire_namespaces)).text = str(val['begin'])
243
+
244
+ etree.SubElement(interval_dates,
245
+ util.nspath_eval('inspire_common:EndDate', self.inspire_namespaces)).text = str(val['end'])
246
+
247
+ # Conformity - service
248
+ cfm = etree.SubElement(ex_caps,
249
+ util.nspath_eval('inspire_common:Conformity', self.inspire_namespaces))
250
+
251
+ spec = etree.SubElement(cfm,
252
+ util.nspath_eval('inspire_common:Specification', self.inspire_namespaces))
253
+
254
+ spec.attrib[util.nspath_eval('xsi:type', self.context.namespaces)] = 'inspire_common:citationInspireInteroperabilityRegulation_eng'
255
+
256
+ etree.SubElement(spec,
257
+ util.nspath_eval('inspire_common:Title', self.inspire_namespaces)).text = 'COMMISSION REGULATION (EU) No 1089/2010 of 23 November 2010 implementing Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services'
258
+
259
+ etree.SubElement(spec,
260
+ util.nspath_eval('inspire_common:DateOfPublication', self.inspire_namespaces)).text = '2010-12-08'
261
+
262
+ etree.SubElement(spec,
263
+ util.nspath_eval('inspire_common:URI', self.inspire_namespaces)).text = 'OJ:L:2010:323:0011:0102:EN:PDF'
264
+
265
+ spec_loc = etree.SubElement(spec,
266
+ util.nspath_eval('inspire_common:ResourceLocator', self.inspire_namespaces))
267
+
268
+ etree.SubElement(spec_loc,
269
+ util.nspath_eval('inspire_common:URL', self.inspire_namespaces)).text = 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2010:323:0011:0102:EN:PDF'
270
+
271
+ etree.SubElement(spec_loc,
272
+ util.nspath_eval('inspire_common:MediaType', self.inspire_namespaces)).text = 'application/pdf'
273
+
274
+ spec = etree.SubElement(cfm,
275
+ util.nspath_eval('inspire_common:Degree', self.inspire_namespaces)).text = self.inspire_config['conformity_service']
276
+
277
+ # Metadata Point of Contact
278
+ poc = etree.SubElement(ex_caps,
279
+ util.nspath_eval('inspire_common:MetadataPointOfContact', self.inspire_namespaces))
280
+
281
+ etree.SubElement(poc,
282
+ util.nspath_eval('inspire_common:OrganisationName', self.inspire_namespaces)).text = self.inspire_config['contact_name']
283
+
284
+ etree.SubElement(poc,
285
+ util.nspath_eval('inspire_common:EmailAddress', self.inspire_namespaces)).text = self.inspire_config['contact_email']
286
+
287
+ # Metadata Date
288
+ etree.SubElement(ex_caps,
289
+ util.nspath_eval('inspire_common:MetadataDate', self.inspire_namespaces)).text = str(self.inspire_config['date'])
290
+
291
+ # Spatial Data Service Type
292
+ etree.SubElement(ex_caps,
293
+ util.nspath_eval('inspire_common:SpatialDataServiceType', self.inspire_namespaces)).text = 'discovery'
294
+
295
+ # Mandatory Keyword
296
+ mkey = etree.SubElement(ex_caps,
297
+ util.nspath_eval('inspire_common:MandatoryKeyword', self.inspire_namespaces))
298
+
299
+ mkey.attrib[util.nspath_eval('xsi:type', self.context.namespaces)] = 'inspire_common:classificationOfSpatialDataService'
300
+
301
+ etree.SubElement(mkey,
302
+ util.nspath_eval('inspire_common:KeywordValue', self.inspire_namespaces)).text = 'infoCatalogueService'
303
+
304
+ # Gemet Keywords
305
+
306
+ for gkw in self.inspire_config['gemet_keywords']:
307
+ gkey = etree.SubElement(ex_caps,
308
+ util.nspath_eval('inspire_common:Keyword', self.inspire_namespaces))
309
+
310
+ gkey.attrib[util.nspath_eval('xsi:type', self.context.namespaces)] = 'inspire_common:inspireTheme_eng'
311
+
312
+ ocv = etree.SubElement(gkey,
313
+ util.nspath_eval('inspire_common:OriginatingControlledVocabulary', self.inspire_namespaces))
314
+
315
+ etree.SubElement(ocv,
316
+ util.nspath_eval('inspire_common:Title', self.inspire_namespaces)).text = 'GEMET - INSPIRE themes'
317
+
318
+ etree.SubElement(ocv,
319
+ util.nspath_eval('inspire_common:DateOfPublication', self.inspire_namespaces)).text = '2008-06-01'
320
+
321
+ etree.SubElement(gkey,
322
+ util.nspath_eval('inspire_common:KeywordValue', self.inspire_namespaces)).text = gkw
323
+
324
+ # Languages
325
+ slang = etree.SubElement(ex_caps,
326
+ util.nspath_eval('inspire_common:SupportedLanguages', self.inspire_namespaces))
327
+
328
+ dlang = etree.SubElement(slang,
329
+ util.nspath_eval('inspire_common:DefaultLanguage', self.inspire_namespaces))
330
+
331
+ etree.SubElement(dlang,
332
+ util.nspath_eval('inspire_common:Language', self.inspire_namespaces)).text = self.inspire_config['default_language']
333
+
334
+ for l in self.inspire_config['languages_supported']:
335
+ lang = etree.SubElement(slang,
336
+ util.nspath_eval('inspire_common:SupportedLanguage', self.inspire_namespaces))
337
+
338
+ etree.SubElement(lang,
339
+ util.nspath_eval('inspire_common:Language', self.inspire_namespaces)).text = l
340
+
341
+ clang = etree.SubElement(ex_caps,
342
+ util.nspath_eval('inspire_common:ResponseLanguage', self.inspire_namespaces))
343
+ etree.SubElement(clang,
344
+ util.nspath_eval('inspire_common:Language', self.inspire_namespaces)).text = self.inspire_config['current_language']
345
+
346
+ return ex_caps
347
+
348
+ def get_schemacomponents(self):
349
+ ''' Return schema components as lxml.etree.Element list '''
350
+
351
+ node1 = etree.Element(
352
+ util.nspath_eval('csw:SchemaComponent', self.context.namespaces),
353
+ schemaLanguage='XMLSCHEMA', targetNamespace=self.namespace,
354
+ parentSchema='gmd.xsd')
355
+
356
+ schema_file = os.path.join(self.context.pycsw_home, 'plugins',
357
+ 'profiles', 'apiso', 'schemas', 'ogc',
358
+ 'iso', '19139', '20060504', 'gmd',
359
+ 'identification.xsd')
360
+
361
+ schema = etree.parse(schema_file, self.context.parser).getroot()
362
+
363
+ node1.append(schema)
364
+
365
+ node2 = etree.Element(
366
+ util.nspath_eval('csw:SchemaComponent', self.context.namespaces),
367
+ schemaLanguage='XMLSCHEMA', targetNamespace=self.namespace,
368
+ parentSchema='gmd.xsd')
369
+
370
+ schema_file = os.path.join(self.context.pycsw_home, 'plugins',
371
+ 'profiles', 'apiso', 'schemas', 'ogc',
372
+ 'iso', '19139', '20060504', 'srv',
373
+ 'serviceMetadata.xsd')
374
+
375
+ schema = etree.parse(schema_file, self.context.parser).getroot()
376
+
377
+ node2.append(schema)
378
+
379
+ return [node1, node2]
380
+
381
+ def check_getdomain(self, kvp):
382
+ '''Perform extra profile specific checks in the GetDomain request'''
383
+ return None
384
+
385
+ def write_record(self, result, esn, outputschema, queryables, caps=None):
386
+ ''' Return csw:SearchResults child as lxml.etree.Element '''
387
+ typename = util.getqattr(result, self.context.md_core_model['mappings']['pycsw:Typename'])
388
+ is_iso_anyway = False
389
+
390
+ xml_blob = util.getqattr(result, self.context.md_core_model['mappings']['pycsw:XML'])
391
+
392
+ #xml_blob_decoded = bytes.fromhex(xml_blob[2:]).decode('utf-8')
393
+
394
+ if isinstance(xml_blob, bytes):
395
+ iso_string = b'<gmd:MD_Metadata>'
396
+ else:
397
+ iso_string = '<gmd:MD_Metadata>'
398
+
399
+ if caps is None and xml_blob is not None and xml_blob.startswith(iso_string):
400
+ is_iso_anyway = True
401
+
402
+ if (esn == 'full' and (typename == 'gmd:MD_Metadata' or is_iso_anyway)):
403
+ # dump record as is and exit
404
+ return etree.fromstring(xml_blob, self.context.parser)
405
+
406
+ node = etree.Element(util.nspath_eval('gmd:MD_Metadata', self.namespaces))
407
+ node.attrib[util.nspath_eval('xsi:schemaLocation', self.context.namespaces)] = \
408
+ '%s %s/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd' % (self.namespace, self.ogc_schemas_base)
409
+
410
+ # identifier
411
+ idval = util.getqattr(result, self.context.md_core_model['mappings']['pycsw:Identifier'])
412
+
413
+ identifier = etree.SubElement(node, util.nspath_eval('gmd:fileIdentifier', self.namespaces))
414
+ etree.SubElement(identifier, util.nspath_eval('gco:CharacterString', self.namespaces)).text = idval
415
+
416
+ if esn in ['summary', 'full']:
417
+ # language
418
+ val = util.getqattr(result, queryables['apiso:Language']['dbcol'])
419
+
420
+ lang = etree.SubElement(node, util.nspath_eval('gmd:language', self.namespaces))
421
+ etree.SubElement(lang, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val
422
+
423
+ # hierarchyLevel
424
+ mtype = util.getqattr(result, queryables['apiso:Type']['dbcol']) or None
425
+
426
+ if mtype is not None:
427
+ if mtype == 'http://purl.org/dc/dcmitype/Dataset':
428
+ mtype = 'dataset'
429
+ hierarchy = etree.SubElement(node, util.nspath_eval('gmd:hierarchyLevel', self.namespaces))
430
+ hierarchy.append(_write_codelist_element('gmd:MD_ScopeCode', mtype, self.namespaces))
431
+
432
+ if esn in ['summary', 'full']:
433
+ # contact
434
+ contact = etree.SubElement(node, util.nspath_eval('gmd:contact', self.namespaces))
435
+ if caps is not None:
436
+ CI_resp = etree.SubElement(contact, util.nspath_eval('gmd:CI_ResponsibleParty', self.namespaces))
437
+ if hasattr(caps.provider.contact, 'name'):
438
+ ind_name = etree.SubElement(CI_resp, util.nspath_eval('gmd:individualName', self.namespaces))
439
+ etree.SubElement(ind_name, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.name
440
+ if hasattr(caps.provider.contact, 'organization'):
441
+ if caps.provider.contact.organization is not None:
442
+ org_val = caps.provider.contact.organization
443
+ else:
444
+ org_val = caps.provider.name
445
+ org_name = etree.SubElement(CI_resp, util.nspath_eval('gmd:organisationName', self.namespaces))
446
+ etree.SubElement(org_name, util.nspath_eval('gco:CharacterString', self.namespaces)).text = org_val
447
+ if hasattr(caps.provider.contact, 'position'):
448
+ pos_name = etree.SubElement(CI_resp, util.nspath_eval('gmd:positionName', self.namespaces))
449
+ etree.SubElement(pos_name, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.position
450
+ contact_info = etree.SubElement(CI_resp, util.nspath_eval('gmd:contactInfo', self.namespaces))
451
+ ci_contact = etree.SubElement(contact_info, util.nspath_eval('gmd:CI_Contact', self.namespaces))
452
+ if hasattr(caps.provider.contact, 'phone'):
453
+ phone = etree.SubElement(ci_contact, util.nspath_eval('gmd:phone', self.namespaces))
454
+ ci_phone = etree.SubElement(phone, util.nspath_eval('gmd:CI_Telephone', self.namespaces))
455
+ voice = etree.SubElement(ci_phone, util.nspath_eval('gmd:voice', self.namespaces))
456
+ etree.SubElement(voice, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.phone
457
+ if hasattr(caps.provider.contact, 'fax'):
458
+ fax = etree.SubElement(ci_phone, util.nspath_eval('gmd:facsimile', self.namespaces))
459
+ etree.SubElement(fax, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.fax
460
+ address = etree.SubElement(ci_contact, util.nspath_eval('gmd:address', self.namespaces))
461
+ ci_address = etree.SubElement(address, util.nspath_eval('gmd:CI_Address', self.namespaces))
462
+ if hasattr(caps.provider.contact, 'address'):
463
+ delivery_point = etree.SubElement(ci_address, util.nspath_eval('gmd:deliveryPoint', self.namespaces))
464
+ etree.SubElement(delivery_point, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.address
465
+ if hasattr(caps.provider.contact, 'city'):
466
+ city = etree.SubElement(ci_address, util.nspath_eval('gmd:city', self.namespaces))
467
+ etree.SubElement(city, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.city
468
+ if hasattr(caps.provider.contact, 'region'):
469
+ admin_area = etree.SubElement(ci_address, util.nspath_eval('gmd:administrativeArea', self.namespaces))
470
+ etree.SubElement(admin_area, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.region
471
+ if hasattr(caps.provider.contact, 'postcode'):
472
+ postal_code = etree.SubElement(ci_address, util.nspath_eval('gmd:postalCode', self.namespaces))
473
+ etree.SubElement(postal_code, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.postcode
474
+ if hasattr(caps.provider.contact, 'country'):
475
+ country = etree.SubElement(ci_address, util.nspath_eval('gmd:country', self.namespaces))
476
+ etree.SubElement(country, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.country
477
+ if hasattr(caps.provider.contact, 'email'):
478
+ email = etree.SubElement(ci_address, util.nspath_eval('gmd:electronicMailAddress', self.namespaces))
479
+ etree.SubElement(email, util.nspath_eval('gco:CharacterString', self.namespaces)).text = caps.provider.contact.email
480
+
481
+ contact_url = None
482
+ if hasattr(caps.provider, 'url'):
483
+ contact_url = caps.provider.url
484
+ if hasattr(caps.provider.contact, 'url') and caps.provider.contact.url is not None:
485
+ contact_url = caps.provider.contact.url
486
+
487
+ if contact_url is not None:
488
+ online_resource = etree.SubElement(ci_contact, util.nspath_eval('gmd:onlineResource', self.namespaces))
489
+ gmd_linkage = etree.SubElement(online_resource, util.nspath_eval('gmd:linkage', self.namespaces))
490
+ etree.SubElement(gmd_linkage, util.nspath_eval('gmd:URL', self.namespaces)).text = contact_url
491
+
492
+ if hasattr(caps.provider.contact, 'role'):
493
+ role = etree.SubElement(CI_resp, util.nspath_eval('gmd:role', self.namespaces))
494
+ role_val = caps.provider.contact.role
495
+ if role_val is None:
496
+ role_val = 'pointOfContact'
497
+ etree.SubElement(role, util.nspath_eval('gmd:CI_RoleCode', self.namespaces), codeListValue=role_val, codeList='%s#CI_RoleCode' % CODELIST).text = role_val
498
+ else:
499
+ val = util.getqattr(result, queryables['apiso:OrganisationName']['dbcol'])
500
+ if val:
501
+ CI_resp = etree.SubElement(contact, util.nspath_eval('gmd:CI_ResponsibleParty', self.namespaces))
502
+ org_name = etree.SubElement(CI_resp, util.nspath_eval('gmd:organisationName', self.namespaces))
503
+ etree.SubElement(org_name, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val
504
+
505
+ # date
506
+ val = util.getqattr(result, queryables['apiso:Modified']['dbcol'])
507
+ date = etree.SubElement(node, util.nspath_eval('gmd:dateStamp', self.namespaces))
508
+ if val and val.find('T') != -1:
509
+ dateel = 'gco:DateTime'
510
+ else:
511
+ dateel = 'gco:Date'
512
+ etree.SubElement(date, util.nspath_eval(dateel, self.namespaces)).text = val
513
+
514
+ metadatastandardname = 'ISO19115'
515
+ metadatastandardversion = '2003/Cor.1:2006'
516
+
517
+ if mtype == 'service':
518
+ metadatastandardname = 'ISO19119'
519
+ metadatastandardversion = '2005/PDAM 1'
520
+
521
+ # metadata standard name
522
+ standard = etree.SubElement(node, util.nspath_eval('gmd:metadataStandardName', self.namespaces))
523
+ etree.SubElement(standard, util.nspath_eval('gco:CharacterString', self.namespaces)).text = metadatastandardname
524
+
525
+ # metadata standard version
526
+ standardver = etree.SubElement(node, util.nspath_eval('gmd:metadataStandardVersion', self.namespaces))
527
+ etree.SubElement(standardver, util.nspath_eval('gco:CharacterString', self.namespaces)).text = metadatastandardversion
528
+
529
+ # title
530
+ val = util.getqattr(result, queryables['apiso:Title']['dbcol']) or ''
531
+ identification = etree.SubElement(node, util.nspath_eval('gmd:identificationInfo', self.namespaces))
532
+
533
+ if mtype == 'service':
534
+ restagname = 'srv:SV_ServiceIdentification'
535
+ else:
536
+ restagname = 'gmd:MD_DataIdentification'
537
+
538
+ resident = etree.SubElement(identification, util.nspath_eval(restagname, self.namespaces), id=idval)
539
+ tmp2 = etree.SubElement(resident, util.nspath_eval('gmd:citation', self.namespaces))
540
+ tmp3 = etree.SubElement(tmp2, util.nspath_eval('gmd:CI_Citation', self.namespaces))
541
+ tmp4 = etree.SubElement(tmp3, util.nspath_eval('gmd:title', self.namespaces))
542
+ etree.SubElement(tmp4, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val
543
+
544
+ # edition
545
+ val = util.getqattr(result, queryables['apiso:Edition']['dbcol'])
546
+ if val is not None:
547
+ tmp4 = etree.SubElement(tmp3, util.nspath_eval('gmd:edition', self.namespaces))
548
+ etree.SubElement(tmp4, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val
549
+
550
+ # creation date
551
+ val = util.getqattr(result, queryables['apiso:CreationDate']['dbcol'])
552
+ if val is not None:
553
+ tmp3.append(_write_date(val, 'creation', self.namespaces))
554
+ # publication date
555
+ val = util.getqattr(result, queryables['apiso:PublicationDate']['dbcol'])
556
+ if val is not None:
557
+ tmp3.append(_write_date(val, 'publication', self.namespaces))
558
+ # revision date
559
+ val = util.getqattr(result, queryables['apiso:RevisionDate']['dbcol'])
560
+ if val is not None:
561
+ tmp3.append(_write_date(val, 'revision', self.namespaces))
562
+
563
+ if esn in ['summary', 'full']:
564
+ # abstract
565
+ val = util.getqattr(result, queryables['apiso:Abstract']['dbcol']) or ''
566
+ tmp = etree.SubElement(resident, util.nspath_eval('gmd:abstract', self.namespaces))
567
+ etree.SubElement(tmp, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val
568
+
569
+ # keywords
570
+ kw = util.getqattr(result, queryables['apiso:Subject']['dbcol'])
571
+ if kw is not None:
572
+ md_keywords = etree.SubElement(resident, util.nspath_eval('gmd:descriptiveKeywords', self.namespaces))
573
+ md_keywords.append(write_keywords(kw, self.namespaces))
574
+
575
+ # spatial resolution
576
+ val = util.getqattr(result, queryables['apiso:Denominator']['dbcol'])
577
+ if val:
578
+ tmp = etree.SubElement(resident, util.nspath_eval('gmd:spatialResolution', self.namespaces))
579
+ tmp2 = etree.SubElement(tmp, util.nspath_eval('gmd:MD_Resolution', self.namespaces))
580
+ tmp3 = etree.SubElement(tmp2, util.nspath_eval('gmd:equivalentScale', self.namespaces))
581
+ tmp4 = etree.SubElement(tmp3, util.nspath_eval('gmd:MD_RepresentativeFraction', self.namespaces))
582
+ tmp5 = etree.SubElement(tmp4, util.nspath_eval('gmd:denominator', self.namespaces))
583
+ etree.SubElement(tmp5, util.nspath_eval('gco:Integer', self.namespaces)).text = str(val)
584
+
585
+ # resource language
586
+ val = util.getqattr(result, queryables['apiso:ResourceLanguage']['dbcol'])
587
+ tmp = etree.SubElement(resident, util.nspath_eval('gmd:language', self.namespaces))
588
+ etree.SubElement(tmp, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val
589
+
590
+ # topic category
591
+ val = util.getqattr(result, queryables['apiso:TopicCategory']['dbcol'])
592
+ if val:
593
+ for v in val.split(','):
594
+ tmp = etree.SubElement(resident, util.nspath_eval('gmd:topicCategory', self.namespaces))
595
+ etree.SubElement(tmp, util.nspath_eval('gmd:MD_TopicCategoryCode', self.namespaces)).text = val
596
+
597
+ # bbox extent
598
+ val = util.getqattr(result, queryables['apiso:BoundingBox']['dbcol'])
599
+ bboxel = write_extent(val, self.namespaces)
600
+ if bboxel is not None and mtype != 'service':
601
+ resident.append(bboxel)
602
+
603
+ # service identification
604
+
605
+ if mtype == 'service':
606
+ # service type
607
+ # service type version
608
+ val = util.getqattr(result, queryables['apiso:ServiceType']['dbcol'])
609
+ val2 = util.getqattr(result, queryables['apiso:ServiceTypeVersion']['dbcol'])
610
+ if val is not None:
611
+ tmp = etree.SubElement(resident, util.nspath_eval('srv:serviceType', self.namespaces))
612
+ etree.SubElement(tmp, util.nspath_eval('gco:LocalName', self.namespaces)).text = val
613
+ tmp = etree.SubElement(resident, util.nspath_eval('srv:serviceTypeVersion', self.namespaces))
614
+ etree.SubElement(tmp, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val2
615
+
616
+ kw = util.getqattr(result, queryables['apiso:Subject']['dbcol'])
617
+ if kw is not None:
618
+ srv_keywords = etree.SubElement(resident, util.nspath_eval('srv:keywords', self.namespaces))
619
+ srv_keywords.append(write_keywords(kw, self.namespaces))
620
+
621
+ if bboxel is not None:
622
+ bboxel.tag = util.nspath_eval('srv:extent', self.namespaces)
623
+ resident.append(bboxel)
624
+
625
+ val = util.getqattr(result, queryables['apiso:CouplingType']['dbcol'])
626
+ if val is not None:
627
+ couplingtype = etree.SubElement(resident, util.nspath_eval('srv:couplingType', self.namespaces))
628
+ etree.SubElement(couplingtype, util.nspath_eval('srv:SV_CouplingType', self.namespaces), codeListValue=val, codeList='%s#SV_CouplingType' % CODELIST).text = val
629
+
630
+ if esn in ['summary', 'full']:
631
+ # all service resources as coupled resources
632
+ coupledresources = util.getqattr(result, queryables['apiso:OperatesOn']['dbcol'])
633
+ operations = util.getqattr(result, queryables['apiso:Operation']['dbcol'])
634
+
635
+ if coupledresources:
636
+ for val2 in coupledresources.split(','):
637
+ coupledres = etree.SubElement(resident, util.nspath_eval('srv:coupledResource', self.namespaces))
638
+ svcoupledres = etree.SubElement(coupledres, util.nspath_eval('srv:SV_CoupledResource', self.namespaces))
639
+ opname = etree.SubElement(svcoupledres, util.nspath_eval('srv:operationName', self.namespaces))
640
+ etree.SubElement(opname, util.nspath_eval('gco:CharacterString', self.namespaces)).text = _get_resource_opname(operations)
641
+ sid = etree.SubElement(svcoupledres, util.nspath_eval('srv:identifier', self.namespaces))
642
+ etree.SubElement(sid, util.nspath_eval('gco:CharacterString', self.namespaces)).text = val2
643
+
644
+ # service operations
645
+ if operations:
646
+ for i in operations.split(','):
647
+ oper = etree.SubElement(resident, util.nspath_eval('srv:containsOperations', self.namespaces))
648
+ tmp = etree.SubElement(oper, util.nspath_eval('srv:SV_OperationMetadata', self.namespaces))
649
+
650
+ tmp2 = etree.SubElement(tmp, util.nspath_eval('srv:operationName', self.namespaces))
651
+ etree.SubElement(tmp2, util.nspath_eval('gco:CharacterString', self.namespaces)).text = i
652
+
653
+ tmp3 = etree.SubElement(tmp, util.nspath_eval('srv:DCP', self.namespaces))
654
+ etree.SubElement(tmp3, util.nspath_eval('srv:DCPList', self.namespaces), codeList='%s#DCPList' % CODELIST, codeListValue='HTTPGet').text = 'HTTPGet'
655
+
656
+ tmp4 = etree.SubElement(tmp, util.nspath_eval('srv:DCP', self.namespaces))
657
+ etree.SubElement(tmp4, util.nspath_eval('srv:DCPList', self.namespaces), codeList='%s#DCPList' % CODELIST, codeListValue='HTTPPost').text = 'HTTPPost'
658
+
659
+ connectpoint = etree.SubElement(tmp, util.nspath_eval('srv:connectPoint', self.namespaces))
660
+ onlineres = etree.SubElement(connectpoint, util.nspath_eval('gmd:CI_OnlineResource', self.namespaces))
661
+ linkage = etree.SubElement(onlineres, util.nspath_eval('gmd:linkage', self.namespaces))
662
+ etree.SubElement(linkage, util.nspath_eval('gmd:URL', self.namespaces)).text = util.getqattr(result, self.context.md_core_model['mappings']['pycsw:Source'])
663
+
664
+ # operates on resource(s)
665
+ if coupledresources:
666
+ for i in coupledresources.split(','):
667
+ operates_on = etree.SubElement(resident, util.nspath_eval('srv:operatesOn', self.namespaces), uuidref=i)
668
+ operates_on.attrib[util.nspath_eval('xlink:href', self.namespaces)] = '%sservice=CSW&version=2.0.2&request=GetRecordById&outputschema=http://www.isotc211.org/2005/gmd&id=%s-%s' % (util.bind_url(self.url), idval, i)
669
+
670
+ rlinks = util.getqattr(result, self.context.md_core_model['mappings']['pycsw:Links'])
671
+
672
+ if rlinks:
673
+ distinfo = etree.SubElement(node, util.nspath_eval('gmd:distributionInfo', self.namespaces))
674
+ distinfo2 = etree.SubElement(distinfo, util.nspath_eval('gmd:MD_Distribution', self.namespaces))
675
+ transopts = etree.SubElement(distinfo2, util.nspath_eval('gmd:transferOptions', self.namespaces))
676
+ dtransopts = etree.SubElement(transopts, util.nspath_eval('gmd:MD_DigitalTransferOptions', self.namespaces))
677
+
678
+ for link in util.jsonify_links(rlinks):
679
+ online = etree.SubElement(dtransopts, util.nspath_eval('gmd:onLine', self.namespaces))
680
+ online2 = etree.SubElement(online, util.nspath_eval('gmd:CI_OnlineResource', self.namespaces))
681
+
682
+ linkage = etree.SubElement(online2, util.nspath_eval('gmd:linkage', self.namespaces))
683
+ etree.SubElement(linkage, util.nspath_eval('gmd:URL', self.namespaces)).text = link['url']
684
+
685
+ protocol = etree.SubElement(online2, util.nspath_eval('gmd:protocol', self.namespaces))
686
+ etree.SubElement(protocol, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link.get('protocol', 'WWW:LINK')
687
+
688
+ name = etree.SubElement(online2, util.nspath_eval('gmd:name', self.namespaces))
689
+ etree.SubElement(name, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link.get('name')
690
+
691
+ desc = etree.SubElement(online2, util.nspath_eval('gmd:description', self.namespaces))
692
+ etree.SubElement(desc, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link.get('description')
693
+
694
+ return node
695
+
696
+ def write_keywords(keywords, nsmap):
697
+ """generate gmd:MD_Keywords construct"""
698
+ md_keywords = etree.Element(util.nspath_eval('gmd:MD_Keywords', nsmap))
699
+ for kw in keywords.split(','):
700
+ keyword = etree.SubElement(md_keywords, util.nspath_eval('gmd:keyword', nsmap))
701
+ etree.SubElement(keyword, util.nspath_eval('gco:CharacterString', nsmap)).text = kw
702
+ return md_keywords
703
+
704
+ def write_extent(bbox, nsmap):
705
+ ''' Generate BBOX extent '''
706
+
707
+ if bbox is not None:
708
+ try:
709
+ bbox2 = util.wkt2geom(bbox)
710
+ except Exception as err:
711
+ LOGGER.debug(f'Geometry parsing error: {err}')
712
+ return None
713
+ extent = etree.Element(util.nspath_eval('gmd:extent', nsmap))
714
+ ex_extent = etree.SubElement(extent, util.nspath_eval('gmd:EX_Extent', nsmap))
715
+ ge = etree.SubElement(ex_extent, util.nspath_eval('gmd:geographicElement', nsmap))
716
+ gbb = etree.SubElement(ge, util.nspath_eval('gmd:EX_GeographicBoundingBox', nsmap))
717
+ west = etree.SubElement(gbb, util.nspath_eval('gmd:westBoundLongitude', nsmap))
718
+ east = etree.SubElement(gbb, util.nspath_eval('gmd:eastBoundLongitude', nsmap))
719
+ south = etree.SubElement(gbb, util.nspath_eval('gmd:southBoundLatitude', nsmap))
720
+ north = etree.SubElement(gbb, util.nspath_eval('gmd:northBoundLatitude', nsmap))
721
+
722
+ etree.SubElement(west, util.nspath_eval('gco:Decimal', nsmap)).text = str(bbox2[0])
723
+ etree.SubElement(south, util.nspath_eval('gco:Decimal', nsmap)).text = str(bbox2[1])
724
+ etree.SubElement(east, util.nspath_eval('gco:Decimal', nsmap)).text = str(bbox2[2])
725
+ etree.SubElement(north, util.nspath_eval('gco:Decimal', nsmap)).text = str(bbox2[3])
726
+ return extent
727
+ return None
728
+
729
+ def _write_date(dateval, datetypeval, nsmap):
730
+ date1 = etree.Element(util.nspath_eval('gmd:date', nsmap))
731
+ date2 = etree.SubElement(date1, util.nspath_eval('gmd:CI_Date', nsmap))
732
+ date3 = etree.SubElement(date2, util.nspath_eval('gmd:date', nsmap))
733
+ if dateval.find('T') != -1:
734
+ dateel = 'gco:DateTime'
735
+ else:
736
+ dateel = 'gco:Date'
737
+ etree.SubElement(date3, util.nspath_eval(dateel, nsmap)).text = dateval
738
+ datetype = etree.SubElement(date2, util.nspath_eval('gmd:dateType', nsmap))
739
+ datetype.append(_write_codelist_element('gmd:CI_DateTypeCode', datetypeval, nsmap))
740
+ return date1
741
+
742
+ def _get_resource_opname(operations):
743
+ for op in operations.split(','):
744
+ if op in ['GetMap', 'GetFeature', 'GetCoverage', 'GetObservation']:
745
+ return op
746
+ return None
747
+
748
+ def _write_codelist_element(codelist_element, codelist_value, nsmap):
749
+ namespace, codelist = codelist_element.split(':')
750
+
751
+ element = etree.Element(util.nspath_eval(codelist_element, nsmap),
752
+ codeSpace=CODESPACE, codeList='%s#%s' % (CODELIST, codelist),
753
+ codeListValue=codelist_value)
754
+
755
+ element.text = codelist_value
756
+
757
+ return element