Brick: SHACL syntax validation fails for sh:or with "Value does not have shape shsh:ListShape"

After having issues with trying to import brick.ttl into engines like Stardog I ran brick.ttl (version 1.4.1) through the SHACL shape validator at https://www.itb.ec.europa.eu/shacl/shacl/upload (against the “Core W3C syntax rules”). This reports 160 errors with the message:

Value does not have shape shsh:ListShape
Test: [Value] - [https://brickschema.org/schema/BrickShape#NumericValue]
Location: [Result path] - [http://www.w3.org/ns/shacl#or

This is also an error that the Stardog Studio Text Editor reports and that seems to break the Stardog import.

Further research led me to https://www.w3.org/TR/shacl/#OrConstraintComponent which AFAICT requires a list syntax for the values.

Can you confirm my assumption that this is a bug that should be fixed?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Hi @gtfierro

Having looked into this I believe there is a misunderstanding here. When you say that different SHACL processors don’t complain about the Brick shapes, this is when you are using the Brick shapes to validate a graph. This is also what you did in the TopQuadrant PoC that you shared:

shaclvalidate.sh -datafile Brick.ttl

What you did here is the same as using our generic RDF validator at https://www.itb.ec.europa.eu/shacl/any/upload, if you supply both for the content to validate and the shapes to use the Brick shapes. The validation report when comparing the TopQuadrant CLI result and our RDF validator are identical which is not surprising given that internally our validator also uses the TopQuadrant implementation (albeit through Java).

This brings me to the initial issue raised by @jaehnigen-kp, who said he used the Brick shapes with our SHACL shape validator at https://www.itb.ec.europa.eu/shacl/shacl/upload with the “Core W3C syntax rules” (note that this is a different validator than the one I mentioned above). This validator does not validate a graph using the Brick shapes; it rather considers the Brick shapes as the input to validate and validates them against the shapes of the configured profiles. The “Core W3C syntax rules” mentioned are the ones listed in https://www.w3.org/TR/shacl/#shacl-shacl in Section C, “SHACL Shapes to Validate Shapes Graphs”. If you take the listed shapes from there, save them in say core_shapes.ttl and use them to validate the Brick shapes (shaclvalidate.sh -datafile Brick.ttl -shapesfile core_shapes.ttl), you will see 160 errors exactly as @jaehnigen-kp mentioned, and matching what our SHACL shape validator reports:

  sh:result    [ rdf:type                      sh:ValidationResult;
                 sh:focusNode                  [] ;
                 sh:resultMessage              "Value does not have shape shsh:ListShape";
                 sh:resultPath                 sh:or;
                 sh:resultSeverity             sh:Violation;
                 sh:sourceConstraintComponent  sh:NodeConstraintComponent;
                 sh:sourceShape                _:b0;
                 sh:value                      bsh:NumericValue
               ];

So, to summarise, the issue at hand is that the Brick shapes fail validation against the published core shapes at https://www.w3.org/TR/shacl/#shacl-shacl (irrespective of our validator). You could choose to address this or not in the Brick shapes but at least you should investigate further and see if a fix is needed.

@gtfierro This version fully validates against the Core W3C rules in @costas80 validator: grafik I’ll see if that also shows improvements in Stardogs validation and be back in a separate issue if there is proper evidence to follow up. Thank you both for your great support, I learned quite a bit in the process!

Hi @costas80

Here is a short script which downloads the latest Brick and runs it through the TopQuadrant validation. I have not been able to replicate the SHACL error mentioned by @jaehnigen-kp except on the Interop TestBed site. There are a couple errors here but they mostly have to do with missing imports which shouldn’t be relevant to the error.

wget https://repo1.maven.org/maven2/org/topbraid/shacl/1.4.3/shacl-1.4.3-bin.zip
unzip shacl-1.4.3-bin.zip
pushd shacl-1.4.3
export SHACLROOT=`pwd`/bin
export PATH=$SHACLROOT:$PATH
chmod +x $SHACLROOT/*.sh
wget https://brickschema.org/schema/1.4.1/Brick.ttl
shaclvalidate.sh -datafile Brick.ttl

Hi @gtfierro. I’m the team leader of the Interoperability Test Bed, the service that operates the SHACL shape validator at https://www.itb.ec.europa.eu/shacl/shacl/upload. We got your email but I thought it better to continue the discussion here for full visibility.

The validator in fact is a web app built over the TopQuadrant implementation (the validator is also mentioned in the TopQuadrant README as a reference). As such I’m surprised when you say that using the TopQuadrant library doesn’t report the same problems. Do you have a simple PoC (e.g. Git repo) you use for the validation that I could use to replicate and compare?