Skip to content

fix(sparql-anything): accept an empty output as no triples unless --load could not be checked - #836

Merged
ddeboer merged 1 commit into
mainfrom
fix/all-filtered-chunk
Sep 10, 2026
Merged

fix(sparql-anything): accept an empty output as no triples unless --load could not be checked#836
ddeboer merged 1 commit into
mainfrom
fix/all-filtered-chunk

Conversation

@ddeboer

@ddeboer ddeboer commented Sep 8, 2026

Copy link
Copy Markdown
Member

convert() rejected any process whose --output was empty, on the assumption that SPARQL Anything exits 0 whenever it cannot read an input. A chunk whose rows the query filters out entirely writes a 0-byte output too, and was then reported as an unreadable input, aborting the run.

Measured on v1.2.0 and v1.2.0-RC1, the assumption is narrower than that. A missing or unparseable chunk makes SPARQL Anything exit 1, which the converter already turns into a failed run. The one input it does not fail on is --load: a missing file is logged, the query runs without the data, and the exit code is 0. A query that reads only loaded data (the GeoNames ontology job) then writes an empty output, indistinguishable from a query whose FILTER matched nothing.

So the converter now checks the one file that matters, once per job and before any process starts:

  • A relative load path is relative to workDir for the task runner and the converter alike, so a missing or empty one fails then, naming the file.
  • An absolute load path is the runner’s – under a container’s mount, say – and one the converter cannot find on its own side proves nothing, so the job runs and an empty output from it still fails.
  • Every other empty output is accepted as “no triples” and contributes nothing to the concatenation. A missing output file still fails.

Chunks are not checked: SPARQL Anything fails on them itself, and a 0-byte chunk still yields the Facade-X root. The earlier rule that a job without chunks could never produce an empty output is gone as well; it encoded what one caller’s query happens to return.

Docs updated under “Loading existing RDF” and “How a conversion runs”.

Fix #820

@ddeboer
ddeboer force-pushed the fix/all-filtered-chunk branch from 0ef4c6a to cc84d95 Compare September 9, 2026 17:09
…oad could not be checked

- A missing or unparseable chunk makes SPARQL Anything exit non-zero, which
  already aborts the run; only a missing --load file exits 0, and then a
  query that reads only loaded data writes an empty output
- Check each job’s load file once, before any process runs: a relative
  path resolves against workDir on both sides, so a missing or empty one
  fails there, naming the file
- Accept an empty output as no triples, unless the job’s load is an
  absolute path this process cannot see; a missing output still fails
- Drop the chunkless-job rule, which encoded one caller’s query
@ddeboer
ddeboer force-pushed the fix/all-filtered-chunk branch from cc84d95 to 09422dd Compare September 10, 2026 08:57
@ddeboer ddeboer changed the title fix(sparql-anything): accept an empty output from a readable, non-empty chunk fix(sparql-anything): accept an empty output as no triples unless --load could not be checked Sep 10, 2026
@ddeboer
ddeboer merged commit 3223bca into main Sep 10, 2026
4 checks passed
@ddeboer
ddeboer deleted the fix/all-filtered-chunk branch September 10, 2026 11:12
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.

sparql-anything: an all-filtered chunk is reported as an unreadable input

1 participant