Skip to main content

Oxigraph CLI

Latest Version Crates.io downloads Conda actions status Gitter

Oxigraph CLI is a graph database implementing the SPARQL standard. It is packaged as a command-line tool allowing to manipulate RDF files, query them using SPARQL... It also allows spawning an HTTP server on top of the database.

Oxigraph is in heavy development, and SPARQL query evaluation has not been optimized yet.

Oxigraph provides different installation methods for Oxigraph CLI:

It is also usable as a Rust library and as a Python library.

Oxigraph implements the following specifications:

A preliminary benchmark is provided.

Note that Oxigraph CLI was previously named Oxigraph Server before version 0.4. Older versions are available under this name.

Packaging status

Installation

You need to have a recent stable version of Rust and Cargo installed as well as Clang for the RocksDB Rust bindings.

To download, build, and install the latest released version run cargo install oxigraph-cli. There is no need to clone the git repository.

To compile the command-line tool from source, clone this git repository including its submodules (git clone --recursive https://github.com/oxigraph/oxigraph.git), and execute cargo build --release in the cli directory to compile the full binary after having downloaded its dependencies. It will create a fat binary in target/release/oxigraph.

Some build options (cargo features) are available:

  • rocksdb-pkg-config: links against an already compiled rocksdb shared library found using pkg-config.
  • native-tls: Enables Oxigraph HTTP client for query federation using the host OS TLS stack (enabled by default).
  • rustls-native Enables Oxigraph HTTP client for query federation using Rustls and the native certificates.
  • rustls-webpki Enables Oxigraph HTTP client for query federation using Rustls and the Common CA Database certificates.

Usage

Run oxigraph serve --location my_data_storage_directory to start the server where my_data_storage_directory is the directory where you want Oxigraph data to be stored. It listens by default on localhost:7878.

The server provides an HTML UI, based on YASGUI, with a form to execute SPARQL requests.

It provides the following REST actions:

  • /query allows evaluating SPARQL queries against the server repository following the SPARQL 1.1 Protocol. For example:
    curl -X POST -H 'Content-Type:application/sparql-query' \
      --data 'SELECT * WHERE { ?s ?p ?o } LIMIT 10' http://localhost:7878/query
    
    This action supports content negotiation and could return Turtle, N-Triples, RDF/XML, SPARQL Query Results XML Format and SPARQL Query Results JSON Format.
  • /update allows to execute SPARQL updates against the server repository following the SPARQL 1.1 Protocol. For example:
    curl -X POST -H 'Content-Type: application/sparql-update' \
      --data 'DELETE WHERE { <http://example.com/s> ?p ?o }' http://localhost:7878/update
    
  • /sparql allows both SPARQL queries and update (see it as the union of /query and /update).
  • /store allows to retrieve and change the server content using the SPARQL 1.1 Graph Store HTTP Protocol. For example:
    curl -f -X POST -H 'Content-Type:application/n-triples' \
      -T MY_FILE.nt "http://localhost:7878/store?graph=http://example.com/g"
    
    will add the N-Triples file MY_FILE.nt to the server dataset inside of the http://example.com/g named graph. Turtle, N-Triples and RDF/XML are supported. It is also possible to POST, PUT and GET the complete RDF dataset on the server using RDF dataset formats (TriG and N-Quads) against the /store endpoint. For example:
    curl -f -X POST -H 'Content-Type:application/n-quads' \
      -T MY_FILE.nq http://localhost:7878/store
    
    will add the N-Quads file MY_FILE.nq to the server dataset.

Use oxigraph --help to see the possible options when starting the server.

It is also possible to load RDF data offline using bulk loading: oxigraph load --location my_data_storage_directory --file my_file.nq

Using a Docker image

Display the help menu

docker run --rm ghcr.io/oxigraph/oxigraph --help

Run the Webserver

Expose the server on port 7878 of the host machine, and save data on the local ./data folder

docker run --rm -v $PWD/data:/data -p 7878:7878 ghcr.io/oxigraph/oxigraph serve --location /data --bind 0.0.0.0:7878

You can then access it from your machine on port 7878:

# Open the GUI in a browser
firefox http://localhost:7878

# Post some data
curl http://localhost:7878/store?default -H 'Content-Type: text/turtle' -T ./data.ttl

# Make a query
curl -X POST -H 'Accept: application/sparql-results+json' -H 'Content-Type: application/sparql-query' --data 'SELECT * WHERE { ?s ?p ?o } LIMIT 10' http://localhost:7878/query

# Make an UPDATE
curl -X POST -H 'Content-Type: application/sparql-update' --data 'DELETE WHERE { <http://example.com/s> ?p ?o }' http://localhost:7878/update

Run the Web server with basic authentication

It can be useful to make Oxigraph SPARQL endpoint available publicly, with a layer of authentication on /update to be able to add data.

You can do so by using a nginx basic authentication in an additional docker container with docker-compose. First create a nginx.conf file:

daemon off;
events {
    worker_connections  1024;
}
http {
    server {
        server_name localhost;
        listen 7878;
        rewrite ^/(.*) /$1 break;
        proxy_ignore_client_abort on;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host $http_host;
        proxy_set_header Access-Control-Allow-Origin "*";
        location ~ ^(/|/query)$ {
            proxy_pass http://oxigraph:7878;
            proxy_pass_request_headers on;
        }
        location ~ ^(/update|/store)$ {
            auth_basic "Oxigraph Administrator's Area";
            auth_basic_user_file /etc/nginx/.htpasswd; 
            proxy_pass http://oxigraph:7878;
            proxy_pass_request_headers on;
        }
    }
}

Then a docker-compose.yml in the same folder, you can change the default user and password in the environment section:

version: "3"
services:
  oxigraph:
    image: ghcr.io/oxigraph/oxigraph:latest
    ## To build from local source code:
    # build:
    #   context: .
    #   dockerfile: cli/Dockerfile
    volumes:
      - ./data:/data

  nginx-auth:
    image: nginx:1.21.4
    environment:
      - OXIGRAPH_USER=oxigraph
      - OXIGRAPH_PASSWORD=oxigraphy
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      ## For multiple users: uncomment this line to mount a pre-generated .htpasswd 
      # - ./.htpasswd:/etc/nginx/.htpasswd
    ports:
      - "7878:7878"
    entrypoint: "bash -c 'echo -n $OXIGRAPH_USER: >> /etc/nginx/.htpasswd && echo $OXIGRAPH_PASSWORD | openssl passwd -stdin -apr1 >> /etc/nginx/.htpasswd && /docker-entrypoint.sh nginx'"

Once the docker-compose.yaml and nginx.conf are ready, start the Oxigraph server and nginx proxy for authentication on http://localhost:7878:

docker-compose up

Then it is possible to update the graph using basic authentication mechanisms. For example with curl: change $OXIGRAPH_USER and $OXIGRAPH_PASSWORD, or set them as environment variables, then run this command to insert a simple triple:

curl -X POST -u $OXIGRAPH_USER:$OXIGRAPH_PASSWORD -H 'Content-Type: application/sparql-update' --data 'INSERT DATA { <http://example.com/s> <http://example.com/p> <http://example.com/o> }' http://localhost:7878/update

In case you want to have multiple users, you can comment the entrypoint: line in the docker-compose.yml file, uncomment the .htpasswd volume, then generate each user in the .htpasswd file with this command:

htpasswd -Bbn $OXIGRAPH_USER $OXIGRAPH_PASSWORD >> .htpasswd

Build the image

You could easily build your own Docker image by cloning this repository with its submodules, and going to the root folder:

git clone --recursive https://github.com/oxigraph/oxigraph.git
cd oxigraph

Then run this command to build the image locally:

docker build -t ghcr.io/oxigraph/oxigraph -f cli/Dockerfile .

Systemd

It is possible to run Oxigraph in the background using systemd.

For that, you can use the following oxigraph.service file (it might be inserted into /etc/systemd/system/ or $HOME/.config/systemd/user):

[Unit]
Description=Oxigraph database server
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
ExecStart=/PATH/TO/oxigraph serve --location /PATH/TO/OXIGRAPH/DATA

[Install]
WantedBy=multi-user.target

Man pages and autocompletion

Autocompletion for various shells are generated on build in the target/{debug,release}/build/oxigraph-cli-<hash>/out/complete directory. Similarly, man pages are generated in the target/{debug,release}/build/oxigraph-cli-<hash>/out/man directory.

Migration guide

From 0.2 to 0.3

  • The cli API has been completely rewritten. To start the server run oxigraph serve --location MY_STORAGE instead of oxigraph --file MY_STORAGE.
  • Fast data bulk loading is now supported using oxigraph load --location MY_STORAGE --file MY_FILE. The file format is guessed from the extension (.nt, .ttl, .nq, ...).
  • RDF-star is now implemented.
  • All operations are now transactional using the "repeatable read" isolation level: the store only exposes changes that have been "committed" (i.e. no partial writes) and the exposed state does not change for the complete duration of a read operation (e.g. a SPARQL query) or a read/write operation (e.g. a SPARQL update).

Help

Feel free to use GitHub discussions or the Gitter chat to ask questions or talk about Oxigraph. Bug reports are also very welcome.

If you need advanced support or are willing to pay to get some extra features, feel free to reach out to Tpt.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Metadata

Release files for oxigraph 0.5.11

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

Source distribution (sdist)

Source distribution for oxigraph 0.5.11
File Size Uploaded
oxigraph-0.5.11.tar.gz 6.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for oxigraph 0.5.11
File
oxigraph-0.5.11-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
oxigraph-0.5.11-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
oxigraph-0.5.11-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
oxigraph-0.5.11-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
oxigraph-0.5.11-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
oxigraph-0.5.11-py3-none-macosx_10_14_x86_64.whl Python 3 none macOS 10.14+ x86-64 Details

Total release size: 47.7 MB

Release files / oxigraph-0.5.11.tar.gz

Download URL oxigraph-0.5.11.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
136c7e4b1982c3c8b75f89e3f393d3c1315158c1e98b01a1e6e82d355a7aa153
BLAKE2b-256 checksum
How to use checksums
543fae687342cbed7a2a98b738c298c83f0784808f5865b2c5c9f26c5b7319de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release files / oxigraph-0.5.11-py3-none-win_arm64.whl

Download URL oxigraph-0.5.11-py3-none-win_arm64.whl
Size 5.5 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
ee6b115f80a6df4d1437d09c16ef76c2550be3a835973d1bc0992242f639f7aa
BLAKE2b-256 checksum
How to use checksums
daa8c889d59eb8c02dc1f55288992abc520584828d5df8e1dee2f88d852671dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release files / oxigraph-0.5.11-py3-none-win_amd64.whl

Download URL oxigraph-0.5.11-py3-none-win_amd64.whl
Size 5.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ffc8c48d2ad4ef4d7755f1883a42abf9dbbdb14160a8b622ed0083f5e9d174ec
BLAKE2b-256 checksum
How to use checksums
5d8afc4c3246124dcfc18f3486e3c75f39f34ba642fc71892d02aad2cadf72a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release files / oxigraph-0.5.11-py3-none-manylinux_2_28_x86_64.whl

Download URL oxigraph-0.5.11-py3-none-manylinux_2_28_x86_64.whl
Size 8.6 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d1b870a6ab77d69e6b45ff48f49694f8f4cbd65726498bfcc6143c31a3a81c5c
BLAKE2b-256 checksum
How to use checksums
ac6eb680e07ea109fefdd4579970496a0d9df80951abbc6ff8c5cf7a5ceecad6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release files / oxigraph-0.5.11-py3-none-manylinux_2_28_aarch64.whl

Download URL oxigraph-0.5.11-py3-none-manylinux_2_28_aarch64.whl
Size 8.1 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
9bce08f8ee63207ca47d7e2d3bf64a4c9289208a48c945c0a432ff2471d2b0e9
BLAKE2b-256 checksum
How to use checksums
8477714dcfae74c1cf40dfe14fcba511f352b19a64b1f4bb3193a43c1b2f5385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release files / oxigraph-0.5.11-py3-none-macosx_11_0_arm64.whl

Download URL oxigraph-0.5.11-py3-none-macosx_11_0_arm64.whl
Size 6.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a6dcb57602921d19f7792cec2a02116ac1c43ed1abc102a3793ef7977827e9ed
BLAKE2b-256 checksum
How to use checksums
59f28256999f167a987d10f080f218c7903d78a34713140c718c3c5777a7769d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release files / oxigraph-0.5.11-py3-none-macosx_10_14_x86_64.whl

Download URL oxigraph-0.5.11-py3-none-macosx_10_14_x86_64.whl
Size 6.8 MB
Tags Python 3 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
2f8aeec6c0d3b584c7071044e07ad915fccae1e6c73946d33d4ff0bac50c1dba
BLAKE2b-256 checksum
How to use checksums
fcba3bdf08869494764f001ca95e545264bd8b7dc8d63a2d63d2d0f6ca9496b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log
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