Skip to content

Add Oxigraph as the first engine of qeval - #328

Open
tanmay-9 wants to merge 100 commits into
qlever-dev:mainfrom
tanmay-9:qeval-oxigraph
Open

tanmay-9 wants to merge 100 commits into
qlever-dev:mainfrom
tanmay-9:qeval-oxigraph

Conversation

@tanmay-9

@tanmay-9 tanmay-9 commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

With this change, the whole workflow that qlever provides for QLever is available for Oxigraph via qeval oxigraph: setup-config, get-data, index, index-stats, start, status, log, query, stop, and benchmark-queries. The dataset configs are the same ones as for QLever (qeval oxigraph setup-config olympics, which writes a Qleverfile with only the parameters that Oxigraph knows), and everything works both natively, with oxigraph-cli on the PATH, and in a container with docker or podman.

The Qleverfile has a few Oxigraph-specific parameters: READ_ONLY and LENIENT, INDEX_BINARY and SERVER_BINARY (both oxigraph by default), and EXTRA_ARGS for the index and the server, which is appended to the command line verbatim, so that options not covered by the Qleverfile can still be used. With READ_ONLY = yes (the default), the index build compacts the store with oxigraph optimize after loading and the server runs serve-read-only. TIMEOUT accepts a unit like 60s or 5min as for QLever and is passed on as --timeout-s; older Oxigraph versions do not have that option, in which case the command says that the timeout is ignored instead of failing to start.

As for QLever, qeval oxigraph index-stats reads the phase times from the index log. Oxigraph's own output is not usable for that, though: its progress output is unreliable and it does not always print a final summary line. So qeval oxigraph index measures the load and the optimize phase itself and appends them, with the total, to the index log, which is also where the shaded phases of the plot come from. The index build records RSS and CPU usage and renders the resource-usage plot just like qlever index does, with the Oxigraph version in the subtitle.

Almost all of this is a thin layer on top of the existing qlever commands (mostly a different endpoint, a different process name, or a different way to find the server), and the classes are written so that the engines still to come can use them as their base rather than the QLever ones.

Also, a new end-to-end test runs the complete sequence from setup-config to stop on the olympics dataset, for all three of native, docker, and podman, and checks that the resource-usage log and plot are actually produced.

tanmay-9 and others added 17 commits August 15, 2026 15:51
@tanmay-9 tanmay-9 changed the title Qeval oxigraph Add Oxigraph as the first engine of qeval Aug 18, 2026
So far, `BaseStopCommand` returned `False` without a message when the
Qleverfile says that the server runs in a container and no container with
the configured name exists, so `qeval <engine> stop` exited with status 1
after the line "Checking for container with name ..." and nothing else.
Now it reports the missing container, like QLever's `stop` reports a
missing process or container.
…graph start --run-in-foreground`, with a warning if it is already gone
hannahbast pushed a commit that referenced this pull request Nov 20, 2026
… the resource-usage plot code (#327)

Since #305, the QLever binaries sample their own RSS memory and CPU usage and write the resource-usage log themselves, so the Python-side sampler was removed. The other engines of `qeval` do not write such a log, so they need a sampler on the Python side. The plot code so far also only described a QLever index build, since the shaded phase bands and the subtitle come from the QLever index log.

With this change, `qeval/resource_monitor.py` provides that sampler. It wraps the index command of an engine and writes a log with the columns that the plot needs (`elapsed_s`, `rss`, `cpu_percent`), by following the index process natively or with `docker stats` or `podman stats` in a container. The plot code is shared by all engines. Only the shaded bands and the subtitle differ per engine, and an engine passes its own `engine_overlay` and `engine_subtitle` functions to `render_usage_plot_if_installed` in the new `qlever/resource_usage/plot_util.py`. Without them, the plot describes a QLever index build, so `qlever index` works as before. `plot_util.py` can be imported without `matplotlib` and `numpy`, so the plotting libraries stay optional for every engine.

The log and the plot files of a non-QLever engine are prefixed `<dataset>.<engine>`, so that it is clear which engine a file belongs to. QLever keeps the plain `<dataset>` prefix, since its own binaries write that log.

On the side, the two helpers in `qlever/util.py` that only the sampler uses moved along with it to `qeval`, and `parse_git_hash` moved next to its only caller in `usage_plot.py`. The shared test fixtures, including the guard against signals to unrelated processes, moved to `test/conftest.py`, so that they also apply to the tests of `qeval`.

NOTE: No engine uses the sampler yet. Oxigraph will be the first one, in #328.
hannahbast pushed a commit that referenced this pull request Nov 20, 2026
So far, `qeval` could only run QLever. Several commands work the same way for every graph database: `status` and `stop` find the server's processes by a regex, `query` and `benchmark-queries` send SPARQL queries to an HTTP endpoint, `index-stats` reports the time and space of the index build, and `setup-config` derives a Qleverfile from one of QLever's pre-configured ones. QLever's versions of these commands already do almost all of the work, so every new graph database would otherwise copy them with small changes, and a fix in one copy would not reach the others. Commands like `index` and `start` are not part of this, because each graph database builds its index and runs its server with its own binaries, options and logs, so there is little to share.
  
With this change, `qeval/base_commands` has one shared version of each of these commands, built on QLever's. A graph database only provides what differs, such as the regex for its processes, its container image and settings, which files hold its index, and how its index log reports the duration of each phase. Where QLever's command needs a different value for another graph database, such as the path of the SPARQL endpoint or the default regex of `status`, it now gets that value from a small method that the shared version overrides, so that no code is copied.
  
On the side, `Qleverfile.filter` now keeps all options of a section for `None` instead of an empty list, and the `qeval` help mentions graph databases instead of engines.

NOTE: No graph database uses the shared commands yet, Oxigraph will follow in a separate change (#328). QLever's commands behave as before.
@hannahbast
hannahbast marked this pull request as ready for review November 20, 2026 14:26
Copilot AI balanced review requested due to automatic review settings November 20, 2026 14:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
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.

3 participants