Running specific SHACL shapes via the SPARQL SERVICE

Hi,

Does anyone know if it’s possible to run specific SHACL shapes via the ‘validate SPARQL service’ (SERVICE icv:validate - as documented here Data Quality Constraints | Stardog Documentation Latest)?

The guidance online seems to indicate that the only option is to separate my shapes into different graphs and then use the icv:shapesGraph input (but this feels a bit like a workaround).

For more context, I’m trying to emulate the SPARQL ‘VALIDATE’ function as in: VALIDATE ALL USING SHAPES shacl:shape_1 . My goal is to capture the validation output of a one or two shapes directly into a graph, hence the preference of using SPARQL over a CLI command.

Any help will be greatly appreciated. Thanks

Hey Jonathan,

indeed, you may supply the shape IRI via the icv:shapeparameter:

select distinct * {
service icv:validate {
[]
icv:dataGraph data: ;
icv:shapesGraph shapes: ;
icv:shape shapes:shape_1 ;
icv:resultSeverity ?severity ;
icv:resultMessage ?message ;
icv:focusNode ?focusNode ;
icv:resultPath ?path ;
icv:value ?valueNode ;
}
}
order by ?focusNode ?path

Cheers
Jaro

1 Like