RDFUnit
RDFUnit copied to clipboard
SHACL support
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 inSELECT ?this (<a> AS ?path) WHERE {...}
is not yet supported (planned to be). what can be done instead for now isSELECT ?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))
:+1:
awesome, good work
:+1:
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
Great, we will try it out!
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?
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
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
Great, thanks for the update!