Skip to main content

oarepo-related-resources

A library for importing metadata from persistent identifiers (DOI and Handle) into Invenio/OARepo applications.

What it does

  • supports DataCite, Crossref, and Handle resolvers,
  • fetches and normalizes metadata such as titles, creators, dates, descriptions, and resource types,
  • reports non-fatal import problems together with the imported metadata,
  • provides an ORCID importer and ROR affiliation/funder resolution.

Registering the extension

Register the extension in the application's pyproject.toml:

[project.entry-points."invenio_base.api_apps"]
related_resources_import_extension = "oarepo_related_resources.ext:RelatedResourcesImportExtension"

[project.entry-points."invenio_base.apps"]
related_resources_import_extension = "oarepo_related_resources.ext:RelatedResourcesImportExtension"

The extension registers the /related-records resource and the current_orcid_importer proxy.

HTTP API

The resource accepts an authenticated POST request at /related-records:

{
  "identifier": "https://doi.org/10.5281/zenodo.19032692"
}

The identifier may also be supplied without its DOI or Handle URL prefix. A successful response contains normalized metadata and any non-fatal problems:

{
  "metadata": {
    "title": "...",
    "creators": [],
    "publication_date": "...",
    "resource_type": {"id": "..."}
  },
  "import_errors": [],
  "validation_errors": []
}

import_errors contains resolver problems. validation_errors contains errors from loading the resolved metadata into the configured record schema.

Typical HTTP errors are:

  • 403 — the caller is not allowed to import related resources;
  • 404 — unsupported or non-existent identifier;
  • the upstream response status — an upstream resolver request failed;
  • 500 — an unexpected processing error.

Resolver problems

Resolver methods return metadata together with a list of ResolverProblem objects. Each problem contains:

{
  "resolver": "DataCite",
  "message": "...",
  "level": "info",
  "original_exception": null
}

The available levels are info, warning, and error. These problems are non-fatal unless the resolver itself cannot produce a response. error level problems are also sent to the application logger; applications configured with Sentry/GlitchTip logging can report them there.

ORCID importer

Use the extension proxy after the application has been initialized:

from oarepo_related_resources.proxies import current_orcid_importer

person = current_orcid_importer.resolve(
    "0000-0001-2345-6789",
    vocabulary="names",
)

The importer reads the configured ORCID public dump and can resolve ROR identifiers for affiliations and funders.

Metadata

Release files for oarepo-related-resources 5.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oarepo-related-resources 5.1.0
File Size Uploaded
oarepo_related_resources-5.1.0.tar.gz 28.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oarepo-related-resources 5.1.0
File Interpreter ABI Platform
oarepo_related_resources-5.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.3 kB

Release history Release notifications | RSS feed

5.1.1

2 release files

This release

5.1.0 This release

2 release files

5.0.0

2 release files

4.4.0

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page