advanced.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .. _community_metadata_advanced_configuration:
  2. Advanced Configuration
  3. ======================
  4. .. contents:: :local:
  5. :depth: 1
  6. Import from Geonetwork
  7. ----------------------
  8. The :guilabel:`Import from Geonetwork` option allows the user to import existing metadata from `GeoNetwork <https://geonetwork-opensource.org//>`_.
  9. Two confurations are needed for the import to work:
  10. - **geonetworks:** configure a list geonetwork endpoints
  11. - **geonetworkmapping:** define the mapping between the geonetwork fields and the fields configured in the metadata module.
  12. The configuration can be added to the same `yaml <https://yaml.org/>`__ file as the UI configuration or it can be put in a separate file.
  13. Geonetwork endpoint configuration
  14. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  15. The example will configure 2 endpoints.
  16. .. code:: YAML
  17. geonetworks:
  18. - name: Geonetwork DOV production
  19. url: https://www.dov.vlaanderen.be/geonetwork/srv/api/records/${UUID}/formatters/xml?attachment=true
  20. - name: Geonetwork test
  21. url: https://geonetwork-opensource.org/test/srv/api/records/${UUID}/formatters/xml?attachment=true
  22. ================ ======== ============================
  23. Key Required Description
  24. ================ ======== ============================
  25. **name** yes The name of the Geonetwork endpoint that will be shown in the dropdown.
  26. **url** yes The url of the XML export of the metadata in the Geonetwork, where ``${UUID}`` will be replaced by the metadata's UUID.
  27. ================ ======== ============================
  28. Geonetwork mapping configuration
  29. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  30. Each field from Geonetwork can be mapped to a native field from GeoServer or a field from the metadata module.
  31. The configuration for simple components are added under the yaml attribute `geonetworkmapping`.
  32. The fields of the type ``COMPLEX`` are mapped under the attribute `objectmapping`.
  33. The example will map one field (UUID) from the geonetwork xml to UI.
  34. .. code:: YAML
  35. geonetworkmapping:
  36. - geoserver: metadata-identifier
  37. geonetwork: //gmd:fileIdentifier/gco:CharacterString/text()
  38. A complex object is mapped in the following example:
  39. .. code:: YAML
  40. objectmapping:
  41. - typename: responsible-party
  42. mapping:
  43. - geoserver: organisation
  44. geonetwork: .//gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString/text()
  45. - geoserver: contactinfo
  46. geonetwork: .//gmd:CI_ResponsibleParty/gmd:contactInfo
  47. - geoserver: role
  48. geonetwork: .//gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode/@codeListValue
  49. Metadata from geonetwork can also be mapped to native fields. Do this by setting the `mappingType` to ``NATIVE``
  50. .. code:: YAML
  51. - geoserver: title
  52. geonetwork: //gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString/text()
  53. mappingType: NATIVE
  54. - geoserver: alias
  55. geonetwork: //gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString/text()
  56. mappingType: NATIVE
  57. ================ ======== ============================
  58. Key Required Description
  59. ================ ======== ============================
  60. **geoserver** yes the key for the attributes in geoserver
  61. **geonetwork** yes The `xpath <https://developer.mozilla.org/en-US/docs/Web/XPath>`__ expression pointing to the content from the geonetwork metadata xml file.
  62. **mappingType:** no | CUSTOM (default; map to fields from the metadata module configuration)
  63. | NATIVE (map to geoserver native fields)
  64. ================ ======== ============================
  65. .. _community_metadata_advanced_configuration_custom_native:
  66. Custom to Native Mapping
  67. ------------------------
  68. Sometimes your custom metadata configuration may contain a more complex version of fields already present in geoserver native metadata,
  69. or you may want to derive geoserver native fields (such as URL's, keywords, etcetera) from information in your custom metadata. Native fields
  70. are used by ``GetCapabilities`` requests, and you want to avoid filling in the same information twice. We can automatise deriving these
  71. native fields from custom fields using a custom-to-native mapping configuration. For example in the following configuration:
  72. .. code:: YAML
  73. customNativeMappings:
  74. - type: KEYWORDS
  75. mapping:
  76. value: KEY_${keywords/name}
  77. vocabulary: ${keywords/vocabulary}
  78. - type: IDENTIFIERS
  79. mapping:
  80. value: ${identifiers/id}
  81. authority: ${identifiers/authority}
  82. - type: METADATALINKS
  83. mapping:
  84. value: https://my-host/geonetwork/?uuid=${uuid}
  85. type: text/html
  86. metadataType: ISO191156:2003
  87. - type: METADATALINKS
  88. mapping:
  89. value: https://my-host/geonetwork/srv/nl/csw?Service=CSW&Request=GetRecordById&Version=2.0.2&outputSchema=http://www.isotc211.org/2005/gmd&elementSetName=full&id=${uuid}
  90. type: text/xml
  91. metadataType: ISO191156:2003
  92. ================ ======== ============================
  93. Key Required Description
  94. ================ ======== ============================
  95. **type** yes currently supported: KEYWORDS, IDENTIFIERS, METADATALINKS
  96. **mapping** yes | List of key to value pairs. Value contains a literal with or without placeholder that contains custom attribute path (the ``/`` symbol denoting subfields inside complex fields).
  97. | Possible keys for KEYWORDS: value, vocabulary
  98. | Possible keys for METADATALINKS: value, type, metadataType, about
  99. | Possible keys for IDENTIFIERS: value, authority
  100. ================ ======== ============================
  101. The synchronisation of the metadata takes place each time a layer is saved. Any information that has been entered by the user in mapped native fields via the GUI will be lost.