AKSW / RDFUnit

An RDF Unit Testing Suite
http://RDFUnit.aksw.org
Apache License 2.0
150 stars 40 forks source link

declaration of 'partial' constraint components #68

Closed neradis closed 7 years ago

neradis commented 7 years ago

The way the min-count cardinality constraint is currently implemented, there are two separate instances of sh:ConstraintComponent, there are cases when only for one or for none of the two the defined validator is applicable. Currently, the ConstraintFactory throws a warning that no validators can be found, but here it seems sound to have non-total constraint components, for which a query for validation has to be only executed for some values of sh:minCount (i.e. no checks at all have to take place if sh:minCount is non-positive).

As there might be further cases for this for other constraint types, I suggest introducing another custom shacl-ext property shr:partial:

sh:MinCountConstraintComponent
    a sh:ConstraintComponent ;
    shr:partial "true"^^xsd:boolean ;
    [...]

This will inform RDFUnit that is can safely accept that no applicable validator can be found for this component without generating errors/warnings.

neradis commented 7 years ago

I pushed commit implementing the suggestion to the branch issue-68-partial-constraint-components

jimkont commented 7 years ago

made a pull request and merged your branch, thanks @neradis !