This document describes the test suite of the Shape Expressions Language.

Initial version

Introduction

The contents are inspired by the RDF test suite.

The tests are available in the folder tests which can also be downloaded as a simple file: tests.tar.gz, tests.zip.

The source code of this project is located in Github

There are four types of tests:

Namespace prefixes

shext
http://www.w3.org/ns/shextest#
mf
http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#

Positive Syntax

These tests contain example of Schema files which can be parsed. They have type shext:PositiveSyntax

Example:

<#a-string-syntax> rdf:type shext:PositiveSyntax ;
   mf:name      "a-string-syntax" ;
   rdfs:comment "Shex Expression with an single arc rule" ;
   shext:status mf:proposed ;
   shext:schema <a-string.shex> ;
   .

Negative syntax

These tests contain examples with bad syntax. They have type shext:NegativeSyntax and their structure is the same as the previous tests.

Valid

These tests contain a reference to a schema (ShEx file) and a reference to a RDF file (turtle file) that can be parsed. They have type shext:Valid.

They also contain a reference to a IRI in the turtle file and a list of shapes that the IRI should have according to the schema.

The tests are considered valid is the system can infer that the IRI has those shapes.

The following example declares a valid test where ex:x has shape ex:a in the turtle file conjunction1.ttl using the schema conjunction.shex

<#conjunction1> rdf:type shext:Valid ;
   mf:name      "conjunction1" ;
   rdfs:comment "conjunction of two arcs" ;
   shext:status mf:proposed ;
   shext:schema   <conjunction.shex> ;
   shext:instance <conjunction1.ttl> ;
   shext:iri      ex:x ;
   shext:shape 	  ex:a 
   .

Not valid

These tests contain schemas and RDFs that can be parsed. They also refer to a IRI which is part of the RDF graph but has no valid shape in the schema.

These tests have type shext:NotValid

Example:

<#conjunction1> rdf:type shext:NotValid ;
   mf:name      "conjunction2" ;
   rdfs:comment "conjunction of one arc fails" ;
   shext:status mf:proposed ;
   shext:schema   <conjunction.shex> ;
   shext:instance <conjunction2.ttl> ;
   shext:iri      ex:x 
   .