Test failures cannot distinguish advisory SHACL results (sh:Warning / sh:Info) from sh:Violation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Start in ogc/bblocks/validation/rdf.py at shacl_validate and trace how the validator options and ValidationReportEntry are exposed through the CLI or bblocks-config.yaml. Verify the advisory-severity behavior against the reported pySHACL cases, while preserving warnings in reports and generated docs. Clarify whether the empty uplift output behavior is part of this issue before considering that work done.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Test failures cannot distinguish advisory SHACL results from violations
Summary
bblocks-postprocess marks a building block's test as failed whenever pySHACL
reports conforms == False. pySHACL sets that for a result of any severity,
so a block that emits only sh:Warning or sh:Info is reported identically to
one that emits sh:Violation.
The effect on a register that uses advisory shapes deliberately is that it can
never be green, and "the build is red" stops carrying information.
Evidence from a real register
In the CDIF register (93 blocks), the postprocessor reports 22 failures. Across
every failing item:
| severity | results |
|---|---|
sh:Warning |
134 |
sh:Info |
31 |
sh:Violation |
0 |
Not one violation in the register. Blocks are failed for emitting advice they
were written to emit, e.g.
for cdi InstanceVariable a physical data type should be provided.
20 of the 22 failures are advisory-only. (Of the remaining two, one was a genuine
bug in our own SHACL, now fixed; the other is item 2 below.)
Where it happens
ogc/bblocks/validation/rdf.py:
def shacl_validate(g, s, ont_graph=None):
validator = pyshacl.Validator(g, shacl_graph=s, ont_graph=ont_graph, options={
'advanced': True
})
...
conforms, shacl_result, shacl_report = validator.run()
and then
if not shacl_conforms:
shacl_errors_found = True
report.add_entry(ValidationReportEntry(
...
is_error=not shacl_conforms,
There is no severity filter, and no CLI option or bblocks-config.yaml key
exposes one.
Proposed fix
pySHACL already supports this natively via allow_warnings, which excludes
sh:Warning and sh:Info from the conforms verdict while still reporting
them. Verified against one of the failing cases above:
options={'advanced': True} -> conforms=False results={'Warning': 1}
options={'advanced': True, 'allow_warnings': True} -> conforms=True results={'Warning': 1}
So the change is to pass the option through and expose it, e.g.
--shacl-allow-warnings (and/or a shacl: allow-warnings: true key in
bblocks-config.yaml), defaulting to the current behaviour so nothing changes
for existing registers.
The warnings would still appear in the report and the generated docs - only the
pass/fail verdict changes.
Related: empty uplift output is also a hard failure
A second case with the same shape. An example that is a legitimate bare
{"@id": "..."} reference cannot produce any triples - that is what a node
object with no properties means in JSON-LD - but the uplift step reports
Empty output Turtle example_1_1.ttl created
as an error, failing the block. In our register this is the documented example
for "SKOS concept by URI reference", pointing at a published NERC vocabulary
term; it is correct, and deleting it to get a green build would remove the
documentation of the most common usage of that block.
Suggest this be a warning rather than an error, or suppressed when the source
document is a bare reference.
Why it matters
Both cases fail the same way: a check that cannot tell "broken" from "benign".
In our register the practical consequence was that a genuinely broken composite
profile - a rules.shacl referencing three shapes it did not define, which made
pySHACL reject the file and caused all five of that block's items to fail,
including its requireFail negative tests - sat unnoticed among 21 failures that
did not matter.
With allow_warnings plus that one real fix, the register would go from 22
failing blocks to 1.
🤖 Drafted with Claude Code, reviewed by SMR
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 6
- Merge medio
- 1m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opengeospatial/bblocks-postprocess
-
if no bblocks highlighted, assume all are.Forse già presa @avillar l’ha presa oggi. Aperta
opengeospatial/bblocks-postprocess#96 · 1 commento · 1 assegnatario ·
-
Annotate output is not reproducible: properties[] order varies between runs on identical sourcesForse già presa @avillar l’ha presa 11 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
opengeospatial/bblocks-postprocess#91 · 1 commento · 1 assegnatario ·
-
JSON schema library version review.Forse già presa @avillar l’ha presa 18 giorni fa. Aperta
opengeospatial/bblocks-postprocess#89 · 3 commenti · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
opengeospatial/bblocks-postprocess#86 · 2 commenti ·
Tutte le issue di opengeospatial/bblocks-postprocess
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
eclipse-score/inc_someip_gateway#356 ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG]: `GitHubRestAdapter.check_user_permission` and `has_write_access` raise `TypeError` (missing `params`), silently disabling the inactivity lifecycleForse già presa @tarunagnihotri534 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
AOSSIE-Org/Gitcord-GithubDiscordBot#167 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
mihai-vlc/sublime-jsfmt#56 ·
-
comp/cli comp/plugins P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NousResearch/hermes-agent#141917 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
riscv/riscv-opcodes#441 ·