Skip to main content

Python API client wrapper for the DNB URN service API.

Project description

DNB support module for InvenioRDM. It offers a URN PIDProvider and additional metadata formats to be included in the OAI-PMH server. Currently these are epicur and xMetaDissPlus. In a later step the epicur format will be replaced by extending the URN PIDProvider by accessing the DNB REST-API’s to directly mint new and changed URN’s.

Configuration

Add the following to invenio.cfg:

OAISERVER_METADATA_FORMATS = {
  "oai_dc": {
    "serializer": "invenio_rdm_records.oai:dublincore_etree",
    "schema": "http://www.openarchives.org/OAI/2.0/oai_dc.xsd",
    "namespace": "http://www.openarchives.org/OAI/2.0/oai_dc/"
  },
  "datacite": {
    "serializer": "invenio_rdm_records.oai:datacite_etree",
    "schema": "http://schema.datacite.org/meta/nonexistant/nonexistant.xsd",
    "namespace": "http://datacite.org/schema/nonexistant"
  },
  "oai_datacite": {
        "serializer": "invenio_rdm_records.oai:oai_datacite_etree",
    "schema": "http://schema.datacite.org/oai/oai-1.1/oai.xsd",
    "namespace": "http://schema.datacite.org/oai/oai-1.1/"
  },
  "xMetaDiss": {
        "serializer": "invenio_dnb_urn.oai:xmetadiss_etree",
    "schema": "http://www.d-nb.de/standards/xmetadissplus/xmetadissplus.xsd",
    "namespace": "http://www.d-nb.de/standards/xmetadissplus/"
  },
}

URN_DNB_ID_PREFIX = "urn:nbn:de:hbz:6"
EPICUR_NBN_SCHEME = "urn:nbn:de"
XMETADISS_TYPE_DINI_PUBLTYPE = "openaire_type"
XMETADISS_TYPE_DCTERMS_DCMITYPE = "openaire_type"

#
# Persistent identifiers configuration
#
RDM_PERSISTENT_IDENTIFIER_PROVIDERS = [
    # DataCite DOI provider
    providers.DataCitePIDProvider(
        "datacite",
        client=providers.DataCiteClient("datacite", config_prefix="DATACITE"),
        label=_("DOI"),
    ),
    # DOI provider for externally managed DOIs
    providers.ExternalPIDProvider(
        "external",
        "doi",
        validators=[providers.BlockedPrefixes(config_names=["DATACITE_PREFIX"])],
        label=_("DOI"),
    ),
    # OAI identifier
    providers.OAIPIDProvider(
        "oai",
        label=_("OAI ID"),
    ),
    # URN identifier
    provider.DnbUrnProvider(
        "urn",
        client=provider.DNBUrnClient("dnb"),
        label=_("URN"),
    ),
]
"""A list of configured persistent identifier providers.
ATTENTION: All providers (and clients) takes a name as the first parameter.
This name is stored in the database and used in the REST API in order to
identify the given provider and client.
The name is further used to configure the desired persistent identifiers (see
``RDM_PERSISTENT_IDENTIFIERS`` below)
"""

RDM_PERSISTENT_IDENTIFIERS = {
    # DOI automatically removed if DATACITE_ENABLED is False.
    "doi": {
        "providers": ["datacite", "external"],
        "required": True,
        "label": _("DOI"),
        "validator": idutils.is_doi,
        "normalizer": idutils.normalize_doi,
    },
    "oai": {
        "providers": ["oai"],
        "required": True,
        "label": _("OAI"),
    },
    "urn": {
        "providers": ["urn"],
        "required": True,
        "label": _("URN"),
    },
}

Changes

Version 0.1.0 (released 2022-11-02) Initial release (non-public)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dnb_urn_service-0.1.1.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file dnb_urn_service-0.1.1.tar.gz.

File metadata

  • Download URL: dnb_urn_service-0.1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for dnb_urn_service-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cf2f2ba2e857ecd9fffef89f3180de1af1837b152df0fc805f2d7041ab2ac4d4
MD5 cf4041ca78a2c38538689b6572c8a572
BLAKE2b-256 b44187d18eb01e5a81dbdbc51429ebcf02cb4b9a4517b0ab153c0e46e48afcd0

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page