The document describes the SHACL Test-Suite, which provides a framework for testing SHACL shape schemas and validators. The test-suite structure includes a main manifest file that includes other test folders, each with their own manifest. Manifest files follow the W3C standard practice and describe test entries that validate data against schemas, match nodes to shapes, and test schema formatting. The test-suite is available online and on GitHub, and the working group is seeking contributions to expand the included tests.
3. Structure of test-suite
Main folder
manifest.ttl => Includes other folders
Several folders with one or more manifest files
tests
tests/example
tests/simple
tests/algebra
4. Manifest file
Follows W3c standard practice
Examples: RDF Test Suite, Data Access WG
<> a mf:Manifest ;
rdfs:label "Manifest Example file" ;
mf:entries (<entry1> # ... ) .
<entry1> a sht:Validate ;
mf:name "Validate simple RDF data" ;
mf:action [
sht:schema <example-schema.shc> ;
sht:schema-format sht:SHACLC ;
sht:data <example-data.ttl> ;
sht:data-format sht:TURTLE ;
] ;
mf:result true ;
mf:status sht:proposed
.
6. Manifest Entries
<ManifestEntry> {
a ( # Possible types of tests
sht:Validate # Validate data with a schema
sht:MatchNodeShape # Match a node with a shape
sht:WellFormedSchema # Well formed schema
sht:NonWellFormedSchema # Non well formed schema
sht:ConvertSchemaSyntax # Convert between different schema syntaxes
)
, mf:name xsd:string? # Optional name of this entry
, mf:action @<ManifestAction> # Action to perform
, mf:result . # The expected outcome
, mf:status (
sht:proposed # A test that has been proposed
sht:approved # A test that has been accepted
sht:rejected # A test that has been rejected
)
}
7. Manifest Actions
<ManifestAction> {
sht:schema IRI ?
, sht:schema-format ( sht:SHACLC sht:TURTLE) ?
, sht:data IRI ?
, sht:data-format (sht:TURTLE ) ?
, sht:schema-output-format ( sht:SHACLC sht:TURTLE ) ?
, sht:schema-output IRI ?
, sht:node IRI ?
, sht:shape IRI ?
}
8. Schema format
Conversion between Turtle and Compact format
http://rdfshape.herokuapp.com
Example:
Compact Syntax TURTLE http://goo.gl/xEsVzZ
TURTLE Compact Syntax http://goo.gl/Y7GOGB
9. Conclusions
The test-suite framework is available
Web page:
http://w3c.github.io/data-shapes/data-shapes-test-suite/
Github:
https://github.com/w3c/data-shapes/tree/gh-pages/data-shapes-test-suite
We were waiting for the language constructs to
be stable but we may start to add more tests
10. Questions for the WG
Process to add tests
Adapt from existing tests:
http://shexspec.github.io/test-suite/
Eric's tests
Other contributions?
Other types of tests?
Tests about error messages?
Tests about extension conditions?