Skip to content

Add SPARQL Conformance Testing Framework - #301

Open
ricoandris wants to merge 169 commits into
qlever-dev:mainfrom
ricoandris:sparql-conformance-command-all-engines
Open

Add SPARQL Conformance Testing Framework#301
ricoandris wants to merge 169 commits into
qlever-dev:mainfrom
ricoandris:sparql-conformance-command-all-engines

Conversation

@ricoandris

@ricoandris ricoandris commented Jun 29, 2026

Copy link
Copy Markdown

Summary

This branch is built on top of the multi-engine work by Tanmay from
qlever-control#190,
which introduced the basic commands for operating QLever and six additional
SPARQL engines. This PR adapts and extends those commands so they can be used
by the separate sparql-conformance test harness.

This PR is the qlever-control side of
ad-freiburg/sparql-conformance#61.
To test the integration, check out and install both PRs as described below.

What changed

  • Build on the qblazegraph, qgraphdb, qjena, qmdb, qoxigraph, and
    qvirtuoso command-line tools introduced in
    qlever-control#190,
    adjusting their configuration, indexing, startup, query, reset, logging,
    status, and shutdown behavior where needed for conformance testing.
  • Add a non-interactive conformance mode to engine operations. It suppresses
    terminal followers and prompts, prepares missing engine configuration where
    needed, and supports fast test-data resets.
  • Discover command packages through Python imports. This works for commands in
    qlever-control as well as commands supplied by separately installed
    packages.
  • Keep qlever-control independent of the test harness: it neither vendors nor
    depends on sparql-conformance.
  • Retain the existing QLever CLI improvements that were developed alongside
    the multi-engine work, including the evaluation viewer, memory monitoring,
    and expanded index statistics.

Package boundary

sparql-conformance
owns the test runner, W3C manifest handling, engine adapters, result
comparison, Qleverfile templates, and the sparql_conformance executable.
qlever-control owns the reusable commands that configure and operate the
engines. The harness imports qlever-control only when a built-in engine is
selected.

This keeps a normal qlever installation free of the conformance harness and
avoids maintaining two copies of the test code.

Quick test setup

Prerequisites

  • Python 3.10 or newer
  • Git
  • A running Docker daemon (or the container runtime configured in the
    generated Qleverfile)
  • A GraphDB license when testing GraphDB

1. Check out both PRs

Run these commands from a new parent directory:

git clone --branch sparql-conformance-command-all-engines \
  https://github.com/SIRDNARch/qlever-control.git

git clone --branch main \
  https://github.com/SIRDNARch/sparql-conformance.git

The result should be two sibling checkouts:

.
├── qlever-control/
└── sparql-conformance/

2. Install both packages in one environment

Install qlever-control first and sparql-conformance second:

python3 -m venv .venv
source .venv/bin/activate

python -m pip install -e ./qlever-control
python -m pip install -e ./sparql-conformance

The installation order matters when upgrading from an older version that also
installed a sparql_conformance executable. Installing
sparql-conformance last ensures that the executable has a single owner.

3. Set up and run an engine

Use a separate working directory for each engine because setup writes an
engine-specific Qleverfile in the current directory:

mkdir -p conformance-runs/qlever
cd conformance-runs/qlever

sparql_conformance setup qlever
sparql_conformance test --report summary

setup creates the Qleverfile and downloads the W3C SPARQL 1.0 and 1.1 test
suites. test then configures and indexes the test data, starts the selected
engine, runs the tests, resets it between tests when possible, and stops it
again. No separate engine-start command is required.

Results are written below ./results.

4. Test another engine

Create another working directory and change only the engine name:

cd ../..
mkdir -p conformance-runs/jena
cd conformance-runs/jena

sparql_conformance setup jena
sparql_conformance test --report summary

Supported setup targets are:

qlever, blazegraph, graphdb, jena, mdb, oxigraph, virtuoso

For example, replace jena in the commands above with blazegraph,
graphdb, mdb, oxigraph, or virtuoso. Keep each engine in its own
directory.

Useful commands while testing:

# Run a small test group and print every result.
sparql_conformance test --include aggregates --report line

# Load one test and leave the engine available for manual debugging.
sparql_conformance analyze "COUNT 1"

# Compare with an earlier result.
sparql_conformance test \
  --compare-to results/previous.json.bz2 \
  --report summary

# View result files in the web UI.
sparql_conformance visualize --result-directory ./results

See docs/sparql-conformance.md for more
details.

tanmay-9 and others added 30 commits July 18, 2025 14:16
@ricoandris
ricoandris force-pushed the sparql-conformance-command-all-engines branch from a61410d to 26d40fa Compare July 4, 2026 10:24
@ricoandris
ricoandris force-pushed the sparql-conformance-command-all-engines branch from 26d40fa to 063aeb0 Compare July 6, 2026 07:12
- Delete src/sparql_conformance/ (~8k LOC vendored copy of
  github.com/ad-freiburg/sparql-conformance)
- Resolve command packages via the import system instead of a sibling
  directory glob, so commands from separately installed distributions
  and editable installs work alike
- Declare the sparql-conformance dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants