Skip to content

Commit

Permalink
Integrates PyCSW v3 to provide DataCite metadata format
Browse files Browse the repository at this point in the history
Integrates pyCSW `v3` (as alpha) to provide DataCite download format on the backend.

Relates to PR Thuenen-GeoNode-Development/geonode-mapstore-client#27 which adds a button to download metadata as DataCite format.
  • Loading branch information
ahmdthr authored Dec 18, 2023
1 parent 7ed45ed commit fb7ced3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions geonode/base/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"KML",
"KMZ",
"Atom",
"DataCite",
"DIF",
"Dublin Core",
"ebRIM",
Expand Down
1 change: 1 addition & 0 deletions geonode/catalogue/backends/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
TIMEOUT = 10
METADATA_FORMATS = {
"Atom": ("atom:entry", "http://www.w3.org/2005/Atom"),
"DataCite": ("csw:Record", "http://datacite.org/schema/kernel-4"),
"DIF": ("dif:DIF", "http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/"),
"Dublin Core": ("csw:Record", "http://www.opengis.net/cat/csw/2.0.2"),
"ebRIM": ("rim:RegistryObject", "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"),
Expand Down
2 changes: 1 addition & 1 deletion geonode/catalogue/backends/pycsw_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class CatalogueBackend(GenericCatalogueBackend):
def __init__(self, *args, **kwargs):
"""initialize pycsw HTTP CSW backend"""
GenericCatalogueBackend.__init__(CatalogueBackend, self, *args, **kwargs)
self.catalogue.formats = ["Atom", "DIF", "Dublin Core", "ebRIM", "FGDC", "ISO"]
self.catalogue.formats = ["Atom", "DataCite", "DIF", "Dublin Core", "ebRIM", "FGDC", "ISO"]
2 changes: 1 addition & 1 deletion geonode/catalogue/backends/pycsw_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
class CatalogueBackend(GenericCatalogueBackend):
def __init__(self, *args, **kwargs):
GenericCatalogueBackend.__init__(CatalogueBackend, self, *args, **kwargs)
self.catalogue.formats = ["Atom", "DIF", "Dublin Core", "ebRIM", "FGDC", "ISO"]
self.catalogue.formats = ["Atom", "DataCite", "DIF", "Dublin Core", "ebRIM", "FGDC", "ISO"]
self.catalogue.local = True

def remove_record(self, uuid):
Expand Down
10 changes: 9 additions & 1 deletion geonode/catalogue/backends/pycsw_local_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
"pycsw:AnyText": "csw_anytext",
"pycsw:Language": "language",
"pycsw:Title": "title",
"pycsw:Edition": "edition",
"pycsw:Platform": "platform",
"pycsw:Instrument": "instrument",
"pycsw:SensorType": "sensortype",
"pycsw:CloudCover": "cloudcover",
"pycsw:Bands": "bands",
"pycsw:Themes": "themes",
"pycsw:Contacts": "contacts",
"pycsw:Abstract": "raw_abstract",
"pycsw:Keywords": "keyword_csv",
"pycsw:KeywordType": "keywordstype",
Expand Down Expand Up @@ -77,6 +85,6 @@
"pycsw:Publisher": "publisher",
"pycsw:Contributor": "contributor",
"pycsw:Relation": "relation",
"pycsw:Links": "download_links",
"pycsw:Links": "download_urls",
},
}
1 change: 1 addition & 0 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@
# Available download formats
DOWNLOAD_FORMATS_METADATA = [
"Atom",
"DataCite",
"DIF",
"Dublin Core",
"ebRIM",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pyjwt==2.7.0
# geopython dependencies
pyproj<3.6.0
OWSLib==0.29.2
pycsw==2.6.1
-e git+https://github.com/geopython/pycsw[email protected]#egg=pycsw
SQLAlchemy==2.0.15 # required by PyCSW
Shapely==1.8.5.post1
mercantile==1.2.1
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ install_requires =
# geopython dependencies
pyproj<3.6.0
OWSLib==0.29.2
pycsw==2.6.1
pycsw @ git+https://github.com/geopython/[email protected]
SQLAlchemy==2.0.15 # required by PyCSW
Shapely==1.8.5.post1
mercantile==1.2.1
Expand Down

0 comments on commit fb7ced3

Please sign in to comment.