Closed aidig closed 2 years ago
Another way would be to convert the mandatory controlled vocabularies into shacl lists and then use sh:in
.
Both ways would be better than checking for the class, since even if a SHACL validator would follow the IRI for the language, it would fail:
http://publications.europa.eu/resource/authority/language/DAN doesn't have the class dct:LinguisticSystem
.
All good suggestions.
For a complete solution, the following requirements should be checked:
Maybe we need to differentiate:
If it is allowed to use others but one is obligitatory, the SHACL rule has to be constructed in a way, that at least one of the values has to use the obligitatory vocabulary.
The DCAT-AP SHACL validator https://www.itb.ec.europa.eu/shacl/dcat-ap/upload provides an option to validate solely the membership of values in a controlled vocabulary. The configuration of the validator can be found at https://github.com/ISAITB/validator-resources-dcat-ap. This configuration refers to the SHACL template file https://github.com/SEMICeu/DCAT-AP/blob/2.1.0-draft/releases/2.1.0/dcat-ap_2.1.0_shacl_mdr-vocabularies.shape.ttl In there for each possible controlled vocabulary that we are able to validate by reusing the source representation, a shacl shape constraint is expressed. This expression is one of the possible ways to express the constraint.
Ref: https://github.com/SEMICeu/DCAT-AP/blob/master/releases/2.0.0/dcat-ap_2.0.0_shacl_shapes.ttl
Regarding the validation of the use of controlled vocabularies, might it be an idea to implement the constraints as SHACL patterns instead of the current method requiring the presense of the range class in the data graph. (One example - of many - line 392)
For the the property dct:language, the DCAT-AP specification states that The EU Authority Table Languages MUST be used (URI: http://publications.europa.eu/resource/authority/language), - Ch 5 Controlled Vocabularies - and perhaps the sh:pattern property could be used to verify the URI structure as suggested by Andrea Perego (https://github.com/SEMICeu/dcat-ap_shacl/wiki/Rules-of-Thumb, it does state that this is a slow process, but still..)
Suggestion (using the above property as an example)
Thus validating the use of controlled vocabularies in this example (a slightly amended version of DCATs basic example for EU use):
(Related issue 'shacl - Background knowledge for validation': https://github.com/SEMICeu/DCAT-AP/issues/125)