Skip to main content

Tests DOI

ckanext-fuseki

A CKAN extension for semantic data management in research data portals. It automatically pushes RDF resources to an Apache Jena Fuseki triple store, provides a CKAN-authenticated SPARQL proxy that enforces dataset-level access control, and embeds a YASGUI query interface for interactive SPARQL exploration of linked data.

Fuseki tab in CKAN dataset view showing access information, SPARQL endpoint, authentication methods, named graphs, and per-resource upload toggles

Requirements

  • Apache Jena Fuseki server with custom security configuration (see Deployment section)
  • CKAN API Token with admin privileges for background job processing of private datasets

Fuseki Deployment

This extension requires a custom Fuseki deployment with modified security settings to enable CKAN-authenticated access. The necessary files are provided in the optional/ folder:

  • optional/fuseki/Dockerfile - Custom Fuseki image based on secoresearch/fuseki:6.2.0
  • optional/fuseki/docker-entrypoint.sh - Entrypoint wrapper that starts Fuseki with the image's server class
  • optional/fuseki/shiro.ini - Shiro configuration that requires the Fuseki admin login for everything except the health endpoints; this is what blocks anonymous access
  • optional/docker-compose.yml - Example standalone deployment configuration

See the optional/README.md for standalone deployment instructions, or integrate into your existing Docker Compose setup (see Deployment section below).

Optional: A Sparklis web app for interactive SPARQL querying is also available in the optional folder.

Features

  • Per-resource upload toggles — selectively push RDF resources (Turtle, N-Triples, JSON-LD, etc.) to Fuseki
  • Named graphs — each resource is stored in its own named graph within a dedicated Fuseki dataset
  • CKAN-authenticated SPARQL proxy — enforces CKAN dataset-level access control on all SPARQL endpoints
    • Public datasets: accessible to anyone via the CKAN proxy
    • Private datasets: require CKAN authentication (browser session or API token)
    • Direct Fuseki access: blocked for anonymous users, admin-only
  • Query Dataset button — opens Sparklis when ckanext.fuseki.sparklis_url is set, otherwise the embedded YASGUI interface (same on the Fuseki tab, the resource page and the resource list)
  • Endpoint overview — the Fuseki tab lists the sparql, query, get, data, update and upload endpoints with their required permission
  • Persistent & reasoning options — configurable at dataset level

Endpoint permissions (proxy /dataset/<id>/fuseki/$/<service>): sparql, query, get, data (GET) need read permission; update, upload, data (PUT/POST/DELETE) and any unknown path need edit permission (package_update). Writing directly changes the dataset in ways CKAN cannot track; the next Create/Update rebuilds it from the CKAN resources and discards manual changes.

Warning: if Fuseki is also published directly (for example an nginx /fuseki/ route), its own admin login is the only protection there and bypasses all CKAN checks. Use a strong ckanext.fuseki.password, and prefer the container-internal ckanext.fuseki.url.

See SECURITY.md for the full security architecture.

Compatibility

CKAN version Compatible?
2.9 and earlier not tested
2.10 ✓ tested
2.11 ✓ tested
2.12 ✓ tested

Installation

1. Install the Extension

From PyPI:

pip install ckanext-fuseki

From Source:

pip install -e git+https://github.com/Mat-O-Lab/ckanext-fuseki.git#egg=ckanext-fuseki

2. Deploy Fuseki

Use secoresearch/fuseki:6.2.0 (Jena 6, Java 21) with the provided configuration files mounted as volumes:

services:
  fuseki:
    # builds secoresearch/fuseki:6.2.0 plus the shiro.ini that blocks anonymous access
    build:
      context: ./path/to/ckanext-fuseki/optional/fuseki/
    environment:
      - JDK_JAVA_OPTIONS=-Xmx10g -Xms10g -DentityExpansionLimit=0 -Dfuseki:allowAddByConfigFile=true
      - ADMIN_PASSWORD=<your-fuseki-password>   # must match ckanext.fuseki.password
      - ENABLE_DATA_WRITE=true
      - ENABLE_UPDATE=true
      - ENABLE_UPLOAD=true
      - QUERY_TIMEOUT=60000
    volumes:
      - jena_data:/fuseki-base
    networks:
      - your_network
    healthcheck:
      test: ["CMD-SHELL", "wget -qO /dev/null http://localhost:3030/$$/ping || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 3
  • shiro.ini — configures HTTP Basic Auth (the admin password is set from ADMIN_PASSWORD at start). Use the provided image build: the stock secoresearch/fuseki image ships a shiro.ini that allows anonymous SPARQL queries and copies it to the volume only on first start, so the stock image alone leaves all datasets public. The wrapper in optional/fuseki/ copies the restrictive shiro.ini to /fuseki-base/shiro.ini on every start (the file must stay writable, the base entrypoint writes the password into it) and refuses to start without it. Verify with curl http://fuseki:3030/ds/sparql?query=ASK%7B%7D (must return 401). The file must contain the DefaultWebSessionManager lines from optional/fuseki/shiro.ini (Fuseki ≥ 5 requirement).
  • The Fuseki UI is served from the image itself and works behind an nginx /fuseki/ prefix without a custom index.html (Fuseki ≥ 5 uses relative asset paths).

Start Fuseki:

docker-compose up -d fuseki

Fuseki 5.x and 6.x (5.5 and later)

Tested with secoresearch/fuseki:6.2.0 (Jena 6, Java 21): UI behind an nginx /fuseki/ prefix, admin login, dataset creation and a full update job. A TDB2 database created with 4.9 was opened unchanged by 5.6.0; an existing database was not re-tested on 6.2.0. Back up the /fuseki-base volume before upgrading. Required changes compared to Fuseki 4.9:

  1. shiro.ini: add to [main]
    statelessSessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
    securityManager.sessionManager = $statelessSessionManager
    
    Without it every request that passes authentication returns HTTP 500 No SessionManager.
  2. Remove the index.html mount (/jena-fuseki/webapp/index.html). The UI is served from inside the server jar and works behind an nginx /fuseki/ prefix.
  3. Dataset creation needs -Dfuseki:allowAddByConfigFile=true. This extension creates one Fuseki dataset per CKAN dataset by posting an assembler description to POST /$/datasets. Fuseki 5.5.0 removed that (multipart and raw body) because of CVE-2025-50151 / CVE-2025-49656 (uploaded configuration with unvalidated paths, admin only). The extension now posts the assembly as a raw text/turtle body, which Fuseki accepts only with this system property, e.g. JDK_JAVA_OPTIONS=-Xmx10g -Dfuseki:allowAddByConfigFile=true. Without it job creation fails with 400 Service configuration from a multipart upload not supported. Keep Fuseki reachable only for admins (Shiro) and by CKAN; the Jena maintainers have said this switch is a stop-gap. Versions up to 5.4.0 accept the old upload without the property but are affected by the two CVEs.
  4. The image default command is org.apache.jena.fuseki.main.cmds.FusekiServerCmd. If you override entrypoint: in compose you must repeat the command, because Compose drops the image CMD.

Datasets created with persistent off are in-memory and are empty after a Fuseki restart; resubmit them from CKAN.

3. Configure CKAN

Add fuseki to the ckan.plugins setting in your CKAN config file:

ckan.plugins = ... fuseki

4. Restart CKAN

docker-compose restart ckan
# Or for Apache deployment:
sudo service apache2 reload

Config settings

All configuration is read from ckan.ini (or the equivalent CKANINI__ Docker environment variables):

ckan.ini key Default Description
ckanext.fuseki.url http://fuseki:3030/ Base URL of Fuseki used for all API calls from CKAN (dataset creation, uploads, queries, SPARQL proxy). The internal container address is recommended; a public URL behind nginx works too but adds a hop and needs the /fuseki/ route to forward the admin login
ckanext.fuseki.internal_url (empty) Optional direct container address, used only for the availability (ping) check; falls back to ckanext.fuseki.url
ckanext.fuseki.username admin Fuseki admin username — always admin (hardcoded by the Fuseki image)
ckanext.fuseki.password admin Fuseki admin password — must match the ADMIN_PASSWORD env var set on the Fuseki container
ckanext.fuseki.ckan_token (empty) CKAN API token for background job callbacks; required to process private datasets
ckanext.fuseki.formats turtle text/turtle n3 nt hext trig longturtle xml json-ld ld+json jsonld Space-separated list of resource formats that trigger upload to the triple store
ckanext.fuseki.ssl_verify true Verify SSL certificates when connecting to external resource URLs
ckanext.fuseki.sparklis_url (empty) If set, the query button redirects to this Sparklis instance instead of the built-in SPARQL UI
ckanext.fuseki.db_url CKAN's sqlalchemy.url SQLAlchemy URL of the database that stores the job status and job log. Normally leave unset. Replaces the former FUSEKI_SQLALCHEMY_URL environment variable (which is now ignored).

Example Docker environment variables (set in .env):

CKANINI__CKANEXT__FUSEKI__URL=http://fuseki:${FUSEKI_PORT}/
CKANINI__CKANEXT__FUSEKI__USERNAME=admin
CKANINI__CKANEXT__FUSEKI__PASSWORD=<your-fuseki-password>
CKANINI__CKANEXT__FUSEKI__CKAN_TOKEN=<your-ckan-api-token>
CKANINI__CKANEXT__FUSEKI__SSL_VERIFY=${SSL_VERIFY}

Prefer the container-internal address (e.g. http://fuseki:3030/) for ckanext.fuseki.url: CKAN uses it for all direct Fuseki API calls and the SPARQL proxy, so a public nginx URL puts every call through the proxy.

If ckanext.fuseki.ckan_token is not set, only public resources can be uploaded to the triple store.

Citation

If you use this software, please cite it. GitHub shows a "Cite this repository" button (top right of the repo page) that exports the CITATION.cff in APA or BibTeX format.

After the first Zenodo release, a DOI-specific BibTeX entry will be available on the Zenodo record. Until then:

@software{hanke_ckanext_fuseki,
  author       = {Hanke, Thomas},
  title        = {ckanext-fuseki},
  url          = {https://github.com/Mat-O-Lab/ckanext-fuseki},
  license      = {AGPL-3.0-or-later},
}

License

AGPL

Acknowledgements

This project's work is based on a fork of the repo etri-odp/ckanext-jena, and we like to thank the authors of that project for sharing their work. It was supported by Institute for Information & communications Technology Promotion (IITP) grant funded by the Korea government (MSIT) (No.2017-00253, Development of an Advanced Open Data Distribution Platform based on International Standards)

Metadata

Release files for ckanext-fuseki 1.2.1

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-fuseki 1.2.1
File Size Uploaded Provenance Actions
ckanext_fuseki-1.2.1.tar.gz 119.5 kB With provenance Details for ckanext_fuseki-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ckanext-fuseki 1.2.1
File Interpreter ABI Platform Actions
ckanext_fuseki-1.2.1-py3-none-any.whl Python 3 none any Details for ckanext_fuseki-1.2.1-py3-none-any.whl

Total release size: 185.1 kB

Release files / ckanext_fuseki-1.2.1.tar.gz

Download URL ckanext_fuseki-1.2.1.tar.gz
Size 119.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3fdad63bd8a7126ccdf43cdc021451a93fcba2a4b246d4630f33bcd67a43931d
BLAKE2b-256 checksum
How to use checksums
a3ffb7ff34cd5a0e15db9a401654718f0277ec8ceb7ee69087a93e25ca06821a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / ckanext_fuseki-1.2.1-py3-none-any.whl

Download URL ckanext_fuseki-1.2.1-py3-none-any.whl
Size 65.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc64beae79f4757732920949c8604da80bc449fdee6f96ce32d64c5813f7737a
BLAKE2b-256 checksum
How to use checksums
f733a52c74dcb16082606d6439e95a3910361ab965565d0f7677fb3848d11bd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for ckanext-fuseki 1.2.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ckanext_fuseki-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

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