Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phantom resullt details #125

Closed
giacomociti opened this issue Mar 28, 2024 · 1 comment · Fixed by #128
Closed

phantom resullt details #125

giacomociti opened this issue Mar 28, 2024 · 1 comment · Fixed by #128

Comments

@giacomociti
Copy link
Contributor

For certain violations, the report includes completely unrelated result details.

repro:

# shapes
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix ex: <https://example.org/> .

ex:personShape a sh:NodeShape ;
	sh:targetClass ex:Person ;
	sh:property [
		sh:path ex:address ;
		sh:message "ex:city should be sh:IRI" ;
		sh:node [
			sh:path ex:city ;
                        sh:nodeKind sh:IRI
		] ;
	] .

ex:sizeShape 
	sh:targetObjectsOf ex:size ;
	sh:or (
                [ sh:hasValue ex:small ]
		[ sh:hasValue ex:big ]
	) .
# data
@prefix ex: <https://example.org/> .

ex:person1 a ex:Person ; ex:address ex:address1 .

ex:address1 ex:city "London" .

ex:tv ex:size ex:big .

A phantom violation:

    sh:focusNode <https://example.org/big> ;
    sh:resultMessage "Value must be <https://example.org/small>" ;

appears as a detail of the correct main violation ("ex:city should be sh:IRI" ).

Notice that the phantom result disappears if we swap small and big in the shape. Likely it is a temporary result of the sh:or evaluation, which should be discarded as soon as the second alternative satisfies the constraint.

Also worth noting that the phantom result is not there if we fix the main issue ("ex:city should be sh:IRI" ).

@giacomociti
Copy link
Contributor Author

maybe this is a better repro https://s.zazuko.com/2t87BAk, the previous one was a shape not conformant to shacl-shacl

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 a pull request may close this issue.

1 participant