11institutetext: Nuance Communications
11email<EMAIL_ADDRESS>
# ASHACL: Alternative Shapes Constraint Language

Peter F. Patel-Schneider

###### Abstract

ASHACL, a variant of the W3C Shapes Constraint Language, is designed to
determine whether an RDF graph meets some conditions. These conditions are
grouped into shapes, which validate whether particular RDF terms each meet the
constraints of the shape. Shapes are themselves expressed as RDF triples in an
RDF graph, called a shapes graph.

##  1 Introduction

As of February 2017 the W3C Shapes Constraint Language (SHACL) [5] is under
development by the W3C Data Shapes Working Group. The design document for
SHACL, Shapes Constraint Language (SHACL), as of this time is available at
https://www.w3.org/TR/2017/WD-shacl-20170202/

SHACL is divided into two parts, SHACL Core and SHACL-SPARQL.

SHACL Core has two separate specifications; a complete normative specification
in text and a partial informative specification as a mapping to an extension
of SPARQL [4]. The specification via a mapping to SPARQL uses a version of
pre-binding defined in SHACL. The use of pre-binding has caused continual
problems in SHACL. Sometimes the definition of pre-binding produces many
constructs whose mapping specification diverges from the text specfication.
Sometimes, including now, the definition of pre-binding has problems making it
unsuitable for use in all or part of SHACL. The text specification of SHACL
Core suffers from a lack of rigour, resulting in a specification that can be
read in multiple ways.

SHACL-SPARQL depends on a mapping to SPARQL that has the same problems as the
partial mapping for SHACL Core but the mapping is normative for SHACL-SPARQL.

The syntax of SHACL Core is unnecessarily complex and fragile. Certain
constructs can be used in some places but not in other very simlar places.
There are constructs that are limited versions of other constructs. There are
multiple influences on how certain constructs behave.

This document contains a specification for ASHACL, an alternative version of
the validating portion of SHACL Core using many parts of the specification of
SHACL Core [5].

The major syntax difference between ASHACL and the current version of SHACL
Core is to unify the various kinds of shapes in SHACL Core into a single
notion of a shape. The single property sh:path then controls how to determine
value nodes. This results in a simpler and more uniform language.

Another significant difference is how validation results and reports are
defined. This eliminates the problematic procedural dependencies in SHACL Core
and correctly specifies what needs to be contained in a validation report.

A third significant difference is the removal of the informative SPARQL
specifications for many SHACL Core constructs. This eliminates the informative
dependency on pre-binding as well as removing a source of divergence in the
specification.

The specification of ASHACL here is in text form with dependence on only a few
SPARQL functions. The specification of ASHACL here has been carefully
constructed to be precise and well-defined, eliminating the problems with
imprecise and poorly constructed parts of the current specification of SHACL.

Because ASHACL is a variant of SHACL, much of the desgin of ASHACL here is
taken fromd SHACL [5]. Some of the wording here has as source wording in
Shapes Constraint Language (SHACL) [5].

##  2 Examples

Here are several simple informative examples of ASHACL shapes graphs along
with English glosses of what they do.

Check that all ASHACL instances of ex:Person have all their values for
ex:child be ASHACL instances of ex:Person.

    @prefix sh:   <http://example.org/ns/shacl\#> .
    @prefix ex:   <http://example.org/example/> .
    ex:s a sh:Shape ;
      sh:targetClass ex:Person ;
      sh:shape [ sh:path ex:child ;
                 sh:class ex:Person ] .

Check that all ASHACL instances of ex:Person have all their values for
ex:child be ASHACL instances of ex:Person, using only one shape.

    @prefix sh:   <http://example.org/ns/shacl\#> .
    @prefix ex:   <http://example.org/example/> .
    ex:s a sh:Shape ;
      sh:targetClass ex:Person ;
      sh:path ex:child ;
      sh:class ex:Person .

Check that all subjects and objects of ex:parent RDF triples are ASHACL
instances of ex:Animal.

    @prefix sh:   <http://example.org/ns/shacl\#> .
    @prefix ex:   <http://example.org/example/> .
    ex:s a sh:Shape ;
      sh:targetSubjectsOf ex:parent ;
      sh:targetObjectsOf ex:parent ;
      sh:class ex:Animal .

##  3 Basic Terminology

Throughout the remainder of this document, IRIs are written as Turtle [6]
prefixed names, using the following mapping of prefixes to namespaces:

Prefix | Namespace
---|---
xsd | http://www.w3.org/2001/XMLSchema#
rdf | http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs | http://www.w3.org/2000/01/rdf-schema#
owl | http://www.w3.org/2002/07/owl#
sh | http://example.org/ns/shacl#

Terminology that is linked to portions of RDF 1.1 Concepts and Abstract Syntax
[2] is used in ASHACL as defined there. Terminology that is linked to portions
of SPARQL 1.1 Query Language [4] is used in ASHACL as defined there. A single
linkage is sufficient to provide a definition for all occurrences of a
particular term in this document.

Definitions are complete within this document, i.e., if there is no rule to
make a some situation true in this document then the situation is false.
Definitions, or partial definitions, have the phrase being defined in bold.
Some definitions are dispersed throughout the document. For these terms each
portion of the definition has the phrase being defined in bold.

Property:

A property is an https://www.w3.org/TR/rdf11-concepts/#dfn-iriIRI.

Value:

An https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-termRDF term $n$ has value
$v$ for property $p$ in an https://www.w3.org/TR/rdf11-concepts/#section-rdf-
graphRDF graph $G$ if there is an
https://www.w3.org/TR/rdf11-concepts/#section-triplesRDF triple in $G$ with
https://www.w3.org/TR/rdf11-concepts/#dfn-subjectsubject $n$,
https://www.w3.org/TR/rdf11-concepts/#dfn-predicatepredicate $p$, and
https://www.w3.org/TR/rdf11-concepts/#dfn-objectobject $v$.

An RDF term $n$ has value $v$ for https://www.w3.org/TR/sparql11-query/#pp-
languageSPARQL property path expression $p$ in an RDF graph $G$ if there is a
solution mapping in the result of the SPARQL query SELECT ?s ?o WHERE { ?s
$p^{\prime}$ ?o } on $G$ that binds ?s to $n$ and ?o to $v$, where
$p^{\prime}$ is SPARQL surface syntax for $p$.

Path:

A path in an RDF graph $G$ from RDF term $n$ to RDF term $m$ is a finite
sequence of RDF triples in $G$ such that the subject of the first RDF triple
is $n$, the object of the last RDF triple is $m$, and the object of each RDF
triple except the last is the subject of the next.

ASHACL List:

An ASHACL list in an RDF graph $G$ is an IRI or a
https://www.w3.org/TR/rdf11-concepts/#section-blank-nodesblank node that is
either rdf:nil (provided that rdf:nil has no value for either rdf:first or
rdf:rest in $G$), or has exactly one value for rdf:first in $G$ and exactly
one value for rdf:rest in $G$ that is also an ASHACL list in $G$ and there is
no non-empty path in $G$ from the list back to itself where the predicates of
the RDF triples in the path are each rdf:rest.

The members of any ASHACL list except rdf:nil in an RDF graph $G$ consist of
its value for rdf:first in $G$ followed by the members in $G$ of its value for
rdf:rest in $G$. The ASHACL list rdf:nil has no members in any RDF graph.

ASHACL Instance and ASHACL Type:

An RDF term $n$ is an ASHACL instance of an RDF term $m$ in an RDF graph $G$
if there is a path in $G$ from $n$ to $m$ where the predicate of the first RDF
triple in the path is rdf:type and the predicates of any other RDF triples in
the path are rdfs:subClassOf.

An RDF term $n$ has an RDF term $m$ as ASHACL type in an RDF graph $G$ if $n$
is an ASHACL instance of $m$ in $G$.

Data Graph:

A data graph is any RDF graph.

##  4 ASHACL Property Paths

ASHACL uses an RDF encoding of much of SPARQL property paths.

A blank node is an ill-formed property path in an RDF graph $G$ if it has a
value for more than one of either rdf:first or rdf:rest, sh:alternativePath,
sh:inversePath, sh:zeroOrMorePath, sh:oneOrMorePath, and sh:zeroOrOnePath in
$G$.

A blank node is an ill-formed property path in an RDF graph $G$ if there is a
path in $G$ from the node back to itself where the sequence of predicates of
the RDF triples in the path matches the regular expression

$\displaystyle(\;$ $\displaystyle(\;\mbox{\tt rdf:rest}*\;\mbox{\tt
rdf:first}\;)\;|$ $\displaystyle\mbox{\tt sh:alternativePath}\;(\mbox{\tt
rdf:rest}*\;\mbox{\tt rdf:first}\;)\;|$ $\displaystyle\mbox{\tt
sh:inversePath}\;|\;\mbox{\tt sh:zeroOrMorePath}\;|$ $\displaystyle\mbox{\tt
sh:oneOrMorePath}\;|\;\mbox{\tt sh:zeroOrOnePath}\;)\;\;+$

An RDF term is an ill-formed property path in an RDF graph if it does not
satisfy exactly one of the conditions in the mapping below.

The path mapping in an RDF graph $G$ of a RDF term $p$ that is an ASHACL
property path in $G$, $path(p,S)$, is a
https://www.w3.org/TR/sparql11-query/#pp-languageSPARQL property path
expression defined as follows:

  1. 1.

If $p$ is an IRI then $path(p,S)$ is PredicatePath($p$).

  2. 2.

If $p$ is a blank node that is an ASHACL list in $G$ that has at least two
members in $G$ and none of these members are ill-formed property paths in $G$
then $path(p,S)$ is SequencePath($path(v_{1},S)$ …$path(v_{n},S)$) where
$v_{i}$ are the members of $p$ in $G$, in order.

  3. 3.

If $p$ is a blank node that has exactly one value for sh:alternativePath in G
and that value is an ASHACL list in $G$ that has at least two members in $G$
and none of the members are ill-formed property paths in $G$ then $path(p,S)$
is AlternativePath($path(v1,S)$ …$path(vn,S)$) where $v_{i}$ are the members
of the list in $G$, in order.

  4. 4.

If $p$ is a blank node that has exactly one value $v$ for sh:inversePath in
$G$ and $v$ is not an ill-formed property path in $G$ then $path(p,S)$ is
InversePath($path(v,S)$).

  5. 5.

If $p$ is a blank node that has exactly one value $v$ for sh:zeroOrMorePath in
$G$ and $v$ is not an ill-formed property path in $G$ then $path(p,S)$ is
ZeroOrMorePath($path(v,S)$).

  6. 6.

If $p$ is a blank node that has exactly one value $v$ for sh:oneOrMorePath in
G and $v$ is not an ill-formed property path in $G$ then $path(p,S)$ is
OneOrMorePath($path(v,S)$).

  7. 7.

If $p$ is a blank node that has exactly one value $v$ for sh:zeroOrOnePath in
G and $v$ is not an ill-formed property path in $G$ then $path(p,S)$ is
ZeroOrOnePath($path(v,S)$).

If an RDF term is not an ill-formed property path in an RDF graph $G$ then it
is an ASHACL property path in $G$.

ASHACL property paths in same or different RDF graphs are path-equivalent if
their path mappings in their graphs are the same.

##  5 Validation Results and Validation Reports

The results of ASHACL validation are RDF graphs that report on the results the
validation.

A results graph is an RDF graph $G$ where every
https://www.w3.org/TR/rdf11-concepts/#section-rdf-graphnode in $G$ that has
ASHACL type sh:ValidationResult in $G$ meets the following conditions

  * •

It has sh:ValidationResult as a value for rdf:type in $G$.

  * •

It has exactly one value for sh:focusNode in $G$.

  * •

It has at most one value for sh:valueNode in $G$.

  * •

It has at most one value for sh:resultPath in $G$ and this value if present is
an ASHACL property path in $G$.

  * •

It has exactly one value for sh:sourceShape in $G$.

  * •

It has exactly one value for sh:sourceConstraintComponent in $G$.

  * •

It has exactly one value for sh:resultSeverity in $G$.

  * •

Each of its values for sh:resultMessage in $G$ is a
https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-stringlanguage-
tagged string and each has a different
https://www.w3.org/TR/rdf11-concepts/#dfn-language-taglanguage tag.

  * •

Each of its values for sh:detail in $G$ has ASHACL type sh:ValidationResult in
$G$.

  * •

Each of its values for $p$ in $G$ where $p$ is a list-taking parameter is an
ASHACL list in $G$.

A validation result from RDF term $f$, optional RDF term $v$, data graph $D$,
constraint $c$ that has kind $C$, and shape $s$ in shapes graph $S$ is a node
in a results graph $G$ that meets the following conditions

  * •

It has sh:ValidationResult as a value for rdf:type in $G$.

  * •

Its sole value for sh:focusNode in $G$ is $f$.

  * •

Its sole value for sh:valueNode in $G$ is $v$ if $v$ is present, otherwise it
has no value for sh:valueNode in $G$.

  * •

Its sole value for sh:resultPath in $G$ is an ASHACL property path in $G$ that
is path-equivalent to the value of $s$ for sh:path in $S$ if there is one,
otherwise it has no value for sh:resultPath in $G$.

  * •

Its sole value for sh:sourceShape in $G$ is $s$.

  * •

Its sole value for sh:sourceConstraintComponent in $G$ is $C$.

  * •

Its sole value for sh:resultSeverity in $G$ is the severity of $s$ in $S$.

  * •

Its values for sh:resultMessage in $G$ include any values of $s$ for
sh:message in $S$.

  * •

Its values, if any, for $p$ in $G$ with $p$ a non-list-taking parameter of $C$
and $X=\\{x|\left<p,x\right>\mbox{is a parameter value of $c$}\\}$ are the
elements of $X$.

  * •

Its values, if any, for $p$ in $G$ with $p$ a list-taking parameter of $C$ and
$X=\\{x|\left<p,x\right>\mbox{is a parameter value of $c$}\\}$ contain for
each member $x$ of $X$ an ASHACL list in $G$ whose elements in $G$ are the
elements of $x$ in $S$ and no other values.

A results structure is a results graph $R$ and a set of nodes from $R$ each of
which have ASHACL type sh:ValidationResult in $R$. The set of nodes is called
the top-level validation results of the results structure.

A results structure contains a top-level validation result from
$f$,$v$,$D$,$c$,$s$,$S$ (or $f$,$D$,$c$,$s$,$S$) if its graph contains a node
that is a validation result from $f$,$v$,$D$,$c$,$s$,$S$ ($f$,$D$,$c$,$s$,$S$,
respectively) and that node is an element of its top-level validation results.

A validation report $V$ for a results structure $R$ is any results graph
containing at least the RDF triples of $R$ plus a new blank node $n$ with
sh:ValidationReport as a value for rdf:type in $V$; "false"^^xsd:boolean as
sole value for sh:conforms in $V$ if $R$ has any top-level validation results
in $R$ and "true"^^xsd:boolean otherwise; and whose set of values for
sh:result in $V$ is the set of top-level validation results in $R$.

The combination of a multiset of results structures is the union of the graphs
of the results structures and the union of their sets of top-level validation
results, provided that this is a results structure.

Note: Combination does not use merging so that, for example, validation
results and ASHACL property paths do not have to be replicated. Care does need
to be taken when different results structures share blank nodes so that
invalid validation results or ASHACL property paths do not result.

Note: Validation reports are only required to contain top-level validation
results from results graphs, i.e., the results for validating elements of the
complete targets of shapes against the shape. Implementations are encouraged
to provide interfaces that also retain other validation results and to use the
property sh:detail to link from a validation result for a shape to validation
results from subsidiary conformance checking such as is required for
constraints that have kind sh:ShapeConstraintComponent.

##  6 Shapes

###  6.1 Shapes and Shapes Graphs

The explicit shapes of an RDF graph $G$, $ES(G)$, is the set of nodes in $G$
that

  1. 1.

have sh:Shape as an ASHACL type in $G$, or

  2. 2.

are the subject of an RDF triple in $G$ with predicate one of the target
predicates, sh:targetNode, sh:targetClass, sh:targetSubjectsOf, and
sh:targetObjectsOf.

The shapes of an RDF graph $G$, $S(G)$, is the smallest set of RDF terms such
that

  1. 1.

$ES(G)\subseteq S(G)$,

  2. 2.

If $s\in S(G)$ and $\left<s,p,o\right>$ is a triple in $G$ wiith $p$ a non-
list-taking, shape-inducing parameter then $o\in S(G)$.

  3. 3.

If $s\in S(G)$, $\left<s,p,l\right>$ is a triple in $G$ with $p$ a list-
taking, shape-inducing parameter and $l$ an ASHACL list in $G$, and $o$ is a
mamber of $l$ in $G$ then $o\in S(G)$.

A shapes graph is an RDF graph $G$ containing no ill-formed shapes in $G$.
Ill-formed shapes are defined throughout the remainder of this document.

If $s$ is a shape in an RDF graph $G$ with more than one value for sh:severity
in $G$ then $s$ is an ill-formed shape in $G$. The severity of a shape in a
shapes graph $S$ is its value for sh:severity in $S$, if any, otherwise
sh:Violation

If $s$ is a shape in an RDF graph $G$ with a value for sh:message in $G$ that
is not either a language-tagged string or a
https://www.w3.org/TR/rdf11-concepts/#dfn-literalliteral with
https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iridatatype xsd:string then
$s$ is an ill-formed shape in $G$.

If $s$ is a shape in an RDF graph $G$ with a value for sh:deactivated in $G$
that is not a literal with datatype xsd:boolean then $s$ is an ill-formed
shape in $G$.

###  6.2 Constraint Components and Constraints

A constraint component is one of the IRIs so-described in the remainder of
this document. Each constraint component has one or more mandatory parameters,
each of which is a property. Each constraint component has zero or more
optional parameters, each of which is a property. The parameters of a
constraint component are its mandatory parameters plus its optional
parameters. Some parameters of constraint components are list-taking
parameters. Parameters that are not list-taking parameters are non-list-taking
parameters. Some parameters of constraint components are shape-inducing
parameters.

For a constraint component $C$ with mandatory parameters $p_{1}$, …, $p_{n}$,
a shape s in a shapes graph $S$ has a constraint that has kind $C$ with
mandatory parameter values $\left<p_{1},v_{1}\right>$, …,
$\left<p_{n},v_{n}\right>$ in $S$ when $s$ has $v_{i}$ as a value for $p_{i}$
in $S$. If $s$ in $S$ has a constraint that has kind $C$ in $S$ then the
optional parameter values of the constraint in $S$ are all the
$\left<o_{i},v_{i}\right>$ where $o_{i}$ is an optional parameter of $C$ and
$s$ has $v_{i}$ as a value for $o_{i}$ in $S$. The parameter values of a
constraint are its mandatory parameter values plus its optional parameter
values.

###  6.3 Recursive Shapes and Recursive Shapes Graphs

A shape $s_{1}$ in an RDF graph $G$ refers to shape $s_{2}$ in $G$ if it has
$s_{2}$ as value for some non-list-taking, shape-inducing parameter of some
constraint component or $s_{2}$ as a member of the value for some list-taking,
shape-inducing parameter of some constraint component.

A shape in an RDF graph $G$ is recursive in $G$ if it is related to itself by
the transitive closure of the refers relationship in $G$. An RDF graph $G$
that contains a shape recursive in $G$ is recursive.

###  6.4 Targets

If $s$ is a shape in an RDF graph $G$ with a value for sh:targetNode in $G$
that is not an IRI or literal then $s$ is an ill-formed shape in $G$. If $s$
is a shape in a shapes graph $S$ and $s$ has value t for sh:targetNode in $S$
then $\\{t\\}$ is a target from any data graph for $s$ in $S$.

If $s$ is a shape in an RDF graph $G$ with a value for sh:targetClass in $G$
that is not an IRI then $s$ is an ill-formed shape in $G$. If $s$ is a shape
in a shapes graph $S$ and $s$ has value $c$ for sh:targetClass in $S$ then the
set of ASHACL instances of $c$ in a data graph $D$ is a target from $D$ for
$s$ in $S$.

If $s$ is a shape in an RDF graph $G$ and $s$ is also an ASHACL instance of
rdfs:Class in $G$ and $s$ is not an IRI then $s$ is an ill-formed shape in
$G$. If $s$ is a shape in a shapes graph $S$ and $s$ is also an ASHACL
instance of rdfs:Class in $S$ then the set of ASHACL instances of $s$ in a
data graph $D$ is a target from $D$ for $s$ in $S$.

A shape in an RDF graph $G$ with a value for sh:targetSubjectsOf in $G$ that
is not an IRI is an ill-formed shape in $G$. If $s$ is a shape in a shapes
graph $S$ and $s$ has value $p$ for sh:targetSubjectsOf in $S$ then the set of
nodes in a data graph $D$ that are subjects of RDF triples in $D$ with
predicate $p$ is a target from $D$ for $s$ in $S$.

A shape in an RDF graph $G$ with a value for sh:targetObjectsOf in $G$ that is
not an IRI is an ill-formed shape in $G$. If $s$ is a shape in a shapes graph
$S$ and $s$ has value $p$ for sh:targetObjectsOf in $S$ then the set of nodes
in a data graph $D$ that are objects of RDF triples in $D$ with predicate $p$
is a target from $D$ for $s$ in $S$.

The complete targets from a data graph $D$ for a shape $s$ in a shapes graph
$S$ is the union of the targets from $D$ for $s$ in $S$ as defined above.

###  6.5 Value Nodes

A shape in an RDF graph $G$ with a value for sh:path in $G$ that is an ill-
formed property path in $G$ is an ill-formed shape in $G$. A shape in an RDF
graph $G$ with more than one value for sh:path in $G$ is an ill-formed shape
in $G$.

Given $f$ an RDF term, $D$ a data graph, and $s$ a shape in $S$ a shapes graph
the value nodes of $f$ with $D$ for $s$ in $S$ is the set containing the
values of $f$ for $path(p,S)$ in $D$ if $s$ has $p$ as value for sh:path in
$S$, or just $f$ if $s$ has no value for sh:path in $S$.

##  7 Validation and Conformance Checking

Validation is the main relationship defined in ASHACL, usually producing a
validation report containing the results of the validation. There are
generally many different possible validation reports for a particular
validation. Conformance checking is a simplified version of validation,
usually producing a boolean result.

Validation and conformance checking can result in a failure. For example, a
particular ASHACL processor might allow recursive shapes but result in a
failure if it detects a loop. Failure can also result from resource
exhaustion. Failures are reported through implementation-specific channels.

#### Validating a data graph against a shapes graph:

Given $G$ a data graph and $S$ a shapes graph, a results structure for the
validation of $G$ against $S$ is a combination of some multiset
$\\{\\!\\!\\{R_{1},\ldots,R_{n}\\}\\!\\!\\}$ where $\\{s_{1},\ldots,s_{n}\\}$
is the set of shapes in $S$ and $R_{i}$ is a results structure for the
validation of $G$ against $s_{i}$ in $S$. A validation report for the
validation of $G$ against $S$ is a validation report for some results
structure for the validation of $G$ against $S$. A data graph $D$ conforms to
a shapes graph $S$ if and only if there is a results structure for the
validation of $D$ against $S$ that contains no top-level validation results.

#### Validating a data graph against a shape in a shapes graph:

Given $G$ a data graph and $s$ a shape in $S$ a shapes graph, a results
structure for the validation of $G$ against $s$ in $S$ is a combination of
some multiset $\\{\\!\\!\\{R_{1},\ldots,R_{n}\\}\\!\\!\\}$ where
$\\{t_{1},\ldots,t_{n}\\}$ is the complete targets from $G$ for $s$ in $S$ and
$R_{i}$ is a results structure for the validation of ti using $G$ against $s$
in $S$. A data graph $D$ conforms to a shape $s$ in a shapes graph $S$ if and
only if there is a results structure for the validation of $D$ against $s$ in
$S$ that contains no top-level validation results.

#### Validating an RDF term using a data graph against a shape in a shapes
graph:

Given $f$ an RDF term, $D$ a data graph, and $s$ a shape in a shapes graph $S$
a results structure for the validation of $f$ using $G$ against $s$ in $S$ is
a combination of some multiset $\\{\\!\\!\\{R_{1},\ldots,R_{n}\\}\\!\\!\\}$
where $\\{c_{1},\ldots,c_{n}\\}$ is the constraints of $s$ in $S$, $R_{i}$ is
an element of $results(f,V,D,ci,s,S)$, and $v$ is the value nodes of $f$ with
$D$ for $s$ in $S$, provided that $s$ does not have a value for sh:deactivated
in $S$ that is a literal with datatype xsd:boolean and whose
https://www.w3.org/TR/rdf11-concepts/#dfn-literal-valueliteral value is true.
If $s$ does have such a value for sh:deactivated in $S$ then any results
structure for the validation of f using $G$ against $s$ in $S$ has no top-
level validation results. An RDF term f and a data graph $D$ conform to a
shape $s$ in a shapes graph $S$ if and only if there is a results structure
for the validation of $f$ using $D$ against $s$ in S that contains no top-
level validation results.

Note: Although there can be multiple possible results structures for a
particular validation, if any results structure for the validation has no top-
level validation results they will all have no top-level validation results.

##  8 Constraint1 Components and Validation

This section defines the ASHACL constraint components along with their
parameters and how they participate in validation.

Given an RDF term $f$, a set of RDF terms $v$, a data graph $D$, a constraint
$c$, and a shape $s$ in a shapes graph $S$ the possible results of validating
f and $v$ with $D$ against $c$ in $S$, $results(f,V,D,c,s,S)$, is a set of
results structures as defined in the rest of this section.

#### sh:ClassConstraintComponent

is a constraint component with mandatory parameter sh:class. A shape in an RDF
graph $G$ with a value for sh:class in $G$ that is not an IRI is an ill-formed
shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:ClassConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:class},x\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is not
an ASHACL instance of $x$ in $D$, and no other top-level validation results.

#### sh:DatatypeConstraintComponent

is a constraint component with mandatory parameter sh:datatype. A shape in an
RDF graph $G$ with a value for sh:datatype in $G$ that is not an IRI is an
ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:DatatypeConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:datatype},x\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is not
a literal with datatype $x$, and no other top-level validation results.

#### sh:NodeKindConstraintComponent

is a constraint component with mandatory parameter sh:nodeKind. A shape in an
RDF graph $G$ with a value for sh:nodeKind in $G$ that is not one of
sh:BlankNode, sh:IRI, or sh:Literal is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:NodeKindConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:nodeKind},x\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is not
a blank node if $x$ is sh:BlankNode, not an IRI if $x$ is sh:IRI, or not a
literal if $x$ is sh:Literal, and no other top-level validation results.

#### sh:MinCountConstraintComponent

is a constraint component with mandatory parameter sh:minCount. A shape in an
RDF graph $G$ with a value for sh:minCount in $G$ that is not a literal with
datatype xsd:integer is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MinCountConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:minCount},i\right>$ contains a single top-level
validation result from $f$,$D$,$c$,$s$,$S$ and no other top-level validation
results if the cardinality of $v$ is less than the literal value of $i$, and
no top-level validation results otherwise.

#### sh:MaxCountConstraintComponent

is a constraint component with mandatory parameter sh:maxCount. A shape in an
RDF graph $G$ with a value for sh:maxCount in $G$ that is not a literal with
datatype xsd:integer is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MaxCountConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:maxCount},i\right>$ contains a single top-level
validation result from $f$,$D$,$c$,$s$,$S$ and no other top-level validation
results if the cardinality of $v$ is greater than the literal value of $i$,
and no top-level validation results otherwise.

#### sh:MinExclusiveConstraintComponent

is a constraint component with mandatory parameter sh:minExclusive. A shape in
an RDF graph $G$ with a value for sh:minExclusive in $G$ that is not suitable
for use in the https://www.w3.org/TR/sparql11-query/#OperatorMappingSPARQL
operator < is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MinExclusiveConstraintComponent and that has mandatory
parameter values $\left<\mbox{\tt sh:minExclusive},i\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ for which $i{\tt<}v$ returns false or produces an error in SPARQL,
and no other top-level validation results.

#### sh:MinInclusiveConstraintComponent

is a constraint component with mandatory parameter sh:minInclusive. A shape in
an RDF graph $G$ with a value for sh:minInclusive in $G$ that is not suitable
for use in the https://www.w3.org/TR/sparql11-query/#OperatorMappingSPARQL
operator <= is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MinInclusiveConstraintComponent and that has mandatory
parameter values $\left<\mbox{\tt sh:minInclusive},i\right>$ contains
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ for which $i{\tt<=}v$ returns false or produces an error in SPARQL,
and no other top-level validation results.

#### sh:MaxExclusiveConstraintComponent

is a constraint component with mandatory parameter sh:maxExclusive. A shape in
an RDF graph $G$ with a value for sh:maxExclusive in $G$ that is not suitable
for use in the https://www.w3.org/TR/sparql11-query/#OperatorMappingSPARQL
operator > is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MaxExclusiveConstraintComponent and that has mandatory
parameter values $\left<\mbox{\tt sh:maxExclusive},i\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ for which $i{\tt>}v$ returns false or produces an error in SPARQL,
and no other top-level validation results.

#### sh:MaxInclusiveConstraintComponent

is a constraint component with mandatory parameter sh:maxInclusive. A shape in
an RDF graph $G$ with a value for sh:maxInclusive in $G$ that is not suitable
for use in the https://www.w3.org/TR/sparql11-query/#OperatorMappingSPARQL
operator >= is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MaxInclusiveConstraintComponent and that has mandatory
parameter values $\left<\mbox{\tt sh:maxInclusive},i\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ for which $i{\tt>=}v$ returns false or produces an error in SPARQL,
and no other top-level validation results.

#### sh:MinLengthConstraintComponent

is a constraint component with mandatory parameter sh:minLength. A shape in an
RDF graph $G$ with a value for sh:minLength in $G$ that is not a literal with
datatype xsd:integer is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MinLengthConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:minLength},i\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is a
blank node or where the length of its string representation (as defined by the
https://www.w3.org/TR/sparql11-query/#func-strSPARQL str function) is less
than the literal value of $i$, and no other top-level validation results.

#### sh:MaxLengthConstraintComponent

is a constraint component with mandatory parameter sh:maxLength. A shape in an
RDF graph $G$ with a value for sh:maxLength in $G$ that is not a literal with
datatype xsd:integer is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:MaxLengthConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:maxLength},i\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is a
blank node or where the length of its string representation (as defined by the
https://www.w3.org/TR/sparql11-query/#func-strSPARQL str function) is greater
than the literal value of $i$, and no other top-level validation results.

#### sh:PatternConstraintComponent

is a constraint component with mandatory parameter sh:pattern and optional
parameter sh:flags. A shape in an RDF graph $G$ with a value for sh:pattern or
sh:flags in $G$ that is not a literal with datatype xsd:string is an ill-
formed shape in $G$. A shape in an RDF graph $G$ with more than one value for
sh:pattern or sh:flags in $G$ is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:PatternConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:pattern},r\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is
either a blank node or where the string representation (as defined by the
https://www.w3.org/TR/sparql11-query/#func-strSPARQL str function) does not
match the given regular expression (as defined by the
https://www.w3.org/TR/sparql11-query/#func-regexSPARQL REGEX function), and no
other top-level validation results. If the constraint has optional parameter
values $\left<\mbox{\tt sh:flags},flags\right>$ then flags is used as the
third argument of the https://www.w3.org/TR/sparql11-query/#func-regexSPARQL
REGEX function, otherwise the third argument is the empty string.

#### sh:StemConstraintComponent

is a constraint component with mandatory parameter sh:stem A shape in an RDF
graph $G$ with a value for sh:stem that is not a literal with datatype
xsd:string is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:StemConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:stem},i\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is not
an IRI or where its string representation (as defined by the
https://www.w3.org/TR/sparql11-query/#func-strSPARQL str function) does not
start with (as defined by the https://www.w3.org/TR/2013/REC-
sparql11-query-20130321/#func-strstartsSPARQL STRSTARTS function) the literal
value of $i$, and no other top-level validation results.

#### sh:LanguageInConstraintComponent

is a constraint component with mandatory list-taking parameter sh:languageIn.
A shape in an RDF graph $G$ with a value for sh:languageIn in $G$ that is not
an ASHACL list in $G$ whose members in $G$ are all literals with datatype
xsd:string is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:LanguageInConstraintComponent and that has mandatory
parameter values $\left<\mbox{\tt sh:languageIn},l\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ that is not a language-tagged string whose language tag matches the
literal value of one of elements of $l$ as defined by the
https://www.w3.org/TR/sparql11-query/#func-langMatchesSPARQL langMatches
function, and no other top-level validation results.

#### sh:UniqueLangConstraintComponent

is a constraint component with mandatory parameter sh:uniqueLang. A shape in
an RDF graph $G$ with a value for sh:uniqueLang in $G$ that is not a literal
with datatype xsd:boolean whose literal value is true is an ill-formed shape
in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:UniqueLangConstraintComponent and that has mandatory
parameter values $\left<\mbox{\tt sh:uniqueLang},t\right>$ for $t$ a literal
with literal value true contains a different top-level validation result from
$f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is is a language-tagged
string with the same language tag as some other element of $V$, and no other
top-level validation results.

#### sh:EqualsConstraintComponent

is a constraint component with mandatory parameter sh:equals. A shape in an
RDF graph $G$ with a value for sh:equals in $G$ that is not an IRI is an ill-
formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:EqualsConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:equals},p\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is not
a value of $f$ for $p$ in $D$ and for each $v$ a value of $f$ for $p$ in $D$
that is not in $V$, and no other top-level validation results.

#### sh:DisjointConstraintComponent

is a constraint component with mandatory parameter sh:disjoint. A shape in an
RDF graph $G$ with a value for sh:disjoint in $G$ that is not an IRI is an
ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:DisjointConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:disjoint},p\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that is
also a value of $f$ for $p$ in $D$, and no other top-level validation results.

#### sh:LessThanConstraintComponent

is a constraint component with mandatory parameter sh:lessThan. A shape in an
RDF graph $G$ with a value for sh:lessThan in $G$ that is not an IRI is an
ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:LessThanConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:lessThan},p\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ that does
not compare as less than each value of $f$ for $p$ in $G$ using
https://www.w3.org/TR/sparql11-query/#OperatorMappingSPARQL operator <, and no
other top-level validation results.

Note: A comparison that produces an error counts as not comparing as less
than.

#### sh:LessThanOrEqualsConstraintComponent

is a constraint component with mandatory parameter sh:lessThanOrEquals. A
shape in an RDF graph $G$ with a value for sh:lessThanOrEquals in $G$ that is
not an IRI is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:LessThanOrEqualsConstraintComponent and that has mandatory
parameter values $\left<\mbox{\tt sh:lessThanOrEquals},p\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ that does not compare as less than or equal each value of $f$ for
$p$ in $G$ using https://www.w3.org/TR/sparql11-query/#OperatorMappingSPARQL
operator <=, and no other top-level validation results.

Note: A comparison that produces an error counts as not comparing as less than
or equals.

#### sh:ShapeConstraintComponent

is a constraint component with mandatory shape-inducing parameter sh:shape. A
shape in an RDF graph $G$ with a value for sh:shape in $G$ that is not an IRI
or blank node is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $s$ is not recursive
and $c$ is a constraint that has kind sh:ShapeConstraintComponent and that has
mandatory parameter values $\left<\mbox{\tt sh:shape},x\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $v$ where $v$ and $D$ do not conform to $x$ in $S$, and no other top-
level validation results.

#### sh:NotConstraintComponent

is a constraint component with mandatory shape-inducing parameter sh:not. A
shape in an RDF graph $G$ with a value for sh:not in $G$ that is not an IRI or
blank node is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $s$ is not recursive
and $c$ is a constraint that has kind sh:NotConstraintComponent and that has
mandatory parameter values $\left<\mbox{\tt sh:not},x\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $v$ where $v$ and $D$ do conform to $x$ in $S$, and no other top-level
validation results.

#### sh:AndConstraintComponent

is a constraint component with mandatory list-taking, shape-inducing parameter
sh:and. A shape in an RDF graph $G$ with a value for sh:and in $G$ that is not
an ASHACL list in $G$ whose members in $G$ are all IRIs or blank nodes in $G$
is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $s$ is not recursive
and $c$ is a constraint that has kind sh:AndConstraintComponent and that has
mandatory parameter values $\left<\mbox{\tt sh:and},l\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ where $v$ and $D$ do not conform to each element of $l$ in $S$, and
no other top-level validation results.

#### sh:OrConstraintComponent

is a constraint component with mandatory list-taking, shape-inducing parameter
sh:or. A shape in an RDF graph $G$ with a value for sh:or in $G$ that is not
an ASHACL list in $G$ whose members in $G$ are all IRIs or blank nodes in $G$
is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $s$ is not recursive
and $c$ is a constraint that has kind sh:OrConstraintComponent and that has
mandatory parameter values $\left<\mbox{\tt sh:or},l\right>$ contains a
different top-level validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each
$v$ in $V$ where $v$ and $D$ do not conform to any element of $l$ in $S$, and
no other top-level validation results.

#### sh:QualifiedValueShapeConstraintComponent

is a constraint component with mandatory shape-inducing parameter
sh:qualifiedValueShape and optional parameters sh:qualifiedMinCount and
sh:qualifiedMaxCount A shape in an RDF graph $G$ with a value for
sh:qualifiedValueShape in $G$ that is not an IRI or blank node is an ill-
formed shape in $G$. A shape in an RDF graph $G$ with a value for
sh:qualifiedMinCount or sh:qualifiedMaxCount in $G$ that is not a literal with
datatype xsd:integer is an ill-formed shape in $G$. A shape in an RDF graph
$G$ with more than one value for sh:qualifiedValueShape, sh:qualifiedMinCount,
or sh:qualifiedMaxCount in $G$ is an ill-formed shape in $G$. A shape in an
RDF graph $G$ that has a value for sh:qualifiedValueShape in $G$ but no value
for either sh:qualifiedMinCount or sh:qualifiedMaxCount in $G$ is an ill-
formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $s$ is not recursive
and $c$ is a constraint that has kind
sh:QualifiedValueShapeConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:qualifiedValueShape},x\right>$ contains a single
top-level validation result from $f$,$D$,$c$,$s$,$S$ and no other top-level
validation results if the number of elements $v$ of $v$ where where $v$ and
$D$ conform to $x$ in $S$ is less than the literal value of $m$ if
$\left<\mbox{\tt sh:qualifiedMinCount},m\right>$ is in the optional parameters
of the constraint or is greater than the literal value $\left<\mbox{\tt
sh:qualifiedMaxCount},n\right>$ is in the optional parameters of the
constraint, and no top-level validation results otherwise.

#### sh:ClosedConstraintComponent

is a constraint component with mandatory parameter sh:closed and optional
list-taking parameter sh:ignoredProperties A shape in an RDF graph $G$ with a
value for sh:closed in $G$ that is not a literal with datatype xsd:boolean
whose value is true is an ill-formed shape in $G$. A shape in an RDF graph $G$
with a value for sh:ignoredProperties in $G$ that is not an ASHACL list in $G$
whose members in $G$ are all IRIs is an ill-formed shape in $G$. A shape in an
RDF graph $G$ with more than one value for sh:closed or sh:ignoredProperties
in $G$ is an ill-formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:ClosedConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:closed},t\right>$ contains a different top-level
validation result from $f$,$v$,$D$,$c$,$s$,$S$ for each RDF triple in $D$ with
subject $f$ whose predicate is not a value of some value of $s$ for sh:shape
in $D$ for sh:path in $D$ and not a member of $i$ in $D$ if the constraint has
optional parameter values $\left<\mbox{\tt sh:ignoredProperties},i\right>$,
and no other top-level validation results.

#### sh:HasValueConstraintComponent

is a constraint component with mandatory parameter sh:hasValue.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:HasValueConstraintComponent and that has mandatory parameter
values $\left<\mbox{\tt sh:hasValue},x\right>$ contains a single top-level
validation result from $f$,$D$,$c$,$s$,$S$ and no other top-level validation
results if $x$ is not in $V$, and no top-level validation results otherwise.

#### sh:InConstraintComponent

is a constraint component with mandatory list-taking parameter sh:in A shape
in an RDF graph $G$ with a value for sh:in in $G$ that is not an ASHACL list
in $G$ whose members in $G$ are all IRIs or blank nodes in $G$ is an ill-
formed shape in $G$.

Each results structure in $results(f,V,D,c,s,S)$ where $c$ is a constraint
that has kind sh:InConstraintComponent and that has mandatory parameter values
$\left<\mbox{\tt sh:in},x\right>$ contains a different top-level validation
result from $f$,$v$,$D$,$c$,$s$,$S$ for each $v$ in $V$ where $v$ is not a
member of $x$ in $S$, and no other top-level validation results.

##  9 ASHACL Processors and Conformance

The keywords MAY, MUST, MUST NOT, and SHOULD are to be interpreted in this
section as described in https://tools.ietf.org/html/rfc2119RFC2119 [1].

An ASHACL processor MUST provide an interface that takes two RDF graphs—a data
graph and a potential shapes graph.

If the potential shapes graph is not a shapes graph the processor MUST report
a failure. If the potential shapes graph is recursive the behaviour of the
processor is not fully defined here; the processor MAY report a failure if the
potential shapes graph is recursive or MAY extend this specification. The
behavior of an ASHACL processor MUST satisfy all the requirements in this
document regardless of whether the the potential shapes graph is recursive or
not.

Unless the ASHACL processor reports a failure, it MUST either return a
representation, or a location from which a representation can be retrieved,
for an RDF graph that is a validation report for the validation of the data
graph against the shapes graph. The representation can be a document in a
syntax for RDF graphs, such as Turtle, or an RDF graph stored in a graph
repository.

An ASHACL processor SHOULD provide a version of the above interface where the
representation of the validation report is a file containing a Turtle
document.

An ASHACL processor SHOULD provide an interface similar to the first interface
above except that the return value of the interface is a boolean indicating
whether the data graph conforms to the shapes graph.

An ASHACL processor SHOULD provide versions of the above interfaces where the
potential shapes graph is formed by starting with an initial graph and merging
in other graphs accessible at locations that are values of RDF triples with
predicate owl:imports in the potential shapes graph being formed.

An ASHACL processor SHOULD provide versions of the above interfaces where the
potential shapes graph is formed by accessing locations that are objects of
RDF triples with predicate sh:shapesGraph in the data graph and merging the
RDF graphs available at these locations into an initial graph or potential
shapes graph.

An ASHACL processor SHOULD provide versions of the above interfaces where the
data graph is the result of using owl:imports as above starting with some
initial data graph or where the data graph is the result of performing
inference according to the inferences required in one or more SPARQL
entailment regimes [3] specified as the objects of RDF triples in the shapes
graph with predicate sh:entailment starting with an initial data graph.

An ASHACL processor SHOULD provide two extra versions of each interface above
that it provides. The first of these takes in addition an IRI and validates or
checks conformance with respect to the data graph and the IRI as a shape in
the shapes graph. The second of these takes in addition also an IRI or RDF
literal and validates or checks conformance with respect to the IRI or RDF
literal using the data graph and the IRI as a shape in the shapes graph.

If an ASHACL processor accesses any persistent representation of any graph
that contributes to the data graph or the potential shapes graph the ASHACL
processor MUST NOT change these representations. An ASHACL processor MAY
create a persistent representation of a validation report that it constructs
so long as the ASHACL processor does not not violate the previous requirement.

##  10 Conclusion

It is easier to fix SHACL Core, which has been done here, than it is to fix
SHACL-SPARQL, which requires at least a suitable definition of pre-binding. A
workable specification of SHACL-SPARQL is thus deferred to future work.

##  11 Changes from previous version

This version of the document extends the conditions for ill-formed property
paths include blank nodes that have a value for rdf:rest and a value for one
of the ASHACL properties that are used to encode SPARQL property path
expressions. This version of the document limits the shapes in a shapes graph
to those nodes in the graph that are SHACL instances of sh:Shape, have a value
for any of the target predicates, or are used as shapes in these nodes.

## References

  * [1] S. Brander.  Key words for use in RFCs to indicate requirement levels.  IETF Request for Comments, https://www.ietf.org/rfc/rfc2119.txt, March 1997.
  * [2] Richard Cyganiak and David Wood.  RDF 1.1 concepts and abstract syntax.  W3C Last Call Working Draft, http://www.w3.org/TR/rdf11-concepts, 23 July 2013.
  * [3] Birte Glimm and Chimezie Ogbuji.  SPARQL 1.1 entailment regimes.  W3C Rec., https://www.w3.org/TR/2013/REC-sparql11-entailment-20130321/, 21 March 2013\.
  * [4] Steve Harris and Andy Seaborne.  SPARQL 1.1 query language.  W3C Rec., https://www.w3.org/TR/2013/REC-sparql11-query-20130321/, 21 March 2013.
  * [5] Holger Knublauch and Dimitris Kontokostas.  Shapes constraint language (SHACL).  W3C Working Draft, https://www.w3.org/TR/2017/WD-shacl-20170202/, 02 February 2017.
  * [6] Eric Prud’hommeaux and Gavin Carothers.  RDF 1.1 turtle: Terse RDF triple language.  W3C Recommendation, http://www.w3.org/TR/turtle/, February 2014\.