Skip to main content

CKAN License

ckanext-citations

Citation tracking (cited-by, via OpenAlex with a DataCite Event Data fallback), a per-dataset disruption index, and a per-researcher S-index ("how many unique researchers has your data enabled" - see s-index.science), displayed on the dataset page.

v1 scope

This first iteration deliberately does not implement the 17 FAIRsFAIR/F-UJI metrics, a merged "FAIR score", or the metadata-enrichment assistant described in the original design note. It covers only the citation/impact-tracking half:

  • Citation count (cited-by) per dataset.
  • Disruption index (Wu, Wang & Evans, 2019): DI = (N_F - N_B) / (N_F + N_B + N_R).
  • S-index per ORCID: count of distinct researchers (deduplicated by ORCID, falling back to normalised name) who authored a work citing any of that researcher's FAIR3R datasets.
  • Display on the dataset page (citation count, disruption index, S-index with a co-author breakdown, a citing-works table).

Why dedicated tables, not package_extra

Citations and scores are refreshed by a periodic batch job, not by the user editing the dataset. Writing them through package_update/package_extra would create a package_revision row and trigger a full Solr reindex for every dataset on every refresh run - pure overhead for data nobody searches on. Instead this plugin owns five Postgres tables of its own (fair_citation_stats, fair_citing_works, fair_citing_researchers, fair_author_sindex, fair_score_history), created via the same Alembic-based migration mechanism as ckanext-doi (ckan db upgrade -p citations).

fair_citing_researchers exists only to make the S-index's "unique researchers" dedup correct across an author's several datasets: it's one row per (FAIR3R author ORCID, citing-researcher identity) pair, and fair_author_sindex.s_index_current is the cached COUNT(DISTINCT ...) over it. Both the citation count and the S-index are also tracked as high-water marks (*_max) so a researcher's score never visibly regresses just because an external API temporarily deduplicates differently between two refresh runs.

The disruption index needs a reference list the dataset usually doesn't have

The Wu/Wang/Evans formula needs to know what the focal work's own references are, to tell "citing works that also build on the same sources" (N_B) apart from "citing works that only cite the focal work" (N_F). OpenAlex rarely has a populated reference list for a dataset-type Work, which would make N_B/N_R collapse to 0 and the index trivially tend to +1.0 for almost every dataset with any citations at all.

To get a meaningful signal, the reference set is enriched with the dataset's own DataCite relatedIdentifiers whose relationType is References or Cites (already supported by the FDF schema via ckanext-doi) - each such DOI is resolved to an OpenAlex work id and added to the focal work's reference set before classifying citing works.

Config

# Contact email sent as OpenAlex's "polite pool" mailto param (better rate
# limits, not auth). Optional but recommended.
ckanext.citations.contact_email = your-team@example.org

# Pause between outbound API calls during a refresh, in seconds.
ckanext.citations.request_pause_seconds = 0.1

Running a refresh

ckan citations refresh --min-age-days 7

Idempotent and safe to run repeatedly: only datasets whose fair_citation_stats.last_checked is older than --min-age-days (or NULL, i.e. never checked) are touched. Intended to run from a weekly cron job, same pattern as fair3r update-schema.

Tests

Two test.ini files, same convention as the other FAIR3R extensions:

  • test.ini at the repo root: Docker DEV (/srv/app/src/ckan/test-core.ini).
  • ckanext/citations/tests/test.ini: shipped with the package, used by deploy/ckanext_test.py on integration/validation (/usr/lib/ckan/default/...).
docker exec -u ckan -it ckan-app pytest --ckan-ini=/plugins/ckanext-citations/test.ini /plugins/ckanext-citations/ckanext/citations/tests

Metadata

Release files for ckanext-citations 0.1.10

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

Source distribution (sdist)

Source distribution for ckanext-citations 0.1.10
File Size Uploaded Provenance Actions
ckanext_citations-0.1.10.tar.gz 39.1 kB Without provenance Details for ckanext_citations-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ckanext-citations 0.1.10
File Interpreter ABI Platform Actions
ckanext_citations-0.1.10-py3-none-any.whl Python 3 none any Details for ckanext_citations-0.1.10-py3-none-any.whl

Total release size: 86.7 kB

Release files / ckanext_citations-0.1.10.tar.gz

Download URL ckanext_citations-0.1.10.tar.gz
Size 39.1 kB
Tags Source
SHA-256 checksum
How to use checksums
326f1c0c4918949f689315e74c9bc6897018feee804a0c6010ca282e80eef335
BLAKE2b-256 checksum
How to use checksums
119494833529a95d631057435f7f84fdd808d111cf5b22e0be15cc8346ea9f23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / ckanext_citations-0.1.10-py3-none-any.whl

Download URL ckanext_citations-0.1.10-py3-none-any.whl
Size 47.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
138d1016f612f24cc8e88b56121015710d01b9600a9bbb51926bffc60f3e6b43
BLAKE2b-256 checksum
How to use checksums
819a22b294febbae724c0f1ac6f579a1771e81dd37ea48695bcf92878100bc57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for ckanext-citations 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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