Skip to content

Add option --encode-as-id-wide - #331

Open
hannahbast wants to merge 3 commits into
mainfrom
encode-as-id-wide
Open

Add option --encode-as-id-wide#331
hannahbast wants to merge 3 commits into
mainfrom
encode-as-id-wide

Conversation

@hannahbast

@hannahbast hannahbast commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Add support for the --encode-as-id-wide option of the QLever index builder, which encodes IRIs with up to 17 digits directly in the ID. In the Qleverfile, write ENCODE_AS_ID_WIDE, analogous to the existing ENCODE_AS_ID.

This change complements ad-freiburg/qlever#3278, which adds the option on the engine side. Without it, an ENCODE_AS_ID_WIDE line is silently ignored and the index is built with narrow encoding only.

This complements ad-freiburg/qlever#3278. In the Qleverfile, write
`ENCODE_AS_ID_WIDE`.
The new option was missing from the expected argument list and from the
mocked arguments, so three tests saw a `MagicMock` instead of `None` and
passed it on to the index command.
Copilot AI lite review requested due to automatic review settings August 25, 2026 22:21
@hannahbast hannahbast changed the title Encode as id wide Add option --encode-as-id-wide Aug 25, 2026

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.

Pull request overview

Adds support for a new index-building option (--encode-as-id-wide) and wires it through the QLeverfile configuration and the qlever index command execution path.

Changes:

  • Introduces a new QLeverfile/index argument: encode_as_id_wide (--encode-as-id-wide).
  • Passes --encode-as-id-wide through to the generated qlever-index command line.
  • Updates unit tests to include the new argument in expected argument sets and mocked args.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/qlever/commands/test_index_other_methods.py Extends expected relevant QLeverfile arguments with encode_as_id_wide.
test/qlever/commands/test_index_execute.py Extends mocked args in execute tests to include encode_as_id_wide.
src/qlever/qleverfile.py Adds --encode-as-id-wide to the index-related QLeverfile/CLI argument definitions.
src/qlever/commands/index.py Adds encode_as_id_wide to relevant QLeverfile arguments and appends the flag to the constructed index command.
Suppressed comments (1)

test/qlever/commands/test_index_execute.py:390

  • There is no test that asserts how encode_as_id_wide affects the generated index command. Adding a value with a space-separated prefix list here would catch both the presence of the flag and correct shell-quoting behavior.
        args.encode_as_id_wide = None
        args.parser_buffer_size = None
        args.materialized_views = None
        args.resource_usage_log = "yes"
        args.resource_usage_interval = 1

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 294 to +297
if args.encode_as_id:
index_cmd += f" --encode-as-id {args.encode_as_id}"
if args.encode_as_id_wide:
index_cmd += f" --encode-as-id-wide {args.encode_as_id_wide}"
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.

2 participants