Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
7a4957a
Make qlever commands engine-agnostic and clean up style issues
tanmay-9 Aug 15, 2026
3f7a67d
Apply ruff 0.16 automatic fixes
tanmay-9 Aug 15, 2026
86e3555
Remove redundant pytest import and importorskip call from test_footer.py
tanmay-9 Aug 15, 2026
50f469a
Remove not-yet accurate comment
tanmay-9 Aug 15, 2026
8f16bdd
Use a python-native solution to update ini-style values instead of us…
tanmay-9 Aug 15, 2026
0dcd14d
Fix `--timeout` unit handling and align `index-stats` headings
tanmay-9 Aug 15, 2026
3b1e35b
Extract reusable helpers from `qlever start`
tanmay-9 Aug 15, 2026
c290769
Add ResourceMonitor for the new engines and improve usage_plot so tha…
tanmay-9 Aug 17, 2026
cbd94dc
Add <dataset>.<engine> prefix to resource-usage log and plot for non-…
tanmay-9 Aug 18, 2026
6955a1c
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Aug 18, 2026
46b1648
Merge remote-tracking branch 'origin/main' into make-qlever-engine-ag…
tanmay-9 Aug 18, 2026
64edc49
Merge remote-tracking branch 'origin/main' into setup-config-without-sed
tanmay-9 Aug 18, 2026
f5ea4d5
Merge remote-tracking branch 'origin/make-qlever-engine-agnostic' int…
tanmay-9 Aug 18, 2026
f0e6902
Fix failing test
tanmay-9 Aug 18, 2026
d3acf48
Merge remote-tracking branch 'origin/make-qlever-engine-agnostic' int…
tanmay-9 Aug 18, 2026
3599034
Merge branch 'qlever-dev:main' into fix-timeout-units-and-index-stats…
tanmay-9 Aug 18, 2026
16753b5
Merge remote-tracking branch 'origin/make-qlever-engine-agnostic' int…
tanmay-9 Aug 18, 2026
de4f82e
Merge remote-tracking branch 'origin/main' into extract-qlever-start-…
tanmay-9 Aug 18, 2026
96ebe7d
Merge remote-tracking branch 'origin/main' into setup-config-without-sed
tanmay-9 Aug 18, 2026
d2c220c
Merge remote-tracking branch 'origin/main' into fix-timeout-units-and…
tanmay-9 Aug 18, 2026
1c9fbe9
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Aug 18, 2026
bcfc581
Merge remote-tracking branch 'origin/extract-qlever-start-helpers' in…
tanmay-9 Aug 19, 2026
0953b4d
Merge remote-tracking branch 'origin/share-resource-usage-plot-and-mo…
tanmay-9 Aug 19, 2026
4cab6c6
Merge branch 'fix-timeout-units-and-index-stats-width' into qeval-oxi…
tanmay-9 Aug 19, 2026
e6e8412
Add oxigraph directory with commands and CI action
tanmay-9 Aug 19, 2026
723b992
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Sep 8, 2026
1229933
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Oct 10, 2026
810fe6a
Merge remote-tracking branch 'origin/main' into fix-timeout-units-and…
tanmay-9 Oct 10, 2026
bd91aa1
Merge remote-tracking branch 'origin/main' into qeval-oxigraph
tanmay-9 Oct 10, 2026
e3069ba
Merge branch 'fix-timeout-units-and-index-stats-width' into qeval-oxi…
tanmay-9 Oct 10, 2026
55a2e68
Merge branch 'share-resource-usage-plot-and-monitor' into qeval-oxigraph
tanmay-9 Oct 10, 2026
794b5be
Adapt `qeval oxigraph start` to the renamed liveness check and `stop_…
tanmay-9 Oct 10, 2026
d278f1e
Say "graph databases" instead of "engines" in the `qeval` help
tanmay-9 Oct 10, 2026
8e8502c
Add shared `status` and `stop` commands for the graph databases in `q…
tanmay-9 Oct 10, 2026
4df3ef9
Add shared `query` and `benchmark-queries` commands and an endpoint p…
tanmay-9 Oct 10, 2026
bee679b
Add a shared `setup-config` command for the graph databases in `qeval`
tanmay-9 Oct 10, 2026
da603b4
Add a shared `index-stats` command for the graph databases in `qeval`
tanmay-9 Oct 10, 2026
39fcda0
Rename the shared `qeval` commands to `Base...Command` in `qeval/base…
tanmay-9 Oct 10, 2026
397c8cf
Merge branch 'qeval-base-commands' into qeval-oxigraph
tanmay-9 Oct 10, 2026
ee27873
Build `qeval oxigraph` on the shared base commands
tanmay-9 Oct 10, 2026
92bc6fa
Improve oxigraph's status and stop regexes to only match the process
tanmay-9 Oct 10, 2026
8e70388
Set `pin_to_cache` as a parser default in the shared `query` command
tanmay-9 Oct 10, 2026
b597433
Let engines choose the index-stats command and cache clearing in `ben…
tanmay-9 Oct 10, 2026
d88a6a6
Merge branch 'qeval-base-commands' into qeval-oxigraph
tanmay-9 Oct 10, 2026
7f20ab5
Read Oxigraph's own index stats in `qeval oxigraph benchmark-queries`
tanmay-9 Oct 10, 2026
0abf960
Check that `qeval oxigraph` commands load and that benchmark result f…
tanmay-9 Oct 11, 2026
1252e64
Merge remote-tracking branch 'origin/main' into fix-timeout-units-and…
tanmay-9 Oct 13, 2026
81f89c9
Accept only whole-second `--timeout` units and inline the `index-stat…
tanmay-9 Oct 13, 2026
6c06ed6
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Oct 13, 2026
ea94b51
Remove the Virtuoso-specific parts from the shared resource-usage mon…
tanmay-9 Oct 13, 2026
2d73c0e
Remove semicolons, single-letter names and engine examples from `Reso…
tanmay-9 Oct 13, 2026
6073f61
Move `ResourceMonitor` and its helpers to `qeval` and share the test …
tanmay-9 Oct 13, 2026
9c9a723
Move the shared resource-usage plot code to `plot_util` so engines pa…
tanmay-9 Oct 13, 2026
d2baf1b
Move parse_git_hash from util to usage_plot.py
tanmay-9 Oct 13, 2026
720b5e2
Merge remote-tracking branch 'origin/main' into qeval-base-commands
tanmay-9 Oct 13, 2026
d8b8681
Read the SPARQL endpoint path and the `status` regex from hooks inste…
tanmay-9 Oct 13, 2026
25052fa
Use `/` as the SPARQL endpoint path of QLever, so that every endpoint…
tanmay-9 Oct 13, 2026
b59d5e9
Merge branch 'qeval-base-commands' into qeval-oxigraph
tanmay-9 Oct 13, 2026
c302ca6
Merge branch 'share-resource-usage-plot-and-monitor' into qeval-oxigraph
tanmay-9 Oct 13, 2026
6adc798
Move Oxigraph's resource-usage plot module up to `qeval/oxigraph`
tanmay-9 Oct 13, 2026
3d0670a
Merge branch 'fix-timeout-units-and-index-stats-width' into qeval-oxi…
tanmay-9 Oct 13, 2026
004e086
Name the plot hook types, drop the unused `output_dir` pass-through a…
tanmay-9 Oct 13, 2026
a06f9d8
Merge branch 'share-resource-usage-plot-and-monitor' into qeval-oxigraph
tanmay-9 Oct 13, 2026
e15c7e7
Let engines choose the `--accept` choices and whether `--pin-to-cache…
tanmay-9 Oct 13, 2026
52bbd2e
Merge branch 'qeval-base-commands' into qeval-oxigraph
tanmay-9 Oct 13, 2026
a90b9f1
Drop the test-only `output_dir` parameter from `render_usage_plot`
tanmay-9 Oct 21, 2026
76cf9a3
Remove an always-true check from `ResourceMonitor.run_loop` and type …
tanmay-9 Oct 21, 2026
cc2e5d0
Merge remote-tracking branch 'origin/main' into fix-timeout-units-and…
tanmay-9 Oct 21, 2026
6c62f75
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Oct 21, 2026
9d58ea4
Merge remote-tracking branch 'origin/main' into qeval-base-commands
tanmay-9 Oct 21, 2026
538940d
Merge remote-tracking branch 'origin/fix-timeout-units-and-index-stat…
tanmay-9 Oct 21, 2026
b953c04
Merge remote-tracking branch 'origin/share-resource-usage-plot-and-mo…
tanmay-9 Oct 21, 2026
7e6be19
Merge branch 'qeval-base-commands' into qeval-oxigraph
tanmay-9 Oct 21, 2026
ca71b91
Notice in `qeval oxigraph start` when a native server exits before it…
tanmay-9 Oct 21, 2026
2ca6736
Simplify the `.sst` checks, name the Oxigraph index log once and wrap…
tanmay-9 Oct 21, 2026
9b81fcb
Drop the benchmark-queries check and its files from the Oxigraph CI w…
tanmay-9 Oct 21, 2026
4d76479
Merge remote-tracking branch 'origin/main' into qeval-base-commands
hannahbast Oct 22, 2026
3238bdb
Report a missing container in the shared `stop` command
hannahbast Oct 22, 2026
0b48f14
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Nov 2, 2026
4b97520
Fix resource monitor wait interval timing
tanmay-9 Nov 2, 2026
6ebfa09
Merge remote-tracking branch 'origin/main' into qeval-base-commands
tanmay-9 Nov 2, 2026
ab07735
Match qeval's BaseStopCommand with qlever's and add tests for all the…
tanmay-9 Nov 2, 2026
da3d707
Make sure that status_command of corresponding engine is run when sto…
tanmay-9 Nov 2, 2026
9851f1c
Merge remote-tracking branch 'origin/share-resource-usage-plot-and-mo…
tanmay-9 Nov 2, 2026
74ab99f
Merge branch 'qeval-base-commands' into qeval-oxigraph
tanmay-9 Nov 2, 2026
22378d1
Give the Oxigraph `stop` command a server-only regex for the status i…
tanmay-9 Nov 2, 2026
17fd0eb
Remove the Oxigraph server container directly on Ctrl-C in `qeval oxi…
tanmay-9 Nov 2, 2026
ad1c6f5
Leave the optimize time out of the Oxigraph index log when the optimi…
tanmay-9 Nov 2, 2026
957c3f7
Always pass the query timeout to the Oxigraph server, without first c…
tanmay-9 Nov 2, 2026
75b0566
Add tests for the Oxigraph `index-stats`, `index`, `start`, and plot …
tanmay-9 Nov 2, 2026
462aa09
Merge remote-tracking branch 'origin/main' into share-resource-usage-…
tanmay-9 Nov 13, 2026
28cbcbf
Test `ResourceMonitor` against a real child process and log the peak RSS
tanmay-9 Nov 13, 2026
28eeccd
Merge remote-tracking branch 'origin/main' into qeval-base-commands
tanmay-9 Nov 13, 2026
f6671ce
Merge branch 'share-resource-usage-plot-and-monitor' into qeval-oxigraph
tanmay-9 Nov 13, 2026
d460af1
Merge branch 'qeval-base-commands' into qeval-oxigraph
tanmay-9 Nov 13, 2026
d88f7a5
Minor fixes
tanmay-9 Nov 13, 2026
fb77f26
Skip the RSS 0 reading of an exiting process in `ResourceMonitor`
tanmay-9 Nov 13, 2026
4a46499
Merge branch 'share-resource-usage-plot-and-monitor' into qeval-oxigraph
tanmay-9 Nov 13, 2026
b9460f8
Merge remote-tracking branch 'origin/main' into qeval-oxigraph
hannahbast Nov 20, 2026
f6ec4c8
Download the oxigraph binary with `gh release download` in the native…
tanmay-9 Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/end-to-end-test-oxigraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: End-to-end test for oxigraph

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
merge_group:

permissions:
contents: read

jobs:
oxigraph-end-to-end-test:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
system: [ native, docker, podman ]

steps:
- name: Checkout the repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install the qeval script + dependencies needed for testing
run: |
python -m pip install --upgrade pip
pip install -e ".[plot]"
sudo apt-get update && sudo apt-get install -y unzip

- name: Check that every command loads and shows its help
run: |
export QEVAL_ARGCOMPLETE_ENABLED=1
commands=$(python -c "from qlever import load_commands; print(*load_commands('qeval.oxigraph'))")
for command in $commands; do
echo "Checking qeval oxigraph $command --help"
qeval oxigraph $command --help > /dev/null
done

- name: Install the latest oxigraph release binary on PATH
if: matrix.system == 'native'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download --repo oxigraph/oxigraph \
--pattern '*x86_64_linux_gnu' -O oxigraph
chmod +x oxigraph
sudo mv oxigraph /usr/local/bin/oxigraph
oxigraph --version

- name: Make sure the container runtime is available and pull the image
if: matrix.system != 'native'
run: |
command -v ${{matrix.system}} || (sudo apt-get update && sudo apt-get install -y ${{matrix.system}})
${{matrix.system}} --version
${{matrix.system}} pull ghcr.io/oxigraph/oxigraph

- name: End-to-end test on the olympics dataset (${{matrix.system}})
run: |
export QEVAL_ARGCOMPLETE_ENABLED=1
mkdir -p oxigraph-e2e && cd oxigraph-e2e
qeval oxigraph setup-config olympics --system ${{matrix.system}}
qeval oxigraph get-data
qeval oxigraph index

echo "Checking that the resource-usage log and plot were produced"
test -s olympics.oxigraph.index.resource-usage-log.tsv
test -f olympics.oxigraph.resource-usage-plot.png

qeval oxigraph index-stats
qeval oxigraph start
qeval oxigraph status
qeval oxigraph query
qeval oxigraph stop
ls -lh
5 changes: 5 additions & 0 deletions src/qeval/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ class Engine(NamedTuple):
"qlever": Engine(
package="qlever", display_name="QLever", endpoint_path="/"
),
"oxigraph": Engine(
package="qeval.oxigraph",
display_name="Oxigraph",
endpoint_path="/query",
),
}


Expand Down
Empty file added src/qeval/oxigraph/__init__.py
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions src/qeval/oxigraph/commands/benchmark_queries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from __future__ import annotations

from qeval.base_commands.benchmark_queries import BaseBenchmarkQueriesCommand
from qeval.oxigraph.commands.index_stats import IndexStatsCommand


class BenchmarkQueriesCommand(BaseBenchmarkQueriesCommand):
"""Run benchmark queries against the Oxigraph SPARQL endpoint."""

def index_stats_command(self) -> IndexStatsCommand:
return IndexStatsCommand()
1 change: 1 addition & 0 deletions src/qeval/oxigraph/commands/get_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from qlever.commands.get_data import GetDataCommand # noqa
215 changes: 215 additions & 0 deletions src/qeval/oxigraph/commands/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
from __future__ import annotations

import shlex
import time
from pathlib import Path

from qeval.oxigraph.usage_plot import overlay, subtitle
from qeval.resource_monitor import ResourceMonitor
from qlever.command import QleverCommand
from qlever.containerize import Containerize
from qlever.log import log
from qlever.resource_usage.plot_util import render_usage_plot_if_installed
from qlever.util import (
binary_exists,
get_total_file_size,
input_files_exist,
run_command,
)


def wrap_cmd_in_container(args, cmd: str, ulimit: int | None = None) -> str:
"""
Wrap an indexing command in a container that is automatically removed
after the process exits (`--rm`). Use `use_bash=False` as Oxigraph image
doesn't support bash entrypoint.
"""
run_subcommand = "run --rm"
if ulimit:
run_subcommand += f" --ulimit nofile={ulimit}:{ulimit}"
return Containerize().containerize_command(
cmd=cmd,
container_system=args.system,
run_subcommand=run_subcommand,
image_name=args.image,
container_name=args.index_container,
volumes=[("$(pwd)", "/opt")],
working_directory="/opt",
use_bash=False,
)


class IndexCommand(QleverCommand):
"""
Build an Oxigraph index for an RDF dataset. The indexing workflow is:
1. Run `oxigraph load` to import input files into a RocksDB store.
2. Optionally run `oxigraph optimize` to compact storage for read-only use.

For large datasets (>5 GB), the file descriptor ulimit is raised
automatically because RocksDB opens many .sst files concurrently.
"""

def __init__(self):
pass

def description(self) -> str:
return "Build the index for a given RDF dataset"

def should_have_qleverfile(self) -> bool:
return True

def relevant_qleverfile_arguments(self) -> dict[str, list[str]]:
return {
"data": ["name"],
"index": [
"input_files",
"ulimit",
"index_binary",
"lenient",
"extra_args",
"resource_usage_interval",
"resource_usage_plot_max_points",
],
"server": ["read_only"],
"runtime": ["system", "image", "index_container"],
}

def additional_arguments(self, subparser) -> None:
subparser.add_argument(
"--resource-usage-plot-only",
action="store_true",
default=False,
help="Only render the resource-usage plot from the existing "
"`<name>.oxigraph.index.resource-usage-log.tsv`; do not build "
"the index. Use to re-render with a different "
"`--resource-usage-plot-max-points`",
)

def execute(self, args) -> bool:
# Render the resource-usage plot from the existing log without
# rebuilding the index.
if args.resource_usage_plot_only:
plot_path = render_usage_plot_if_installed(
args,
plot_only=True,
engine_overlay=overlay,
engine_subtitle=subtitle,
)
return plot_path is not None

cmds_to_execute = []
log_file_name = f"{args.name}.index-log.txt"
index_cmd = (
f"load {'--lenient ' if args.lenient == 'yes' else ''}"
f"--location {args.name}_index/ --file {args.input_files} "
f"{args.extra_args} |& tee {log_file_name}"
)

ulimit = args.ulimit
# RocksDB opens many .sst files concurrently. For datasets larger
# than 5 GB, raise the file descriptor limit so the process does
# not hit the default OS soft limit.
total_file_size = get_total_file_size(shlex.split(args.input_files))
if not ulimit and total_file_size > 5e9:
ulimit = 500_000
if args.system in Containerize.supported_systems():
index_cmd = wrap_cmd_in_container(args, index_cmd, ulimit)
else:
index_cmd = f"{args.index_binary} {index_cmd}"
if ulimit:
index_cmd = f"ulimit -Sn {ulimit} && {index_cmd}"

cmds_to_execute.append(index_cmd)

# Compact the RocksDB storage for read-only serving. This reduces
# disk usage and speeds up queries but makes the index immutable.
optimize_cmd = None
if args.read_only == "yes":
optimize_cmd = f"optimize -l {args.name}_index/"
if args.system in Containerize.supported_systems():
optimize_cmd = wrap_cmd_in_container(args, optimize_cmd)
else:
optimize_cmd = f"{args.index_binary} {optimize_cmd}"
cmds_to_execute.append(optimize_cmd)

# Show the command line.
self.show("\n".join(cmds_to_execute), only_show=args.show)
if args.show:
return True

if not input_files_exist(args.input_files, args.main_command_name):
return False

# When running natively, check if the binary exists and works.
if args.system in Containerize.supported_systems():
if Containerize().is_running(args.system, args.index_container):
log.info(
f"{args.system} container {args.index_container} is "
"still up, which means that data loading is in progress. "
"Please wait..."
)
return False
else:
if not binary_exists(args.index_binary, "index-binary", args):
return False

# Abort if a previous index already exists. RocksDB .sst files in
# the index directory indicate an existing store.
if any(Path(f"{args.name}_index").glob("*.sst")):
log.error(
f"Index files (*.sst) found in {args.name}_index directory "
"which shows presence of a previous index"
)
log.info("")
log.info("Aborting the index operation...")
return False

# Run the index command and record the elapsed time in the log
# file. Oxigraph's progress output is unreliable (may not print a
# final summary line when loading multiple files), so we measure
# the time externally.
with ResourceMonitor.from_args(args):
try:
load_start = time.time()
run_command(index_cmd, show_output=True, show_stderr=True)
load_s = time.time() - load_start
except Exception as e:
log.error(f"Building the index failed: {e}")
return False

# Stays None if the optimize step is skipped or fails, so that the
# log only has the times of steps that completed.
optimize_s = None
if optimize_cmd:
try:
log.info("")
log.info("Optimizing read-only database storage:")
self.show(optimize_cmd)
optimize_start = time.time()
run_command(
optimize_cmd, show_output=True, show_stderr=True
)
optimize_s = time.time() - optimize_start
except Exception as e:
log.error(f"Optimizing the database storage failed: {e}")
log.info(
f"Please run manually: "
f"{args.index_binary} optimize -l {args.name}_index/"
)

total_s = load_s
with open(log_file_name, "a") as f:
f.write(f"Load time: {load_s:.0f}s\n")
if optimize_s is not None:
f.write(f"Optimize time: {optimize_s:.0f}s\n")
total_s += optimize_s
f.write(f"TOTAL time: {total_s:.0f}s\n")

render_usage_plot_if_installed(
args,
plot_only=False,
engine_overlay=overlay,
engine_subtitle=subtitle,
)

return True
30 changes: 30 additions & 0 deletions src/qeval/oxigraph/commands/index_stats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from __future__ import annotations

import re

from qeval.base_commands.index_stats import BaseIndexStatsCommand


class IndexStatsCommand(BaseIndexStatsCommand):
"""
Show how long the Oxigraph index build took and how much space the
index uses.
"""

def index_size_patterns(self, args) -> list[str]:
return [f"{args.name}_index/*.sst"]

def parse_index_durations(self, log_text: str) -> dict[str, float]:
"""
The times that `index` writes at the end of the log. A build with
no optimize step reports only its total, because then loading is
the whole build rather than one phase of it.
"""
durations = {}
for label in ("Load time", "Optimize time", "TOTAL time"):
match = re.search(rf"{re.escape(label)}:\s*(\d+)s", log_text)
if match:
durations[label] = float(match.group(1))
if "Optimize time" not in durations:
durations.pop("Load time", None)
return durations
Loading
Loading