RDFUnit icon indicating copy to clipboard operation
RDFUnit copied to clipboard

SHACL support

Open jimkont opened this issue 9 years ago • 9 comments

This issue tracks SHACL support in RDFUnit

Scopes

  • [x] sh:targetNode
  • [x] sh:targetClass
  • [x] sh:targetSubjecsOf
  • [x] sh:targetObjects

SHACL Core Constraint Components

  • [x] sh:class
  • [x] sh:datatype
  • [x] sh:nodeKind
  • [x] sh:minCount
  • [x] sh:maxCount
  • [x] sh:minExclusive
  • [x] sh:minInclusive
  • [x] sh:maxExclusive
  • [x] sh:maxInclusive
  • [x] sh:minLength
  • [x] sh:maxLength
  • [x] sh:pattern
  • [x] sh:languageIn (does not yet match cases like @en / @en-us, only works for exact matches for now)
  • [x] sh:uniqueLang
  • [x] sh:equals
  • [x] sh:disjoint
  • [x] sh:lessThan
  • [x] sh:lessThanOrEquals
  • [x] sh:not
  • [x] sh:and (partial support in top-level sh:and constraints)
  • [x] sh:or
  • [x] sh:xone
  • [x] sh:node
  • [x] sh:property
  • [ ] sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount
  • [x] sh:closed, sh:ignoredProperties
  • [x] sh:hasValue
  • [x] sh:in

SPARQL-based Constraints

  • [x] Almost fully supported
    • [ ] shapesGraph prebinding is not supported
    • [ ] currentShape prebinding is not supported
    • [ ] projection expressions in SPARQL queries are not yet supported e.g. the path variable in SELECT ?this (<a> AS ?path) WHERE {...} is not yet supported (planned to be). what can be done instead for now is SELECT ?this ?path WHERE { BIND(<a> AS ?path) ...}

SPARQL-based Constraint Components

  • [x] Supported
    • [ ] noticed some strange behavior in complex ASK-based validators and node constraints that is investigated. simple ASK-based validators that contain only a filter clause are well supported.

Actually, all of the supported SHACL-Core is defined in this document which are SPARQL-based Constraint Components

Some pre-binding corner cases are not covered yet and are under development (see implementation report (to be submitted soon))

jimkont avatar Feb 15 '16 19:02 jimkont

:+1:

akuckartz avatar Feb 15 '16 20:02 akuckartz

awesome, good work

chile12 avatar Feb 20 '16 10:02 chile12

:+1:

nandana avatar Feb 10 '17 15:02 nandana

Hi, for those following this issue (cc/ @akuckartz , @nandana , @chile12 , @gcpdev, @seebi) the description is now updated to the latest SHACL support from RDFUnit. Thanks to @neradis an implementation report will be submitted soon and a new artifact will be published to maven central after some polishing. Until then, you can use latest master branch for testing.

Any feedback / bug reports are more than welcome

jimkont avatar Aug 19 '17 14:08 jimkont

Great, we will try it out!

tomas-knap avatar Aug 21 '17 08:08 tomas-knap

Hi @jimkont, great meeting you at Semantics! I had a look at RDF Unit & SHACL & found this issue. Is this still representing the level of the current implementation? This is great but I think I won't get around logical constraints at some point, any plans in that regard?

ktk avatar Sep 25 '23 15:09 ktk

Hi @ktk , great meeting you in person as well. IIRC logical constraints were (fully?) implemented but cannot recall about qualified shapes. It has been a while but can try regenerating the implementation report and check which tests fail and you can take a look and judge based on that

jimkont avatar Sep 25 '23 17:09 jimkont

So, I rerun the SHACL test suite and the results are improved compared to the submitted compliance report. As an aggregate there are: tests passed: 73, failed: 10 and partial: 37 (errors detected but there is some mismatch in the exact expected reporting). The failing ones are mainly related to prebinding and qualified cardinality, here's the full list rdfunit-shacl-earl.ttl.zip

If you decide to try it out, you might want to use the aggregate reports when testing SPARQL endpoints directly. The results in that mode are much more useful to process than individual instance errors, especially when you expect a lot of violations

jimkont avatar Sep 25 '23 19:09 jimkont

Great, thanks for the update!

ktk avatar Sep 26 '23 19:09 ktk