Skip to content

Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.

Measure conformance against the W3C suite instead of finding defects one at a time

FABIOTESS6f5c8eca1469
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4c8e6cf8..5ed5acb8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -319,3 +319,44 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Certify every shipped ontology through the proved checker
run: OO_REQUIRE_FIXTURES=1 cargo test --test lean_certificate_test -- --nocapture
+
+ # The official W3C SHACL test suite, as a ratchet.
+ #
+ # `shacl-differential` above compares this engine against pyshacl on OUR
+ # corpus, which measures agreement with one other implementation on data we
+ # chose. This measures conformance against the Working Group's own suite on
+ # data they chose, which is the only number that can be quoted outside this
+ # repository. The two are complementary and neither replaces the other.
+ #
+ # The gate is monotone, not pass-all: PASS may not drop, FAIL may not rise,
+ # and no named PASS may regress against tests/w3c_shacl_baseline.json. The
+ # engine passes 32 of 120 today and pretending otherwise would be exactly the
+ # silent success this repository keeps finding elsewhere. See the module docs
+ # in tests/w3c_shacl_conformance_test.rs.
+ #
+ # Cheap by construction: no Python, no network, no release build. The suite is
+ # vendored under tests/w3c-shacl/ (632 KB, W3C Software and Document License)
+ # so the job is offline and deterministic. OO_REQUIRE_FIXTURES=1 turns the
+ # "suite missing" skip into a failure, so it cannot pass by not running.
+ w3c-shacl:
+ timeout-minutes: 15
+ name: SHACL conformance vs the W3C suite
+ runs-on: ubuntu-latest
+ env:
+ CARGO_INCREMENTAL: 0
+ CARGO_PROFILE_DEV_DEBUG: 0
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
+ - uses: Swatinem/rust-cache@v2
+ - name: Run the suite and hold the ratchet
+ run: |
+ set -o pipefail
+ OO_REQUIRE_FIXTURES=1 cargo test --test w3c_shacl_conformance_test -- --nocapture \
+ 2>&1 | tee w3c-shacl-conformance.log
+ - name: Upload the per-test report
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: w3c-shacl-conformance
+ path: w3c-shacl-conformance.log
diff --git a/src/shacl.rs b/src/shacl.rs
index ac3b93c8..74f08158 100644
--- a/src/shacl.rs
+++ b/src/shacl.rs
@@ -328,6 +328,17 @@ impl ShaclValidator {
// `sh:not` was invisible: it was never collected, never evaluated, and
// never recorded, so a shape whose only constraint was `sh:not` returned
// `conforms: true` over data that violated it.
+ //
+ // Restricted to the SHACL namespace, exactly as the node-shape
+ // complement above already is. A predicate from any other namespace
+ // on a shape is an annotation or an axiom, never a constraint, and
+ // treating one as unimplemented cost the verdict: a shapes graph
+ // that merely documented itself with `rdfs:label` came back
+ // `conforms: null` with the label recorded as a constraint this
+ // validator could not evaluate. Seven tests in the W3C suite turn
+ // on that alone. A false undetermined is not free; it teaches the
+ // reader to ignore null, which destroys the signal the third answer
+ // carries.
let unknown = query_solutions_bound(
&shapes_store,
&format!(
@@ -336,7 +347,7 @@ impl ShaclValidator {
SELECT DISTINCT ?shape ?pred WHERE {{
{} sh:property ?prop .
?prop ?pred ?o .
- FILTER(?pred NOT IN (
+ FILTER(STRSTARTS(STR(?pred), "http://www.w3.org/ns/shacl#") && ?pred NOT IN (
sh:path, sh:minCount, sh:maxCount, sh:datatype,
sh:class, sh:pattern, sh:hasValue, sh:message, sh:severity,
sh:minInclusive, sh:maxInclusive,
@@ -347,8 +358,7 @@ impl ShaclValidator {
sh:qualifiedValueShape, sh:qualifiedMinCount,
sh:qualifiedMaxCount,
sh:node,
- sh:name, sh:description, sh:order, sh:group,
- <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
+ sh:name, sh:description, sh:order, sh:group
))
}}
"#,
@@ -1641,6 +1651,18 @@ impl ShaclValidator {
// legal after those: the grammar allows any number of
// PREFIX and BASE declarations in any order.
let query = format!("{prefix_block}{select_raw}");
+ if let Some(construct) = prebinding_violation(&select_raw, "this") {
+ skipped.push(serde_json::json!({
+ "shape": strip_angle_brackets(&shape_iri),
+ "constraint": "sparql",
+ "reason": format!(
+ "SHACL 5.2.1 forbids {construct} in a query that is pre-bound, so this \
+ constraint cannot be evaluated and the validator must refuse rather \
+ than substitute into it"
+ ),
+ }));
+ continue;
+ }
match graph.sparql_select_union_prebound(&query, "this", &focus_terms) {
Ok(per_focus) => {
for (focus, rows) in focus_terms.iter().zip(per_focus) {
@@ -2434,6 +2456,127 @@ fn count_focus_nodes(graph: &Arc<GraphStore>, focus_pattern: &str) -> anyhow::Re
.unwrap_or(0))
}
+/// The construct in `query` that SHACL forbids under pre-binding, if any.
+///
+/// SHACL 5.2.1 restricts what a `sh:sparql` SELECT may contain, because
+/// pre-binding is substitution and substitution is not sound through every
+/// SPARQL operator. A conforming processor must REPORT A FAILURE rather than
+/// evaluate such a query. This validator substituted unconditionally, so it
+/// ran them and returned a confident answer: the same false-clean class as
+/// #132, in the same function, and invisible to any proof about this code
+/// because the rule lives in the specification rather than in the program.
+/// The W3C suite ships five tests (`unsupported-sparql-001` to `-005`) that
+/// exist only to check a validator refuses.
+///
+/// The scan is lexical, and deliberately conservative: it skips string
+/// literals, IRIs and comments so that a `MINUS` inside a message cannot
+/// trigger it, and where it is unsure it refuses. Refusing is the safe
+/// direction here, because a refusal is `conforms: null` with a reason, which
+/// no consumer can read as a pass.
+fn prebinding_violation(query: &str, var: &str) -> Option<String> {
+ // Blank out anything a keyword could hide inside, keeping the length so
+ // that word boundaries still line up.
+ let mut scrubbed = String::with_capacity(query.len());
+ let mut chars = query.chars().peekable();
+ while let Some(c) = chars.next() {
+ match c {
+ '"' | '\'' => {
+ scrubbed.push(' ');
+ let quote = c;
+ for d in chars.by_ref() {
+ scrubbed.push(if d == '\n' { '\n' } else { ' ' });
+ if d == quote {
+ break;
+ }
+ }
+ }
+ '<' => {
+ scrubbed.push(' ');
+ for d in chars.by_ref() {
+ scrubbed.push(' ');
+ if d == '>' {
+ break;
+ }
+ }
+ }
+ '#' => {
+ scrubbed.push(' ');
+ for d in chars.by_ref() {
+ scrubbed.push(if d == '\n' { '\n' } else { ' ' });
+ if d == '\n' {
+ break;
+ }
+ }
+ }
+ other => scrubbed.push(other),
+ }
+ }
+ let upper = scrubbed.to_ascii_uppercase();
+ let has_word = |w: &str| -> bool {
+ let mut from = 0;
+ while let Some(i) = upper[from..].find(w) {
+ let at = from + i;
+ let before_ok = at == 0
+ || !upper[..at]
+ .chars()
+ .next_back()
+ .map(|c| c.is_alphanumeric() || c == '_' || c == '?' || c == '$')
+ .unwrap_or(false);
+ let after = upper[at + w.len()..].chars().next();
+ let after_ok = after.map(|c| !c.is_alphanumeric() && c != '_').unwrap_or(true);
+ if before_ok && after_ok {
+ return true;
+ }
+ from = at + w.len();
+ }
+ false
+ };
+ if has_word("MINUS") {
+ return Some("MINUS".to_string());
+ }
+ if has_word("SERVICE") {
+ return Some("SERVICE".to_string());
+ }
+ // A VALUES clause or a BIND that touches the pre-bound variable.
+ let marks = [format!("?{var}"), format!("${var}")];
+ if let Some(i) = upper.find("VALUES")
+ && marks.iter().any(|m| {
+ upper[i..]
+ .split_once('{')
+ .map(|(head, _)| head.to_ascii_uppercase().contains(&m.to_ascii_uppercase()))
+ .unwrap_or(false)
+ })
+ {
+ return Some(format!("VALUES over the pre-bound variable {marks:?}"));
+ }
+ let mut from = 0;
+ while let Some(i) = upper[from..].find(" AS ") {
+ let at = from + i + 4;
+ let rest = upper[at..].trim_start();
+ if marks.iter().any(|m| rest.starts_with(&m.to_ascii_uppercase())) {
+ return Some(format!("BIND or expression assigning to {marks:?}"));
+ }
+ from = at;
+ }
+ // A sub-SELECT that does not project the pre-bound variable cannot receive
+ // the substitution, so the outer binding silently does not reach it.
+ if let Some(first) = upper.find("SELECT") {
+ let mut from = first + 6;
+ while let Some(i) = upper[from..].find("SELECT") {
+ let at = from + i;
+ let head = match upper[at..].find("WHERE") {
+ Some(w) => &upper[at..at + w],
+ None => &upper[at..],
+ };
+ if !head.contains('*') && !marks.iter().any(|m| head.contains(&m.to_ascii_uppercase())) {
+ return Some("a sub-SELECT that does not project the pre-bound variable".to_string());
+ }
+ from = at + 6;
+ }
+ }
+ None
+}
+
/// Name the shape and the constraint component that produced a violation.
///
/// The W3C validation report vocabulary carries `sh:sourceShape` and
diff --git a/tests/w3c-shacl/LICENSE.md b/tests/w3c-shacl/LICENSE.md
new file mode 100644
index 00000000..63ff9303
--- /dev/null
+++ b/tests/w3c-shacl/LICENSE.md
@@ -0,0 +1,3 @@
+All documents in this Repository are licensed by contributors
+under the
+[W3C Software and Document License](http://www.w3.org/Consortium/Legal/copyright-software).
diff --git a/tests/w3c-shacl/README.md b/tests/w3c-shacl/README.md
new file mode 100644
index 00000000..f93046f1
--- /dev/null
+++ b/tests/w3c-shacl/README.md
@@ -0,0 +1,72 @@
+# The W3C SHACL test suite, vendored
+
+This directory is a verbatim copy of `data-shapes-test-suite/tests/` from the
+W3C Data Shapes Working Group repository. Two files are added by this project
+and are not upstream: this `README.md` and `LICENSE.md` (a copy of the
+repository-root licence, reproduced here so the terms travel with the data).
+
+Nothing under `core/` or `sparql/` has been edited. Do not edit it: a test
+suite you have patched measures your patch.
+
+## Provenance
+
+| | |
+|---|---|
+| Upstream | <https://github.com/w3c/data-shapes> |
+| Path | `data-shapes-test-suite/tests/` |
+| Commit | `94d8bc2bd4fc4fdc6f2964d1ec4a892329e05f06` |
+| Commit date | 2026-09-12 |
+| Commit subject | `#1226: Added test case and changed contract for rules with same order (#1244)` |
+| Published report | <https://w3c.github.io/data-shapes/data-shapes-test-suite/> |
+| Vendored on | 2026-09-13 |
+| SHA-256 of the `.ttl` tree | `2ca9709d35a7e85d3dde6a1e4311a391728f1cf4b2ade47c0ce434652886fd40` |
+
+The tree digest is reproducible with:
+
+```sh
+cd tests/w3c-shacl && find . -type f -name '*.ttl' | sort | xargs shasum -a 256 | shasum -a 256
+```
+
+## Licence
+
+W3C Software and Document License, the terms the whole `w3c/data-shapes`
+repository carries (`LICENSE.md` at its root, reproduced here). It permits
+copying and redistribution, with or without modification, for any purpose,
+provided the copyright notice, the licence link and a statement of changes
+travel with the copy. This file is that statement of changes: there are none
+to the test data.
+
+## Why vendored rather than fetched at test time
+
+The reasons are given in order of weight.
+
+1. **A conformance number that depends on a network fetch is not a
+ measurement.** The suite is a moving target: the Working Group approves and
+ edits tests. If CI fetched it, the ratchet in
+ `tests/w3c_shacl_conformance_test.rs` would compare today's engine against
+ an unpinned oracle, and a red build could mean "someone in the WG merged a
+ test" rather than "we regressed". Pinning the suite to a commit makes the
+ baseline mean one thing.
+2. **CI must run offline and deterministically.** Every other gate in this
+ repository does. The `lean` job builds a checker from vendored sources; the
+ `shacl-differential` job runs against a corpus that is in the tree. A
+ network dependency in the test path is a flake generator, and this
+ repository has already lost a six hour CI run to an apt mirror going dark
+ (see the comment on the `features` job in `.github/workflows/ci.yml`).
+3. **It is 632 KB.** The cost of carrying it is nil against the cost of not
+ having it.
+
+## Refreshing
+
+```sh
+git clone --depth 1 https://github.com/w3c/data-shapes /tmp/data-shapes
+rm -rf tests/w3c-shacl/core tests/w3c-shacl/sparql tests/w3c-shacl/manifest.ttl
+cp -R /tmp/data-shapes/data-shapes-test-suite/tests/. tests/w3c-shacl/
+cp /tmp/data-shapes/LICENSE.md tests/w3c-shacl/LICENSE.md
+# then update the table above and re-cut the baseline:
+OO_W3C_SHACL_UPDATE_BASELINE=1 cargo test --test w3c_shacl_conformance_test -- --nocapture
+```
+
+A refresh that moves the totals is a deliberate act and shows up as a diff in
+`tests/w3c_shacl_baseline.json`. A refresh that silently lowers the pass count
+is caught by the ratchet before the baseline is re-cut.
diff --git a/tests/w3c-shacl/core/complex/manifest.ttl b/tests/w3c-shacl/core/complex/manifest.ttl
new file mode 100644
index 00000000..6e921e56
--- /dev/null
+++ b/tests/w3c-shacl/core/complex/manifest.ttl
@@ -0,0 +1,10 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/complex" ;
+ mf:include <personexample.ttl> ;
+ mf:include <shacl-shacl.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/core/complex/personexample.ttl b/tests/w3c-shacl/core/complex/personexample.ttl
new file mode 100644
index 00000000..5794d7e8
--- /dev/null
+++ b/tests/w3c-shacl/core/complex/personexample.ttl
@@ -0,0 +1,105 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/complex/personexample.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Alice
+ rdf:type ex:Person ;
+ ex:ssn "987-65-432A" ;
+.
+ex:Bob
+ rdf:type ex:Person ;
+ ex:ssn "123-45-6789" ;
+ ex:ssn "124-35-6789" ;
+.
+ex:Calvin
+ rdf:type ex:Person ;
+ ex:birthDate "1999-09-09"^^xsd:date ;
+ ex:worksFor ex:UntypedCompany ;
+.
+ex:PersonShape
+ rdf:type sh:NodeShape ;
+ sh:closed "true"^^xsd:boolean ;
+ sh:ignoredProperties (
+ rdf:type
+ ) ;
+ sh:property _:b61064 ;
+ sh:property _:b60054 ;
+ sh:property [
+ sh:path [
+ sh:inversePath ex:worksFor ;
+ ] ;
+ sh:name "employee" ;
+ ] ;
+ sh:targetClass ex:Person ;
+.
+_:b61064
+ sh:path ex:ssn ;
+ sh:datatype xsd:string ;
+ sh:maxCount 1 ;
+ sh:pattern "^\\d{3}-\\d{2}-\\d{4}$"
+.
+_:b60054
+ sh:path ex:worksFor ;
+ sh:class ex:Company ;
+ sh:nodeKind sh:IRI
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <personexample>
+ ) ;
+.
+<personexample>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of personexample" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Alice ;
+ sh:resultPath ex:ssn ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape _:b61064 ;
+ sh:value "987-65-432A" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Bob ;
+ sh:resultPath ex:ssn ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape _:b61064 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Calvin ;
+ sh:resultPath ex:birthDate ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClosedConstraintComponent ;
+ sh:sourceShape ex:PersonShape ;
+ sh:value "1999-09-09"^^xsd:date ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Calvin ;
+ sh:resultPath ex:worksFor ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape _:b60054 ;
+ sh:value ex:UntypedCompany ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/complex/shacl-shacl-data-shapes.ttl b/tests/w3c-shacl/core/complex/shacl-shacl-data-shapes.ttl
new file mode 100644
index 00000000..c6b751a7
--- /dev/null
+++ b/tests/w3c-shacl/core/complex/shacl-shacl-data-shapes.ttl
@@ -0,0 +1,410 @@
+# baseURI: http://www.w3.org/ns/shacl-shacl#
+
+# A SHACL shapes graph to validate SHACL shapes graphs
+# Draft last edited 2017-04-04
+
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+@prefix shsh: <http://www.w3.org/ns/shacl-shacl#> .
+
+shsh:
+ rdfs:label "SHACL for SHACL"@en ;
+ rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the syntax rules."@en ;
+ sh:declare [
+ sh:prefix "shsh" ;
+ sh:namespace "http://www.w3.org/ns/shacl-shacl#" ;
+ ] .
+
+
+shsh:ListShape
+ a sh:NodeShape ;
+ rdfs:label "List shape"@en ;
+ rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ;
+ rdfs:seeAlso <https://www.w3.org/TR/shacl/#syntax-rule-SHACL-list> ;
+ sh:property [
+ sh:path [ sh:zeroOrMorePath rdf:rest ] ;
+ rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ;
+ sh:hasValue rdf:nil ;
+ sh:node shsh:ListNodeShape ;
+ ] .
+
+shsh:ListNodeShape
+ a sh:NodeShape ;
+ rdfs:label "List node shape"@en ;
+ rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ;
+ sh:or ( [
+ sh:hasValue rdf:nil ;
+ sh:property [
+ sh:path rdf:first ;
+ sh:maxCount 0 ;
+ ] ;
+ sh:property [
+ sh:path rdf:rest ;
+ sh:maxCount 0 ;
+ ] ;
+ ]
+ [
+ sh:not [ sh:hasValue rdf:nil ] ;
+ sh:property [
+ sh:path rdf:first ;
+ sh:maxCount 1 ;
+ sh:minCount 1 ;
+ ] ;
+ sh:property [
+ sh:path rdf:rest ;
+ sh:maxCount 1 ;
+ sh:minCount 1 ;
+ ] ;
+ ] ) .
+
+shsh:ShapeShape
+ a sh:NodeShape ;
+ rdfs:label "Shape shape"@en ;
+ rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ;
+
+ # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape
+ sh:targetClass sh:NodeShape ;
+ sh:targetClass sh:PropertyShape ;
+ sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ;
+ sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue,
+ sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive,
+ sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind,
+ sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape,
+ sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:sparql, sh:uniqueLang, sh:xone ;
+
+ sh:targetObjectsOf sh:node ; # node-node
+ sh:targetObjectsOf sh:not ; # not-node
+ sh:targetObjectsOf sh:property ; # property-node
+ sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node
+
+ # Shapes are either node shapes or property shapes
+ sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ;
+
+ sh:property [
+ sh:path sh:targetNode ;
+ sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:targetClass ;
+ sh:nodeKind sh:IRI ; # targetClass-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:targetSubjectsOf ;
+ sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:targetObjectsOf ;
+ sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind
+ ] ;
+ sh:or ( [ sh:not [
+ sh:class rdfs:Class ;
+ sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] )
+ ] ]
+ [ sh:nodeKind sh:IRI ]
+ ) ; # implicit-targetClass-nodeKind
+
+ sh:property [
+ sh:path sh:severity ;
+ sh:maxCount 1 ; # severity-maxCount
+ sh:nodeKind sh:IRI ; # severity-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:message ;
+ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype
+ ] ;
+ sh:property [
+ sh:path sh:deactivated ;
+ sh:maxCount 1 ; # deactivated-maxCount
+ sh:in ( true false ) ; # deactivated-datatype
+ ] ;
+
+ sh:property [
+ sh:path sh:and ;
+ sh:node shsh:ListShape ; # and-node
+ ] ;
+ sh:property [
+ sh:path sh:class ;
+ sh:nodeKind sh:IRI ; # class-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:closed ;
+ sh:datatype xsd:boolean ; # closed-datatype
+ sh:maxCount 1 ; # multiple-parameters
+ ] ;
+ sh:property [
+ sh:path sh:ignoredProperties ;
+ sh:node shsh:ListShape ; # ignoredProperties-node
+ sh:maxCount 1 ; # multiple-parameters
+ ] ;
+ sh:property [
+ sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
+ sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:datatype ;
+ sh:nodeKind sh:IRI ; # datatype-nodeKind
+ sh:maxCount 1 ; # datatype-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:disjoint ;
+ sh:nodeKind sh:IRI ; # disjoint-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:equals ;
+ sh:nodeKind sh:IRI ; # equals-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:in ;
+ sh:maxCount 1 ; # in-maxCount
+ sh:node shsh:ListShape ; # in-node
+ ] ;
+ sh:property [
+ sh:path sh:languageIn ;
+ sh:maxCount 1 ; # languageIn-maxCount
+ sh:node shsh:ListShape ; # languageIn-node
+ ] ;
+ sh:property [
+ sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
+ sh:datatype xsd:string ; # languageIn-members-datatype
+ ] ;
+ sh:property [
+ sh:path sh:lessThan ;
+ sh:nodeKind sh:IRI ; # lessThan-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:lessThanOrEquals ;
+ sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:maxCount ;
+ sh:datatype xsd:integer ; # maxCount-datatype
+ sh:maxCount 1 ; # maxCount-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:maxExclusive ;
+ sh:maxCount 1 ; # maxExclusive-maxCount
+ sh:nodeKind sh:Literal ; # maxExclusive-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:maxInclusive ;
+ sh:maxCount 1 ; # maxInclusive-maxCount
+ sh:nodeKind sh:Literal ; # maxInclusive-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:maxLength ;
+ sh:datatype xsd:integer ; # maxLength-datatype
+ sh:maxCount 1 ; # maxLength-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:minCount ;
+ sh:datatype xsd:integer ; # minCount-datatype
+ sh:maxCount 1 ; # minCount-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:minExclusive ;
+ sh:maxCount 1 ; # minExclusive-maxCount
+ sh:nodeKind sh:Literal ; # minExclusive-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:minInclusive ;
+ sh:maxCount 1 ; # minInclusive-maxCount
+ sh:nodeKind sh:Literal ; # minInclusive-nodeKind
+ ] ;
+ sh:property [
+ sh:path sh:minLength ;
+ sh:datatype xsd:integer ; # minLength-datatype
+ sh:maxCount 1 ; # minLength-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:nodeKind ;
+ sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in
+ sh:maxCount 1 ; # nodeKind-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:or ;
+ sh:node shsh:ListShape ; # or-node
+ ] ;
+ sh:property [
+ sh:path sh:pattern ;
+ sh:datatype xsd:string ; # pattern-datatype
+ sh:maxCount 1 ; # multiple-parameters
+ # Not implemented: syntax rule pattern-regex
+ ] ;
+ sh:property [
+ sh:path sh:flags ;
+ sh:datatype xsd:string ; # flags-datatype
+ sh:maxCount 1 ; # multiple-parameters
+ ] ;
+ sh:property [
+ sh:path sh:qualifiedMaxCount ;
+ sh:datatype xsd:integer ; # qualifiedMaxCount-datatype
+ sh:maxCount 1 ; # multiple-parameters
+ ] ;
+ sh:property [
+ sh:path sh:qualifiedMinCount ;
+ sh:datatype xsd:integer ; # qualifiedMinCount-datatype
+ sh:maxCount 1 ; # multiple-parameters
+ ] ;
+ sh:property [
+ sh:path sh:qualifiedValueShape ;
+ sh:maxCount 1 ; # multiple-parameters
+ ] ;
+ sh:property [
+ sh:path sh:qualifiedValueShapesDisjoint ;
+ sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype
+ sh:maxCount 1 ; # multiple-parameters
+ ] ;
+ sh:property [
+ sh:path sh:uniqueLang ;
+ sh:datatype xsd:boolean ; # uniqueLang-datatype
+ sh:maxCount 1 ; # uniqueLang-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:xone ;
+ sh:node shsh:ListShape ; # xone-node
+ ] .
+
+shsh:NodeShapeShape
+ a sh:NodeShape ;
+ sh:targetObjectsOf sh:node ; # node-node
+ sh:property [
+ sh:path sh:path ;
+ sh:maxCount 0 ; # NodeShape-path-maxCount
+ ] ;
+ sh:property [
+ sh:path sh:lessThan ;
+ sh:maxCount 0 ; # lessThan-scope
+ ] ;
+ sh:property [
+ sh:path sh:lessThanOrEquals ;
+ sh:maxCount 0 ; # lessThanOrEquals-scope
+ ] ;
+ sh:property [
+ sh:path sh:maxCount ;
+ sh:maxCount 0 ; # maxCount-scope
+ ] ;
+ sh:property [
+ sh:path sh:minCount ;
+ sh:maxCount 0 ; # minCount-scope
+ ] ;
+ sh:property [
+ sh:path sh:qualifiedValueShape ;
+ sh:maxCount 0 ; # qualifiedValueShape-scope
+ ] ;
+ sh:property [
+ sh:path sh:uniqueLang ;
+ sh:maxCount 0 ; # uniqueLang-scope
+ ] .
+
+shsh:PropertyShapeShape
+ a sh:NodeShape ;
+ sh:targetObjectsOf sh:property ; # property-node
+ sh:property [
+ sh:path sh:path ;
+ sh:maxCount 1 ; # path-maxCount
+ sh:minCount 1 ; # PropertyShape-path-minCount
+ sh:node shsh:PathShape ; # path-node
+ ] .
+
+# Values of sh:and, sh:or and sh:xone must be lists of shapes
+shsh:ShapesListShape
+ a sh:NodeShape ;
+ sh:targetObjectsOf sh:and ; # and-members-node
+ sh:targetObjectsOf sh:or ; # or-members-node
+ sh:targetObjectsOf sh:xone ; # xone-members-node
+ sh:property [
+ sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
+ sh:node shsh:ShapeShape ;
+ ] .
+
+
+# A path of blank node path syntax, used to simulate recursion
+_:PathPath
+ sh:alternativePath (
+ ( [ sh:zeroOrMorePath rdf:rest ] rdf:first )
+ ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first )
+ sh:inversePath
+ sh:zeroOrMorePath
+ sh:oneOrMorePath
+ sh:zeroOrOnePath
+ ) .
+
+shsh:PathShape
+ a sh:NodeShape ;
+ rdfs:label "Path shape"@en ;
+ rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ;
+ rdfs:seeAlso <https://www.w3.org/TR/shacl/#property-paths> ;
+ sh:property [
+ sh:path [ sh:zeroOrMorePath _:PathPath ] ;
+ sh:node shsh:PathNodeShape ;
+ ] .
+
+shsh:PathNodeShape
+ sh:xone ( # path-metarule
+ [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path
+ sh:node shsh:PathListWithAtLeast2Members ;
+ ]
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path
+ sh:closed true ;
+ sh:property [
+ sh:path sh:alternativePath ;
+ sh:node shsh:PathListWithAtLeast2Members ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ]
+ ]
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path
+ sh:closed true ;
+ sh:property [
+ sh:path sh:inversePath ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ]
+ ]
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path
+ sh:closed true ;
+ sh:property [
+ sh:path sh:zeroOrMorePath ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ]
+ ]
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path
+ sh:closed true ;
+ sh:property [
+ sh:path sh:oneOrMorePath ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ]
+ ]
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path
+ sh:closed true ;
+ sh:property [
+ sh:path sh:zeroOrOnePath ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ]
+ ]
+ ) .
+
+shsh:PathListWithAtLeast2Members
+ a sh:NodeShape ;
+ sh:node shsh:ListShape ;
+ sh:property [
+ sh:path [ sh:oneOrMorePath rdf:rest ] ;
+ sh:minCount 2 ; # 1 other list node plus rdf:nil
+ ] .
+
+shsh:ShapesGraphShape
+ a sh:NodeShape ;
+ sh:targetObjectsOf sh:shapesGraph ;
+ sh:nodeKind sh:IRI . # shapesGraph-nodeKind
+
+shsh:EntailmentShape
+ a sh:NodeShape ;
+ sh:targetObjectsOf sh:entailment ;
+ sh:nodeKind sh:IRI . # entailment-nodeKind
diff --git a/tests/w3c-shacl/core/complex/shacl-shacl.ttl b/tests/w3c-shacl/core/complex/shacl-shacl.ttl
new file mode 100644
index 00000000..88907147
--- /dev/null
+++ b/tests/w3c-shacl/core/complex/shacl-shacl.ttl
@@ -0,0 +1,19 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<> a mf:Manifest ;
+ mf:entries (
+ <shacl-shacl>
+ ) .
+
+<shacl-shacl> a sht:Validate ;
+ rdfs:label "frozen eat your own ( eat your own frozen dogfood )" ;
+ mf:action [
+ sht:dataGraph <shacl-shacl-data-shapes.ttl> ;
+ sht:shapesGraph <shacl-shacl-data-shapes.ttl> ] ;
+ mf:result [a sh:ValidationReport ;
+ sh:conforms "true"^^xsd:boolean ] ;
+ mf:status sht:approved .
diff --git a/tests/w3c-shacl/core/manifest.ttl b/tests/w3c-shacl/core/manifest.ttl
new file mode 100644
index 00000000..ffd61b64
--- /dev/null
+++ b/tests/w3c-shacl/core/manifest.ttl
@@ -0,0 +1,14 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ mf:include <complex/manifest.ttl> ;
+ mf:include <misc/manifest.ttl> ;
+ mf:include <node/manifest.ttl> ;
+ mf:include <path/manifest.ttl> ;
+ mf:include <property/manifest.ttl> ;
+ mf:include <targets/manifest.ttl> ;
+ mf:include <validation-reports/manifest.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/core/misc/deactivated-001.ttl b/tests/w3c-shacl/core/misc/deactivated-001.ttl
new file mode 100644
index 00000000..809acde9
--- /dev/null
+++ b/tests/w3c-shacl/core/misc/deactivated-001.ttl
@@ -0,0 +1,44 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/misc/deactivated-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource
+ rdf:type rdfs:Resource ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:datatype xsd:boolean ;
+ sh:deactivated "true"^^xsd:boolean ;
+ sh:property ex:TestShape2 ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape2
+ rdf:type sh:PropertyShape ;
+ sh:path ex:property ;
+ sh:minCount 1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <deactivated-001>
+ ) ;
+.
+<deactivated-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:deactivated 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "true"^^xsd:boolean ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/misc/deactivated-002.ttl b/tests/w3c-shacl/core/misc/deactivated-002.ttl
new file mode 100644
index 00000000..0498150f
--- /dev/null
+++ b/tests/w3c-shacl/core/misc/deactivated-002.ttl
@@ -0,0 +1,43 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/misc/deactivated-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:datatype xsd:boolean ;
+ sh:deactivated "false"^^xsd:boolean ;
+ sh:targetNode 32 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <deactivated-002>
+ ) ;
+.
+<deactivated-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:deactivated 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 32 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 32 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/misc/manifest.ttl b/tests/w3c-shacl/core/misc/manifest.ttl
new file mode 100644
index 00000000..fffc439c
--- /dev/null
+++ b/tests/w3c-shacl/core/misc/manifest.ttl
@@ -0,0 +1,13 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/misc" ;
+ mf:include <deactivated-001.ttl> ;
+ mf:include <deactivated-002.ttl> ;
+ mf:include <message-001.ttl> ;
+ mf:include <severity-001.ttl> ;
+ mf:include <severity-002.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/core/misc/message-001.ttl b/tests/w3c-shacl/core/misc/message-001.ttl
new file mode 100644
index 00000000..2d3fb135
--- /dev/null
+++ b/tests/w3c-shacl/core/misc/message-001.ttl
@@ -0,0 +1,48 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/misc/message-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:datatype xsd:integer ;
+ sh:message "Test message"@en ;
+ sh:targetNode ex:InvalidNode ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <message-001>
+ ) ;
+.
+<message-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of custom sh:message 001" ;
+ rdfs:comment """
+ Note: This test verifies that the sh:message is copied into sh:resultMessage.
+ To pass this test, the test harness needs to preserve all sh:resultMessage triples
+ that are mentioned in the 'expected' results graph.""" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidNode ;
+ sh:resultMessage "Test message"@en ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidNode ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/misc/severity-001.ttl b/tests/w3c-shacl/core/misc/severity-001.ttl
new file mode 100644
index 00000000..5b3e6b8c
--- /dev/null
+++ b/tests/w3c-shacl/core/misc/severity-001.ttl
@@ -0,0 +1,43 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/misc/severity-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:datatype xsd:integer ;
+ sh:severity sh:Warning ;
+ sh:targetNode "Hello" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <severity-001>
+ ) ;
+.
+<severity-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:severity 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hello" ;
+ sh:resultSeverity sh:Warning ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hello" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/misc/severity-002.ttl b/tests/w3c-shacl/core/misc/severity-002.ttl
new file mode 100644
index 00000000..87b2aed7
--- /dev/null
+++ b/tests/w3c-shacl/core/misc/severity-002.ttl
@@ -0,0 +1,60 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/misc/severity-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property "true"^^xsd:boolean ;
+.
+ex:TestShape1
+ sh:nodeKind sh:BlankNode ;
+ sh:property ex:TestShape2 ;
+ sh:severity ex:MySeverity ;
+ sh:targetNode ex:InvalidResource1 ;
+.
+ex:TestShape2
+ sh:path ex:property ;
+ sh:datatype xsd:integer ;
+ sh:severity sh:Info ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <severity-002>
+ ) ;
+.
+<severity-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:severity 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Info ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape2 ;
+ sh:value "true"^^xsd:boolean ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultSeverity ex:MySeverity ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape ex:TestShape1 ;
+ sh:value ex:InvalidResource1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/and-001.ttl b/tests/w3c-shacl/core/node/and-001.ttl
new file mode 100644
index 00000000..d0d86768
--- /dev/null
+++ b/tests/w3c-shacl/core/node/and-001.ttl
@@ -0,0 +1,77 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/and-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidRectangle1
+ rdf:type ex:Rectangle ;
+ ex:height 3 ;
+.
+ex:InvalidRectangle2
+ rdf:type ex:Rectangle ;
+ ex:width 2 ;
+.
+ex:Rectangle
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:subClassOf rdfs:Resource ;
+ sh:and (
+ [
+ sh:property [
+ sh:path ex:width ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ [
+ sh:property [
+ sh:path ex:height ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ ) ;
+.
+ex:ValidRectangle1
+ rdf:type ex:Rectangle ;
+ ex:height 3 ;
+ ex:width 2 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <and-001>
+ ) ;
+.
+<and-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:and at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidRectangle1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:AndConstraintComponent ;
+ sh:sourceShape ex:Rectangle ;
+ sh:value ex:InvalidRectangle1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidRectangle2 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:AndConstraintComponent ;
+ sh:sourceShape ex:Rectangle ;
+ sh:value ex:InvalidRectangle2 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/and-002.ttl b/tests/w3c-shacl/core/node/and-002.ttl
new file mode 100644
index 00000000..f4b018db
--- /dev/null
+++ b/tests/w3c-shacl/core/node/and-002.ttl
@@ -0,0 +1,74 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/and-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:AndShape
+ rdf:type sh:NodeShape ;
+ sh:and (
+ ex:SuperShape
+ [
+ sh:property [
+ sh:path ex:property ;
+ sh:maxCount 1 ;
+ ] ;
+ ]
+ ) ;
+ sh:targetNode ex:InvalidInstance1 ;
+ sh:targetNode ex:InvalidInstance2 ;
+ sh:targetNode ex:ValidInstance1 ;
+.
+ex:InvalidInstance2
+ ex:property "One" ;
+ ex:property "Two" ;
+.
+ex:SuperShape
+ rdf:type sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:minCount 1 ;
+ ] ;
+.
+ex:ValidInstance1
+ ex:property "One" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <and-002>
+ ) ;
+.
+<and-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:and at node shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:AndConstraintComponent ;
+ sh:sourceShape ex:AndShape ;
+ sh:value ex:InvalidInstance1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:AndConstraintComponent ;
+ sh:sourceShape ex:AndShape ;
+ sh:value ex:InvalidInstance2 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/class-001.ttl b/tests/w3c-shacl/core/node/class-001.ttl
new file mode 100644
index 00000000..ab979774
--- /dev/null
+++ b/tests/w3c-shacl/core/node/class-001.ttl
@@ -0,0 +1,70 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/class-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:John
+ rdf:type ex:MalePerson ;
+.
+ex:MalePerson
+ rdf:type rdfs:Class ;
+ rdfs:subClassOf ex:Person ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:Quokki
+ rdf:type ex:Animal ;
+.
+ex:Someone
+ rdf:type ex:Person ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:class ex:Person ;
+ sh:targetNode ex:John ;
+ sh:targetNode ex:Quokki ;
+ sh:targetNode ex:Someone ;
+ sh:targetNode ex:Typeless ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <class-001>
+ ) ;
+.
+<class-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:class at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Quokki ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:Quokki ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Typeless ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:Typeless ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/class-002.ttl b/tests/w3c-shacl/core/node/class-002.ttl
new file mode 100644
index 00000000..71ed5e0d
--- /dev/null
+++ b/tests/w3c-shacl/core/node/class-002.ttl
@@ -0,0 +1,62 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/class-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:NamedInstance
+ rdf:type ex:TestClass ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:class ex:TestClass ;
+ sh:targetClass ex:BNodeClass ;
+ sh:targetNode ex:NamedInstance ;
+ sh:targetNode "String" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <class-002>
+ ) ;
+.
+<class-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:class at node shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "String" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "String" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b9751 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b9751 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b9751
+ rdf:type ex:BNodeClass ;
+.
+[
+ rdf:type ex:BNodeClass ;
+ rdf:type ex:TestClass ;
+].
diff --git a/tests/w3c-shacl/core/node/class-003.ttl b/tests/w3c-shacl/core/node/class-003.ttl
new file mode 100644
index 00000000..16b37be4
--- /dev/null
+++ b/tests/w3c-shacl/core/node/class-003.ttl
@@ -0,0 +1,105 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/class-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:John # not Animal
+ rdf:type ex:MalePerson ;
+.
+ex:Joe # OK
+ rdf:type ex:MalePerson ;
+ rdf:type ex:Animal ;
+.
+ex:MalePerson
+ rdf:type rdfs:Class ;
+ rdfs:subClassOf ex:Person ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:Quokki # not Person
+ rdf:type ex:Animal ;
+.
+ex:Quokkip # not Animal
+ rdf:type ex:Person ;
+.
+ex:Someone # OK
+ rdf:type ex:Person ;
+ rdf:type ex:Animal ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:class ex:Person ;
+ sh:class ex:Animal ;
+ sh:targetClass ex:MalePerson ;
+ sh:targetNode ex:John ;
+ sh:targetNode ex:Quokki ;
+ sh:targetNode ex:Quokkip ;
+ sh:targetNode ex:Someone ;
+ sh:targetNode ex:Typeless ; # not Animal, not Person
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <class-003>
+ ) ;
+.
+<class-003>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:class at node shape 003 multiple classes, overlapping target sets" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Typeless ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:Typeless ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Typeless ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:Typeless ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Quokki ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:Quokki ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:John ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:John ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Quokkip ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:Quokkip ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/closed-001.ttl b/tests/w3c-shacl/core/node/closed-001.ttl
new file mode 100644
index 00000000..6bae9de8
--- /dev/null
+++ b/tests/w3c-shacl/core/node/closed-001.ttl
@@ -0,0 +1,64 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/closed-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:SomeClass ;
+ ex:otherProperty 4 ;
+ ex:someProperty 3 ;
+.
+ex:MyShape
+ rdf:type sh:NodeShape ;
+ sh:closed "true"^^xsd:boolean ;
+ sh:property [
+ sh:path ex:someProperty ;
+ ] ;
+ sh:targetNode ex:InvalidInstance1 ;
+ sh:targetNode ex:ValidInstance1 ;
+.
+ex:ValidInstance1
+ ex:someProperty 3 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <closed-001>
+ ) ;
+.
+<closed-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:closed at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath rdf:type ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClosedConstraintComponent ;
+ sh:sourceShape ex:MyShape ;
+ sh:value ex:SomeClass ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:otherProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClosedConstraintComponent ;
+ sh:sourceShape ex:MyShape ;
+ sh:value 4 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/closed-002.ttl b/tests/w3c-shacl/core/node/closed-002.ttl
new file mode 100644
index 00000000..d72eebb4
--- /dev/null
+++ b/tests/w3c-shacl/core/node/closed-002.ttl
@@ -0,0 +1,58 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/closed-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ ex:otherProperty 4 ;
+ ex:someProperty 3 ;
+.
+ex:MyShape
+ rdf:type sh:NodeShape ;
+ sh:closed "true"^^xsd:boolean ;
+ sh:ignoredProperties (
+ rdf:type
+ ) ;
+ sh:property [
+ sh:path ex:someProperty ;
+ ] ;
+ sh:targetNode ex:InvalidInstance1 ;
+ sh:targetNode ex:ValidInstance1 ;
+.
+ex:ValidInstance1
+ rdf:type ex:SomeClass ;
+ ex:someProperty 3 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <closed-002>
+ ) ;
+.
+<closed-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:closed at node shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:otherProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClosedConstraintComponent ;
+ sh:sourceShape ex:MyShape ;
+ sh:value 4 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/datatype-001.ttl b/tests/w3c-shacl/core/node/datatype-001.ttl
new file mode 100644
index 00000000..427572d4
--- /dev/null
+++ b/tests/w3c-shacl/core/node/datatype-001.ttl
@@ -0,0 +1,64 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/datatype-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:datatype xsd:integer ;
+ sh:targetClass ex:TestClass ;
+ sh:targetNode xsd:integer ;
+ sh:targetNode 42 ;
+ sh:targetNode "aldi"^^xsd:integer ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <datatype-001>
+ ) ;
+.
+<datatype-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:datatype at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode xsd:integer ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value xsd:integer ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "aldi"^^xsd:integer ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "aldi"^^xsd:integer ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b30507 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b30507 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b30507
+ rdf:type ex:TestClass ;
+.
diff --git a/tests/w3c-shacl/core/node/datatype-002.ttl b/tests/w3c-shacl/core/node/datatype-002.ttl
new file mode 100644
index 00000000..6e9e0121
--- /dev/null
+++ b/tests/w3c-shacl/core/node/datatype-002.ttl
@@ -0,0 +1,53 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/datatype-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:datatype rdf:langString ;
+ sh:targetNode "<span>Hello</span>"^^rdf:HTML ;
+ sh:targetNode "G'day"@en-AU ;
+ sh:targetNode "Hallo"@de ;
+ sh:targetNode "Hello" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <datatype-002>
+ ) ;
+.
+<datatype-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:datatype at node shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "<span>Hello</span>"^^rdf:HTML ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "<span>Hello</span>"^^rdf:HTML ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hello" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hello" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/disjoint-001.ttl b/tests/w3c-shacl/core/node/disjoint-001.ttl
new file mode 100644
index 00000000..d98158ad
--- /dev/null
+++ b/tests/w3c-shacl/core/node/disjoint-001.ttl
@@ -0,0 +1,51 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/disjoint-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property ex:InvalidResource1 ;
+ ex:property ex:ValidResource1 ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:disjoint ex:property ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:ValidResource1
+ ex:property ex:InvalidResource1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <disjoint-001>
+ ) ;
+.
+<disjoint-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:disjoint at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DisjointConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/equals-001.ttl b/tests/w3c-shacl/core/node/equals-001.ttl
new file mode 100644
index 00000000..8f23966b
--- /dev/null
+++ b/tests/w3c-shacl/core/node/equals-001.ttl
@@ -0,0 +1,59 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/equals-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property ex:InvalidResource1 ;
+ ex:property ex:SomeValue ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:equals ex:property ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:ValidResource1
+ ex:property ex:ValidResource1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <equals-001>
+ ) ;
+.
+<equals-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:equals at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:SomeValue ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource2 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/hasValue-001.ttl b/tests/w3c-shacl/core/node/hasValue-001.ttl
new file mode 100644
index 00000000..0a9945af
--- /dev/null
+++ b/tests/w3c-shacl/core/node/hasValue-001.ttl
@@ -0,0 +1,44 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/hasValue-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:hasValue "Test" ;
+ sh:targetNode "Invalid String" ;
+ sh:targetNode "Test" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <hasValue-001>
+ ) ;
+.
+<hasValue-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:hasValue at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Invalid String" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:HasValueConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ # See See https://github.com/w3c/data-shapes/issues/111: don't create sh:value "Invalid String" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/in-001.ttl b/tests/w3c-shacl/core/node/in-001.ttl
new file mode 100644
index 00000000..8fb4c085
--- /dev/null
+++ b/tests/w3c-shacl/core/node/in-001.ttl
@@ -0,0 +1,63 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/in-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Green
+ rdf:type ex:TestShape ;
+ rdfs:label "Green" ;
+.
+ex:InvalidInstance
+ rdf:type ex:TestShape ;
+ rdfs:label "Invalid instance" ;
+.
+ex:Red
+ rdf:type ex:TestShape ;
+ rdfs:label "Red" ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:in (
+ ex:Green
+ ex:Red
+ ex:Yellow
+ ) ;
+.
+ex:Yellow
+ rdf:type ex:TestShape ;
+ rdfs:label "Yellow" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <in-001>
+ ) ;
+.
+<in-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:in at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:InConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidInstance ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/languageIn-001.ttl b/tests/w3c-shacl/core/node/languageIn-001.ttl
new file mode 100644
index 00000000..b8365d25
--- /dev/null
+++ b/tests/w3c-shacl/core/node/languageIn-001.ttl
@@ -0,0 +1,66 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/languageIn-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:languageIn (
+ "en"
+ "fr"
+ ) ;
+ sh:targetNode rdfs:Resource ;
+ sh:targetNode "Deutsch"@de ;
+ sh:targetNode "English"@en ;
+ sh:targetNode "Francais"@fr ;
+ sh:targetNode "Plain String" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <languageIn-001>
+ ) ;
+.
+<languageIn-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:languageIn at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode rdfs:Resource ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LanguageInConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value rdfs:Resource ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Deutsch"@de ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LanguageInConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Deutsch"@de ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Plain String" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LanguageInConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Plain String" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/manifest.ttl b/tests/w3c-shacl/core/node/manifest.ttl
new file mode 100644
index 00000000..50fd3167
--- /dev/null
+++ b/tests/w3c-shacl/core/node/manifest.ttl
@@ -0,0 +1,40 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/node" ;
+ mf:include <and-001.ttl> ;
+ mf:include <and-002.ttl> ;
+ mf:include <class-001.ttl> ;
+ mf:include <class-002.ttl> ;
+ mf:include <class-003.ttl> ;
+ mf:include <closed-001.ttl> ;
+ mf:include <closed-002.ttl> ;
+ mf:include <datatype-001.ttl> ;
+ mf:include <datatype-002.ttl> ;
+ mf:include <disjoint-001.ttl> ;
+ mf:include <equals-001.ttl> ;
+ mf:include <hasValue-001.ttl> ;
+ mf:include <in-001.ttl> ;
+ mf:include <languageIn-001.ttl> ;
+ mf:include <maxExclusive-001.ttl> ;
+ mf:include <maxInclusive-001.ttl> ;
+ mf:include <maxLength-001.ttl> ;
+ mf:include <minExclusive-001.ttl> ;
+ mf:include <minInclusive-001.ttl> ;
+ mf:include <minInclusive-002.ttl> ;
+ mf:include <minInclusive-003.ttl> ;
+ mf:include <minLength-001.ttl> ;
+ mf:include <node-001.ttl> ;
+ mf:include <nodeKind-001.ttl> ;
+ mf:include <not-001.ttl> ;
+ mf:include <not-002.ttl> ;
+ mf:include <or-001.ttl> ;
+ mf:include <pattern-001.ttl> ;
+ mf:include <pattern-002.ttl> ;
+ mf:include <xone-001.ttl> ;
+ mf:include <xone-duplicate.ttl> ;
+ mf:include <qualified-001.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/core/node/maxExclusive-001.ttl b/tests/w3c-shacl/core/node/maxExclusive-001.ttl
new file mode 100644
index 00000000..7c2b1771
--- /dev/null
+++ b/tests/w3c-shacl/core/node/maxExclusive-001.ttl
@@ -0,0 +1,91 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/maxExclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:maxExclusive 4 ;
+ sh:targetClass ex:TestClass ;
+ sh:targetNode ex:John ;
+ sh:targetNode 3.9 ;
+ sh:targetNode 4 ;
+ sh:targetNode 4.0 ;
+ sh:targetNode 4.1 ;
+ sh:targetNode "Hello" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxExclusive-001>
+ ) ;
+.
+<maxExclusive-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxExclusive at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:John ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:John ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 4 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 4 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 4.0 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 4.0 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 4.1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 4.1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hello" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hello" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b11982 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b11982 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b11982
+ rdf:type ex:TestClass ;
+.
diff --git a/tests/w3c-shacl/core/node/maxInclusive-001.ttl b/tests/w3c-shacl/core/node/maxInclusive-001.ttl
new file mode 100644
index 00000000..f30c9425
--- /dev/null
+++ b/tests/w3c-shacl/core/node/maxInclusive-001.ttl
@@ -0,0 +1,75 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/maxInclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:maxInclusive 4 ;
+ sh:targetClass ex:TestClass ;
+ sh:targetNode ex:John ;
+ sh:targetNode 3.9 ;
+ sh:targetNode 4 ;
+ sh:targetNode 4.0 ;
+ sh:targetNode 4.1 ;
+ sh:targetNode "Hello" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxInclusive-001>
+ ) ;
+.
+<maxInclusive-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxInclusive at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:John ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:John ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 4.1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 4.1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hello" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hello" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b22005 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b22005 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b22005
+ rdf:type ex:TestClass ;
+.
diff --git a/tests/w3c-shacl/core/node/maxLength-001.ttl b/tests/w3c-shacl/core/node/maxLength-001.ttl
new file mode 100644
index 00000000..bd197e25
--- /dev/null
+++ b/tests/w3c-shacl/core/node/maxLength-001.ttl
@@ -0,0 +1,87 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/maxLength-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:maxLength 4 ;
+ sh:targetClass ex:TestClass ;
+ sh:targetNode <a:b> ;
+ sh:targetNode ex:John ;
+ sh:targetNode 123 ;
+ sh:targetNode 1234 ;
+ sh:targetNode 12345 ;
+ sh:targetNode "2017-03-29"^^xsd:date ;
+ sh:targetNode "Hel" ;
+ sh:targetNode "Hell" ;
+ sh:targetNode "Hell"@en ;
+ sh:targetNode "Hello" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxLength-001>
+ ) ;
+.
+<maxLength-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxLength at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:John ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:John ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 12345 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 12345 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "2017-03-29"^^xsd:date ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "2017-03-29"^^xsd:date ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hello" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hello" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b34236 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b34236 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b34236
+ rdf:type ex:TestClass ;
+.
diff --git a/tests/w3c-shacl/core/node/minExclusive-001.ttl b/tests/w3c-shacl/core/node/minExclusive-001.ttl
new file mode 100644
index 00000000..72191504
--- /dev/null
+++ b/tests/w3c-shacl/core/node/minExclusive-001.ttl
@@ -0,0 +1,91 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/minExclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:minExclusive 4 ;
+ sh:targetClass ex:TestClass ;
+ sh:targetNode ex:John ;
+ sh:targetNode 3.9 ;
+ sh:targetNode 4 ;
+ sh:targetNode 4.0 ;
+ sh:targetNode 4.1 ;
+ sh:targetNode "Hello" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minExclusive-001>
+ ) ;
+.
+<minExclusive-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minExclusive at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:John ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:John ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 3.9 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 3.9 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 4 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 4 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 4.0 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 4.0 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hello" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hello" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b33079 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b33079 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b33079
+ rdf:type ex:TestClass ;
+.
diff --git a/tests/w3c-shacl/core/node/minInclusive-001.ttl b/tests/w3c-shacl/core/node/minInclusive-001.ttl
new file mode 100644
index 00000000..e2113bf0
--- /dev/null
+++ b/tests/w3c-shacl/core/node/minInclusive-001.ttl
@@ -0,0 +1,44 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/minInclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:minInclusive 8 ;
+ sh:targetNode 7 ;
+ sh:targetNode 8 ;
+ sh:targetNode 9 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minInclusive-001>
+ ) ;
+.
+<minInclusive-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minInclusive at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 7 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 7 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/minInclusive-002.ttl b/tests/w3c-shacl/core/node/minInclusive-002.ttl
new file mode 100644
index 00000000..e9a8d5ee
--- /dev/null
+++ b/tests/w3c-shacl/core/node/minInclusive-002.ttl
@@ -0,0 +1,61 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/minInclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape a sh:NodeShape ;
+ sh:minInclusive "2002-10-10T12:00:00-05:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ;
+ sh:targetNode ex:TestShape ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minInclusive-002>
+ ) ;
+.
+<minInclusive-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minInclusive at node shape 002 - dateTime with timezone" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "2002-10-10T12:00:00"^^xsd:dateTime ;
+ sh:value "2002-10-10T12:00:00"^^xsd:dateTime ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ;
+ sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:TestShape ;
+ sh:value ex:TestShape ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/minInclusive-003.ttl b/tests/w3c-shacl/core/node/minInclusive-003.ttl
new file mode 100644
index 00000000..306ca78b
--- /dev/null
+++ b/tests/w3c-shacl/core/node/minInclusive-003.ttl
@@ -0,0 +1,70 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/minInclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:minInclusive "2002-10-10T12:00:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ;
+ sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ;
+ sh:targetNode ex:TestShape ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minInclusive-003>
+ ) ;
+.
+<minInclusive-003>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minInclusive at node shape 003 - dateTime without timezone" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "2002-10-10T12:00:00-05:00"^^xsd:dateTime ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "2002-10-10T12:00:01-05:00"^^xsd:dateTime ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:TestShape ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/minLength-001.ttl b/tests/w3c-shacl/core/node/minLength-001.ttl
new file mode 100644
index 00000000..75151fe7
--- /dev/null
+++ b/tests/w3c-shacl/core/node/minLength-001.ttl
@@ -0,0 +1,79 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/minLength-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:minLength 4 ;
+ sh:targetClass ex:TestClass ;
+ sh:targetNode <a:b> ;
+ sh:targetNode ex:John ;
+ sh:targetNode 123 ;
+ sh:targetNode 1234 ;
+ sh:targetNode 12345 ;
+ sh:targetNode "2017-03-29"^^xsd:date ;
+ sh:targetNode "Hel" ;
+ sh:targetNode "Hell" ;
+ sh:targetNode "Hell"@en ;
+ sh:targetNode "Hello" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minLength-001>
+ ) ;
+.
+<minLength-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minLength at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode <a:b> ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value <a:b> ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 123 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 123 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hel" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hel" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b19019 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b19019 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b19019
+ rdf:type ex:TestClass ;
+.
diff --git a/tests/w3c-shacl/core/node/node-001.ttl b/tests/w3c-shacl/core/node/node-001.ttl
new file mode 100644
index 00000000..b6d71708
--- /dev/null
+++ b/tests/w3c-shacl/core/node/node-001.ttl
@@ -0,0 +1,55 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/node-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance
+ rdf:type ex:TestClass ;
+ rdfs:label "Invalid instance" ;
+.
+ex:TestClass
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test class" ;
+ rdfs:subClassOf rdfs:Resource ;
+ sh:node [
+ sh:class ex:OtherClass ;
+ ] ;
+.
+ex:ValidInstance
+ rdf:type ex:OtherClass ;
+ rdf:type ex:TestClass ;
+ rdfs:label "Valid instance" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <node-001>
+ ) ;
+.
+<node-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:node at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeConstraintComponent ;
+ sh:sourceShape ex:TestClass ;
+ sh:value ex:InvalidInstance ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/nodeKind-001.ttl b/tests/w3c-shacl/core/node/nodeKind-001.ttl
new file mode 100644
index 00000000..004f8fa2
--- /dev/null
+++ b/tests/w3c-shacl/core/node/nodeKind-001.ttl
@@ -0,0 +1,43 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/nodeKind-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:IRITestShape
+ rdf:type sh:NodeShape ;
+ sh:nodeKind sh:IRI ;
+ sh:targetNode ex:John ;
+ sh:targetNode "true"^^xsd:boolean ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <nodeKind-001>
+ ) ;
+.
+<nodeKind-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:nodeKind at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "true"^^xsd:boolean ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape ex:IRITestShape ;
+ sh:value "true"^^xsd:boolean ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/not-001.ttl b/tests/w3c-shacl/core/node/not-001.ttl
new file mode 100644
index 00000000..588436cf
--- /dev/null
+++ b/tests/w3c-shacl/core/node/not-001.ttl
@@ -0,0 +1,59 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/not-001#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ ex:property "some value" ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ rdfs:subClassOf rdfs:Resource ;
+ sh:not [
+ rdf:type sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:minCount 1 ;
+ ] ;
+ ] ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <not-001>
+ ) ;
+.
+<not-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:not at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NotConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/not-002.ttl b/tests/w3c-shacl/core/node/not-002.ttl
new file mode 100644
index 00000000..cf43632d
--- /dev/null
+++ b/tests/w3c-shacl/core/node/not-002.ttl
@@ -0,0 +1,52 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/not-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ ex:property "Some value" ;
+.
+ex:NotExampleShape
+ rdf:type sh:NodeShape ;
+ sh:not [
+ rdf:type sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:minCount 1 ;
+ ] ;
+ ] ;
+ sh:targetNode ex:InvalidInstance1 ;
+ sh:targetNode ex:ValidInstance1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <not-002>
+ ) ;
+.
+<not-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:not at node shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NotConstraintComponent ;
+ sh:sourceShape ex:NotExampleShape ;
+ sh:value ex:InvalidInstance1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/or-001.ttl b/tests/w3c-shacl/core/node/or-001.ttl
new file mode 100644
index 00000000..455c8c64
--- /dev/null
+++ b/tests/w3c-shacl/core/node/or-001.ttl
@@ -0,0 +1,91 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/or-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidRectangle1
+ rdf:type ex:RectangleWithArea ;
+ ex:height 3 ;
+.
+ex:InvalidRectangle2
+ rdf:type ex:RectangleWithArea ;
+.
+ex:RectangleWithArea
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:subClassOf rdfs:Resource ;
+ sh:or (
+ [
+ sh:property [
+ sh:path ex:height ;
+ sh:minCount 1 ;
+ ] ;
+ sh:property [
+ sh:path ex:width ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ [
+ sh:property [
+ sh:path ex:area ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ ) ;
+.
+ex:ValidRectangle1
+ rdf:type ex:RectangleWithArea ;
+ ex:height 3 ;
+ ex:width 2 ;
+.
+ex:ValidRectangle2
+ rdf:type ex:RectangleWithArea ;
+ ex:area 6 ;
+ ex:height 3 ;
+ ex:width 2 ;
+.
+ex:ValidRectangle3
+ rdf:type ex:RectangleWithArea ;
+ ex:area 6 ;
+ ex:height 3 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <or-001>
+ ) ;
+.
+<or-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:or at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidRectangle1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:OrConstraintComponent ;
+ sh:sourceShape ex:RectangleWithArea ;
+ sh:value ex:InvalidRectangle1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidRectangle2 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:OrConstraintComponent ;
+ sh:sourceShape ex:RectangleWithArea ;
+ sh:value ex:InvalidRectangle2 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/pattern-001.ttl b/tests/w3c-shacl/core/node/pattern-001.ttl
new file mode 100644
index 00000000..31d77efc
--- /dev/null
+++ b/tests/w3c-shacl/core/node/pattern-001.ttl
@@ -0,0 +1,76 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/pattern-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:pattern "^[2-8][0-9]*$" ;
+ sh:targetClass ex:TestClass ;
+ sh:targetNode ex:Test ;
+ sh:targetNode 20000123 ;
+ sh:targetNode "3456" ;
+ sh:targetNode 39 ;
+ sh:targetNode "777777"@mi ;
+ sh:targetNode 9 ;
+ sh:targetNode "John" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pattern-001>
+ ) ;
+.
+<pattern-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:pattern at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Test ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:Test ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode 9 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value 9 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "John" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "John" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode _:b22415 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value _:b22415 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b22415
+ rdf:type ex:TestClass ;
+.
diff --git a/tests/w3c-shacl/core/node/pattern-002.ttl b/tests/w3c-shacl/core/node/pattern-002.ttl
new file mode 100644
index 00000000..fadc4d9a
--- /dev/null
+++ b/tests/w3c-shacl/core/node/pattern-002.ttl
@@ -0,0 +1,45 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/pattern-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:flags "i" ;
+ sh:pattern "Aldi" ;
+ sh:targetNode "Aldi" ;
+ sh:targetNode "Alti" ;
+ sh:targetNode "aLdI" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pattern-002>
+ ) ;
+.
+<pattern-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:pattern at node shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Alti" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Alti" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/qualified-001-data.ttl b/tests/w3c-shacl/core/node/qualified-001-data.ttl
new file mode 100644
index 00000000..e495305d
--- /dev/null
+++ b/tests/w3c-shacl/core/node/qualified-001-data.ttl
@@ -0,0 +1,4 @@
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:i a ex:C1 .
+ex:j a ex:C1 , ex:C2 .
diff --git a/tests/w3c-shacl/core/node/qualified-001-shapes.ttl b/tests/w3c-shacl/core/node/qualified-001-shapes.ttl
new file mode 100644
index 00000000..f430a7e0
--- /dev/null
+++ b/tests/w3c-shacl/core/node/qualified-001-shapes.ttl
@@ -0,0 +1,10 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:s1 a sh:NodeShape ;
+ sh:targetClass ex:C1 ;
+ sh:class ex:C2 ;
+ sh:qualifiedValueShapesDisjoint "1"^^xsd:boolean ;
+ sh:qualifiedMinCount 5 ;
+ sh:qualifiedMaxCount 2 .
diff --git a/tests/w3c-shacl/core/node/qualified-001.ttl b/tests/w3c-shacl/core/node/qualified-001.ttl
new file mode 100644
index 00000000..6a89c099
--- /dev/null
+++ b/tests/w3c-shacl/core/node/qualified-001.ttl
@@ -0,0 +1,28 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+@prefix ex: <http://example.org/shacl-test/> .
+
+<> a mf:Manifest ;
+ mf:entries (
+ <qualified-001>
+ ) .
+
+<qualified-001> a sht:Validate;
+ rdfs:label "Test of qualified parameters allowed in node shapes" ;
+ mf:action [ sht:dataGraph <qualified-001-data.ttl> ;
+ sht:shapesGraph <qualified-001-shapes.ttl> ] ;
+ mf:result [ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:i ;
+ sh:value ex:i ;
+ sh:sourceShape ex:s1 ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ] ] ;
+ mf:status sht:approved .
diff --git a/tests/w3c-shacl/core/node/xone-001.ttl b/tests/w3c-shacl/core/node/xone-001.ttl
new file mode 100644
index 00000000..79011d8b
--- /dev/null
+++ b/tests/w3c-shacl/core/node/xone-001.ttl
@@ -0,0 +1,74 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/node/xone-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Bob
+ rdf:type ex:Person ;
+ ex:firstName "Robert" ;
+ ex:lastName "Coin" ;
+.
+ex:Carla
+ rdf:type ex:Person ;
+ ex:fullName "Carla Miller" ;
+.
+ex:Dory
+ rdf:type ex:Person ;
+ ex:firstName "Dory" ;
+ ex:fullName "Dory Dunce" ;
+ ex:lastName "Dunce" ;
+.
+ex:XoneConstraintExampleShape
+ rdf:type sh:NodeShape ;
+ sh:targetClass ex:Person ;
+ sh:xone (
+ [
+ sh:property [
+ sh:path ex:fullName ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ [
+ sh:property [
+ sh:path ex:firstName ;
+ sh:minCount 1 ;
+ ] ;
+ sh:property [
+ sh:path ex:lastName ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ ) ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <xone-001>
+ ) ;
+.
+<xone-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:xone at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Dory ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:XoneConstraintComponent ;
+ sh:sourceShape ex:XoneConstraintExampleShape ;
+ sh:value ex:Dory ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/node/xone-duplicate-data.ttl b/tests/w3c-shacl/core/node/xone-duplicate-data.ttl
new file mode 100644
index 00000000..e495305d
--- /dev/null
+++ b/tests/w3c-shacl/core/node/xone-duplicate-data.ttl
@@ -0,0 +1,4 @@
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:i a ex:C1 .
+ex:j a ex:C1 , ex:C2 .
diff --git a/tests/w3c-shacl/core/node/xone-duplicate-shapes.ttl b/tests/w3c-shacl/core/node/xone-duplicate-shapes.ttl
new file mode 100644
index 00000000..eecb657d
--- /dev/null
+++ b/tests/w3c-shacl/core/node/xone-duplicate-shapes.ttl
@@ -0,0 +1,7 @@
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:s1 a sh:NodeShape ;
+ sh:targetClass ex:C1 ;
+ sh:xone ( ex:s2 ex:s2 ) .
+ex:s2 sh:class ex:C2 .
diff --git a/tests/w3c-shacl/core/node/xone-duplicate.ttl b/tests/w3c-shacl/core/node/xone-duplicate.ttl
new file mode 100644
index 00000000..0999905f
--- /dev/null
+++ b/tests/w3c-shacl/core/node/xone-duplicate.ttl
@@ -0,0 +1,34 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+@prefix ex: <http://example.org/shacl-test/> .
+
+<> a mf:Manifest ;
+ mf:entries (
+ <xone-duplicate>
+ ) .
+
+<xone-duplicate> a sht:Validate;
+ rdfs:label "Test of validation report for shape xone-duplicate by property constraints" ;
+ mf:action [ sht:dataGraph <xone-duplicate-data.ttl> ;
+ sht:shapesGraph <xone-duplicate-shapes.ttl> ] ;
+ mf:result [ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:i ;
+ sh:value ex:i ;
+ sh:sourceShape ex:s1 ;
+ sh:sourceConstraintComponent sh:XoneConstraintComponent ] ;
+ sh:result [ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:j ;
+ sh:value ex:j ;
+ sh:sourceShape ex:s1 ;
+ sh:sourceConstraintComponent sh:XoneConstraintComponent ] ] ;
+ mf:status sht:approved .
diff --git a/tests/w3c-shacl/core/path/manifest.ttl b/tests/w3c-shacl/core/path/manifest.ttl
new file mode 100644
index 00000000..3c355e87
--- /dev/null
+++ b/tests/w3c-shacl/core/path/manifest.ttl
@@ -0,0 +1,21 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/path" ;
+ mf:include <path-alternative-001.ttl> ;
+ mf:include <path-complex-001.ttl> ;
+ mf:include <path-complex-002.ttl> ;
+ mf:include <path-inverse-001.ttl> ;
+ mf:include <path-oneOrMore-001.ttl> ;
+ mf:include <path-sequence-001.ttl> ;
+ mf:include <path-sequence-002.ttl> ;
+ mf:include <path-sequence-duplicate-001.ttl> ;
+ mf:include <path-strange-001.ttl> ;
+ mf:include <path-strange-002.ttl> ;
+ mf:include <path-zeroOrMore-001.ttl> ;
+ mf:include <path-zeroOrOne-001.ttl> ;
+ mf:include <path-unused-001.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/core/path/path-alternative-001.ttl b/tests/w3c-shacl/core/path/path-alternative-001.ttl
new file mode 100644
index 00000000..ea267647
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-alternative-001.ttl
@@ -0,0 +1,86 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-alternative-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 "One" ;
+ ex:property3 "Three" ;
+.
+ex:TestShape
+ rdf:type sh:PropertyShape ;
+ sh:path [
+ sh:alternativePath (
+ ex:property1
+ ex:property2
+ ) ;
+ ] ;
+ sh:minCount 2 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+ sh:targetNode ex:ValidResource3 ;
+.
+ex:ValidResource1
+ ex:property1 "One" ;
+ ex:property1 "Two" ;
+.
+ex:ValidResource2
+ ex:property1 "One" ;
+ ex:property2 "Two" ;
+.
+ex:ValidResource3
+ ex:property2 "One" ;
+ ex:property2 "Two" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-alternative-001>
+ ) ;
+.
+<path-alternative-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sh:alternativePath 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath [
+ sh:alternativePath (
+ ex:property1
+ ex:property2
+ ) ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath [
+ sh:alternativePath (
+ ex:property1
+ ex:property2
+ ) ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-complex-001.ttl b/tests/w3c-shacl/core/path/path-complex-001.ttl
new file mode 100644
index 00000000..c5e20737
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-complex-001.ttl
@@ -0,0 +1,91 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-complex-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource
+ rdf:type ex:Animal ;
+ rdfs:label "Invalid" ;
+.
+ex:MalePerson
+ rdf:type rdfs:Class ;
+ rdfs:subClassOf ex:Person ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+.
+ex:TestShape
+ rdf:type sh:PropertyShape ;
+ sh:path (
+ rdf:type
+ [
+ sh:zeroOrMorePath rdfs:subClassOf ;
+ ]
+ ) ;
+ sh:hasValue ex:Person ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+ sh:targetNode ex:ValidResource3 ;
+.
+ex:ValidResource1
+ rdf:type ex:Person ;
+.
+ex:ValidResource2
+ rdf:type ex:MalePerson ;
+.
+ex:ValidResource3
+ rdf:type ex:Animal ;
+ rdf:type ex:MalePerson ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-complex-001>
+ ) ;
+.
+<path-complex-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path complex (rdf:type/rdfs:subClassOf*) 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath (
+ rdf:type
+ [
+ sh:zeroOrMorePath rdfs:subClassOf ;
+ ]
+ ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:HasValueConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath (
+ rdf:type
+ [
+ sh:zeroOrMorePath rdfs:subClassOf ;
+ ]
+ ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:HasValueConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-complex-002-data.ttl b/tests/w3c-shacl/core/path/path-complex-002-data.ttl
new file mode 100644
index 00000000..fdec8c78
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-complex-002-data.ttl
@@ -0,0 +1,7 @@
+@prefix ex: <http://example.org/shacl/tests/> .
+
+ex:j ex:p ex:i .
+
+ex:k ex:p ex:j .
+
+ex:l ex:p ex:j .
diff --git a/tests/w3c-shacl/core/path/path-complex-002-shapes.ttl b/tests/w3c-shacl/core/path/path-complex-002-shapes.ttl
new file mode 100644
index 00000000..f9e8a73b
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-complex-002-shapes.ttl
@@ -0,0 +1,14 @@
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix ex: <http://example.org/shacl/tests/> .
+
+ex:s1 a sh:PropertyShape ;
+ sh:targetNode ex:i ;
+ sh:path ( _:pinv _:pinv ) ;
+ sh:class ex:C .
+
+_:pinv sh:inversePath ex:p .
+
+ex:s2 a sh:PropertyShape ;
+ sh:targetNode ex:i ;
+ sh:path ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ;
+ sh:class ex:C .
diff --git a/tests/w3c-shacl/core/path/path-complex-002.ttl b/tests/w3c-shacl/core/path/path-complex-002.ttl
new file mode 100644
index 00000000..fdfcfe5c
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-complex-002.ttl
@@ -0,0 +1,51 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://example.org/shacl/tests/> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<> a mf:Manifest ;
+ mf:entries (
+ <path-complex-002>
+ ) .
+
+<path-complex-002> a sht:Validate ;
+ rdfs:label "Test of complex path validation results" ;
+ mf:action [
+ sht:dataGraph <path-complex-002-data.ttl> ;
+ sht:shapesGraph <path-complex-002-shapes.ttl> ] ;
+ mf:result [ a sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [ a sh:ValidationResult ;
+ sh:focusNode ex:i ;
+ sh:value ex:k ;
+ sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:s1 ] ;
+ sh:result [ a sh:ValidationResult ;
+ sh:focusNode ex:i ;
+ sh:value ex:l ;
+ sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:s1 ] ;
+ sh:result [ a sh:ValidationResult ;
+ sh:focusNode ex:i ;
+ sh:value ex:l ;
+ sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:s2 ] ;
+ sh:result [ a sh:ValidationResult ;
+ sh:focusNode ex:i ;
+ sh:value ex:k ;
+ sh:resultPath( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:s2 ] ] ;
+ mf:status sht:approved .
diff --git a/tests/w3c-shacl/core/path/path-inverse-001.ttl b/tests/w3c-shacl/core/path/path-inverse-001.ttl
new file mode 100644
index 00000000..a4c4ac4d
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-inverse-001.ttl
@@ -0,0 +1,90 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-inverse-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type ex:Person ;
+.
+ex:InvalidResource2
+ rdf:type ex:Person ;
+.
+ex:Parent1
+ ex:child ex:InvalidResource1 ;
+ ex:child ex:InvalidResource2 ;
+ ex:child ex:ValidResource1 ;
+.
+ex:Parent2
+ ex:child ex:InvalidResource2 ;
+ ex:child ex:ValidResource1 ;
+.
+ex:Parent3
+ ex:child ex:InvalidResource2 ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Person" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-P ;
+ sh:targetClass ex:Person ;
+.
+ex:TestShape-P
+ rdf:type sh:PropertyShape ;
+ sh:path [
+ sh:inversePath ex:child ;
+ ] ;
+ sh:maxCount 2 ;
+ sh:minCount 2 ;
+.
+ex:ValidResource1
+ rdf:type ex:Person ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-inverse-001>
+ ) ;
+.
+<path-inverse-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sh:inversePath 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath [
+ sh:inversePath ex:child ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape-P ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath [
+ sh:inversePath ex:child ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:TestShape-P ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-oneOrMore-001.ttl b/tests/w3c-shacl/core/path/path-oneOrMore-001.ttl
new file mode 100644
index 00000000..97d4e030
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-oneOrMore-001.ttl
@@ -0,0 +1,71 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-oneOrMore-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+.
+ex:InvalidResource2
+ ex:child ex:Person2 ;
+.
+ex:Person1
+ ex:child ex:Person2 ;
+.
+ex:TestShape
+ rdf:type sh:PropertyShape ;
+ sh:path [
+ sh:oneOrMorePath ex:child ;
+ ] ;
+ sh:minCount 2 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:ValidResource1
+ ex:child ex:Person1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-oneOrMore-001>
+ ) ;
+.
+<path-oneOrMore-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sh:oneOrMorePath 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath [
+ sh:oneOrMorePath ex:child ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath [
+ sh:oneOrMorePath ex:child ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-sequence-001.ttl b/tests/w3c-shacl/core/path/path-sequence-001.ttl
new file mode 100644
index 00000000..65ec5292
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-sequence-001.ttl
@@ -0,0 +1,80 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-sequence-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 ex:Node3 ;
+ ex:property2 ex:Node4 ;
+.
+ex:Node1
+ ex:property2 "One" ;
+.
+ex:Node2
+ ex:property2 "Two" ;
+.
+ex:TestShape
+ rdf:type sh:PropertyShape ;
+ sh:path (
+ ex:property1
+ ex:property2
+ ) ;
+ sh:minCount 1 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:ValidResource1
+ ex:property1 ex:Node1 ;
+.
+ex:ValidResource2
+ ex:property1 ex:Node1 ;
+ ex:property1 ex:Node2 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-sequence-001>
+ ) ;
+.
+<path-sequence-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sequence 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath (
+ ex:property1
+ ex:property2
+ ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath (
+ ex:property1
+ ex:property2
+ ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-sequence-002.ttl b/tests/w3c-shacl/core/path/path-sequence-002.ttl
new file mode 100644
index 00000000..4ae6698b
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-sequence-002.ttl
@@ -0,0 +1,83 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-sequence-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 ex:Node3 ;
+ ex:property2 ex:Node4 ;
+.
+ex:Node1
+ ex:property2 ex:Node2 ;
+.
+ex:Node2
+ ex:property3 "Value" ;
+.
+ex:TestShape
+ rdf:type sh:PropertyShape ;
+ sh:path (
+ ex:property1
+ ex:property2
+ ex:property3
+ ) ;
+ sh:minCount 1 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:ValidResource1
+ ex:property1 ex:Node1 ;
+.
+ex:ValidResource2
+ ex:property1 ex:Node1 ;
+ ex:property1 ex:Node2 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-sequence-002>
+ ) ;
+.
+<path-sequence-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sequence 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath (
+ ex:property1
+ ex:property2
+ ex:property3
+ ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath (
+ ex:property1
+ ex:property2
+ ex:property3
+ ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-sequence-duplicate-001.ttl b/tests/w3c-shacl/core/path/path-sequence-duplicate-001.ttl
new file mode 100644
index 00000000..81264c57
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-sequence-duplicate-001.ttl
@@ -0,0 +1,63 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-sequence-duplicate-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:A
+ ex:p1 [
+ ex:p2 "value" ;
+ ] ;
+ ex:p1 [
+ ex:p2 "value" ;
+ ] ;
+.
+ex:S
+ rdf:type sh:NodeShape ;
+ sh:property ex:SP ;
+ sh:targetNode ex:A ;
+.
+ex:SP
+ rdf:type sh:PropertyShape ;
+ sh:path (
+ ex:p1
+ ex:p2
+ ) ;
+ sh:maxCount 1 ;
+ sh:nodeKind sh:IRI ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-sequence-duplicate-001>
+ ) ;
+.
+<path-sequence-duplicate-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sequence with duplicate 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:A ;
+ sh:resultPath (
+ ex:p1
+ ex:p2
+ ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape ex:SP ;
+ sh:value "value" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-strange-001.ttl b/tests/w3c-shacl/core/path/path-strange-001.ttl
new file mode 100644
index 00000000..2409cb40
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-strange-001.ttl
@@ -0,0 +1,52 @@
+@prefix ex: <http://example.org/test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:i a ex:C ;
+ ex:p ex:ip .
+ex:ip ex:q ex:ipq .
+ex:ipq a ex:C .
+ex:pi ex:p ex:i .
+
+ex:j a ex:C ;
+ ex:p ex:jp .
+ex:jp ex:q ex:jpq .
+
+ex:s1 a sh:PropertyShape ;
+ sh:targetClass ex:C ;
+ sh:path [ rdf:first ex:p ; rdf:rest [ rdf:first ex:q ; rdf:rest rdf:nil ] ;
+ sh:inversePath ex:p ] ;
+ sh:class ex:C .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-strange-001>
+ ) ;
+.
+
+<path-strange-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of strange path 001 two valid paths together" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [ a sh:ValidationResult ;
+ sh:focusNode ex:j ;
+ sh:value ex:jpq ;
+ sh:resultPath ( ex:p ex:q ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:s1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-strange-002.ttl b/tests/w3c-shacl/core/path/path-strange-002.ttl
new file mode 100644
index 00000000..4290f9f1
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-strange-002.ttl
@@ -0,0 +1,52 @@
+@prefix ex: <http://example.org/test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:i a ex:C ;
+ ex:p ex:ip .
+ex:ip ex:q ex:ipq .
+ex:ipq a ex:C .
+ex:pi ex:p ex:i .
+
+ex:j a ex:C ;
+ ex:p ex:jp .
+ex:jp ex:q ex:jpq .
+
+ex:s1 a sh:PropertyShape ;
+ sh:targetClass ex:C ;
+ sh:path [ rdf:first ex:p ; rdf:rest [ rdf:first ex:q ; rdf:rest rdf:nil ] ;
+ sh:inversePath ( ex:p ) ] ;
+ sh:class ex:C .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-strange-002>
+ ) ;
+.
+
+<path-strange-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of strange path 002 valid and invalid paths together" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [ a sh:ValidationResult ;
+ sh:focusNode ex:j ;
+ sh:value ex:jpq ;
+ sh:resultPath ( ex:p ex:q ) ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:s1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-unused-001-data.ttl b/tests/w3c-shacl/core/path/path-unused-001-data.ttl
new file mode 100644
index 00000000..ea38c1bb
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-unused-001-data.ttl
@@ -0,0 +1,5 @@
+@prefix ex: <http://example.org/shacl/tests/> .
+
+ex:i a ex:C .
+
+ex:j a ex:D .
diff --git a/tests/w3c-shacl/core/path/path-unused-001-shapes.ttl b/tests/w3c-shacl/core/path/path-unused-001-shapes.ttl
new file mode 100644
index 00000000..06838876
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-unused-001-shapes.ttl
@@ -0,0 +1,18 @@
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix ex: <http://example.org/shacl/tests/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+ex:s1 a sh:NodeShape ;
+ sh:targetNode ex:j, ex:i ;
+ sh:class ex:C .
+
+_:p1 sh:inversePath _:p2 .
+
+_:p2 sh:zeroOrMorePath ( _:p2 ) .
+
+_:p2 sh:zeroOrOnePath [ rdf:rest rdf:nil ] .
+
+_:p3 sh:alternativePath ( ex:p ) ;
+ rdfs:comment "invalid path" .
+
diff --git a/tests/w3c-shacl/core/path/path-unused-001.ttl b/tests/w3c-shacl/core/path/path-unused-001.ttl
new file mode 100644
index 00000000..4ae29091
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-unused-001.ttl
@@ -0,0 +1,29 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://example.org/shacl/tests/> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<> a mf:Manifest ;
+ mf:entries (
+ <path-unused-001>
+ ) .
+
+<path-unused-001> a sht:Validate ;
+ rdfs:label "Test with unused ill-formed path" ;
+ mf:action [
+ sht:dataGraph <path-unused-001-data.ttl> ;
+ sht:shapesGraph <path-unused-001-shapes.ttl> ] ;
+ mf:result [ a sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [ a sh:ValidationResult ;
+ sh:focusNode ex:j ;
+ sh:value ex:j ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceShape ex:s1 ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ] ] ;
+ mf:status sht:approved .
diff --git a/tests/w3c-shacl/core/path/path-zeroOrMore-001.ttl b/tests/w3c-shacl/core/path/path-zeroOrMore-001.ttl
new file mode 100644
index 00000000..834ab9f1
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-zeroOrMore-001.ttl
@@ -0,0 +1,61 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-zeroOrMore-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+.
+ex:Person2
+ ex:child ex:Person3 ;
+.
+ex:TestShape
+ rdf:type sh:PropertyShape ;
+ sh:path [
+ sh:zeroOrMorePath ex:child ;
+ ] ;
+ sh:minCount 2 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:ValidResource1
+ ex:child ex:Person1 ;
+.
+ex:ValidResource2
+ ex:child ex:Person2 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-zeroOrMore-001>
+ ) ;
+.
+<path-zeroOrMore-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sh:zeroOrMorePath 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath [
+ sh:zeroOrMorePath ex:child ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/path/path-zeroOrOne-001.ttl b/tests/w3c-shacl/core/path/path-zeroOrOne-001.ttl
new file mode 100644
index 00000000..2e4e34f5
--- /dev/null
+++ b/tests/w3c-shacl/core/path/path-zeroOrOne-001.ttl
@@ -0,0 +1,61 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-zeroOrOne-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+.
+ex:Person2
+ ex:child ex:Person3 ;
+.
+ex:TestShape
+ rdf:type sh:PropertyShape ;
+ sh:path [
+ sh:zeroOrOnePath ex:child ;
+ ] ;
+ sh:minCount 2 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:ValidResource1
+ ex:child ex:Person1 ;
+.
+ex:ValidResource2
+ ex:child ex:Person2 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <path-zeroOrOne-001>
+ ) ;
+.
+<path-zeroOrOne-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of path sh:zeroOrOnePath 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath [
+ sh:zeroOrOnePath ex:child ;
+ ] ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/and-001.ttl b/tests/w3c-shacl/core/property/and-001.ttl
new file mode 100644
index 00000000..57eeaf45
--- /dev/null
+++ b/tests/w3c-shacl/core/property/and-001.ttl
@@ -0,0 +1,107 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/and-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:AddressShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Address shape" ;
+ sh:property ex:AddressShape-address ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:InvalidResource3 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:AddressShape-address
+ sh:path ex:address ;
+ sh:and (
+ [
+ sh:property [
+ sh:path ex:suburb ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ [
+ sh:property [
+ sh:path ex:postalCode ;
+ sh:minCount 1 ;
+ ] ;
+ ]
+ ) ;
+.
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ ex:address _:b61065 ;
+.
+ex:InvalidResource2
+ rdf:type rdfs:Resource ;
+ ex:address _:b31477 ;
+.
+ex:InvalidResource3
+ rdf:type rdfs:Resource ;
+ ex:address _:b94057 ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+ ex:address [
+ ex:postalCode 4879 ;
+ ex:suburb ex:KewarraBeach ;
+ ] ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <and-001>
+ ) ;
+.
+<and-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:and at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:address ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:AndConstraintComponent ;
+ sh:sourceShape ex:AddressShape-address ;
+ sh:value _:b61065 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath ex:address ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:AndConstraintComponent ;
+ sh:sourceShape ex:AddressShape-address ;
+ sh:value _:b31477 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource3 ;
+ sh:resultPath ex:address ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:AndConstraintComponent ;
+ sh:sourceShape ex:AddressShape-address ;
+ sh:value _:b94057 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b31477
+ ex:suburb ex:KewarraBeach ;
+.
+_:b61065
+ ex:postalCode 4879 ;
+.
diff --git a/tests/w3c-shacl/core/property/class-001.ttl b/tests/w3c-shacl/core/property/class-001.ttl
new file mode 100644
index 00000000..2b97bf82
--- /dev/null
+++ b/tests/w3c-shacl/core/property/class-001.ttl
@@ -0,0 +1,91 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/class-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ ex:testProperty ex:InvalidResource1 ;
+ ex:testProperty "A string" ;
+.
+ex:SubClass
+ rdf:type rdfs:Class ;
+ rdfs:subClassOf ex:SuperClass ;
+.
+ex:SubClassInstance
+ rdf:type ex:SubClass ;
+.
+ex:SuperClass
+ rdf:type rdfs:Class ;
+.
+ex:SuperClassInstance
+ rdf:type ex:SuperClass ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-testProperty ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:TestShape-testProperty
+ sh:path ex:testProperty ;
+ rdfs:label "test property" ;
+ sh:class ex:SuperClass ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+ ex:testProperty ex:SubClassInstance ;
+ ex:testProperty ex:SuperClassInstance ;
+.
+ex:ValidResource2
+ rdf:type rdfs:Resource ;
+ ex:testProperty [
+ rdf:type ex:SubClass ;
+ ] ;
+ ex:testProperty [
+ rdf:type ex:SuperClass ;
+ ] ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <class-001>
+ ) ;
+.
+<class-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:class at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value ex:InvalidResource1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value "A string" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/datatype-001.ttl b/tests/w3c-shacl/core/property/datatype-001.ttl
new file mode 100644
index 00000000..f1b1b814
--- /dev/null
+++ b/tests/w3c-shacl/core/property/datatype-001.ttl
@@ -0,0 +1,76 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/datatype-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type ex:TestShape ;
+ ex:dateProperty "2011-01-01"^^xsd:dateTime ;
+ ex:integerProperty 11.1 ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-dateProperty ;
+ sh:property ex:TestShape-integerProperty ;
+.
+ex:TestShape-dateProperty
+ sh:path ex:dateProperty ;
+ rdfs:label "date property" ;
+ sh:datatype xsd:date ;
+.
+ex:TestShape-integerProperty
+ sh:path ex:integerProperty ;
+ rdfs:label "integer property" ;
+ sh:datatype xsd:integer ;
+.
+ex:ValidResource
+ rdf:type ex:TestShape ;
+ ex:dateProperty "2014-09-01"^^xsd:date ;
+ ex:integerProperty 0 ;
+ ex:integerProperty 1234 ;
+ rdfs:label "Valid resource" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <datatype-001>
+ ) ;
+.
+<datatype-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:datatype at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:dateProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape-dateProperty ;
+ sh:value "2011-01-01"^^xsd:dateTime ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:integerProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape-integerProperty ;
+ sh:value 11.1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/datatype-002.ttl b/tests/w3c-shacl/core/property/datatype-002.ttl
new file mode 100644
index 00000000..fc563774
--- /dev/null
+++ b/tests/w3c-shacl/core/property/datatype-002.ttl
@@ -0,0 +1,71 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/datatype-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ ex:value "A"@en ;
+.
+ex:InvalidInstance2
+ ex:value 42 ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-value ;
+ sh:targetNode ex:InvalidInstance1 ;
+ sh:targetNode ex:InvalidInstance2 ;
+ sh:targetNode ex:ValidInstance1 ;
+ sh:targetNode ex:ValidInstance2 ;
+.
+ex:TestShape-value
+ sh:path ex:value ;
+ sh:datatype xsd:string ;
+.
+ex:ValidInstance1
+ ex:value "A" ;
+.
+ex:ValidInstance2
+ ex:value "A" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <datatype-002>
+ ) ;
+.
+<datatype-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:datatype at property shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:value ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape-value ;
+ sh:value "A"@en ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultPath ex:value ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape-value ;
+ sh:value 42 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/datatype-003.ttl b/tests/w3c-shacl/core/property/datatype-003.ttl
new file mode 100644
index 00000000..52968507
--- /dev/null
+++ b/tests/w3c-shacl/core/property/datatype-003.ttl
@@ -0,0 +1,69 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/datatype-003.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ ex:value 42 ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-value ;
+ sh:targetNode ex:InvalidInstance1 ;
+ sh:targetNode ex:ValidInstance1 ;
+ sh:targetNode ex:ValidInstance2 ;
+ sh:targetNode ex:ValidInstance3 ;
+.
+ex:TestShape-value
+ sh:path ex:value ;
+ sh:or (
+ [
+ sh:datatype xsd:string ;
+ ]
+ [
+ sh:datatype rdf:langString ;
+ ]
+ ) ;
+.
+ex:ValidInstance1
+ ex:value "A" ;
+.
+ex:ValidInstance2
+ ex:value "A" ;
+.
+ex:ValidInstance3
+ ex:value "A"@en ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <datatype-003>
+ ) ;
+.
+<datatype-003>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:datatype at property shape 003" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:value ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:OrConstraintComponent ;
+ sh:sourceShape ex:TestShape-value ;
+ sh:value 42 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/datatype-ill-formed-data.ttl b/tests/w3c-shacl/core/property/datatype-ill-formed-data.ttl
new file mode 100644
index 00000000..e5338afa
--- /dev/null
+++ b/tests/w3c-shacl/core/property/datatype-ill-formed-data.ttl
@@ -0,0 +1,6 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:i ex:p "300"^^xsd:byte .
+ex:i ex:p "55"^^xsd:integer .
+ex:i ex:p "c"^^xsd:byte .
diff --git a/tests/w3c-shacl/core/property/datatype-ill-formed-shapes.ttl b/tests/w3c-shacl/core/property/datatype-ill-formed-shapes.ttl
new file mode 100644
index 00000000..20366326
--- /dev/null
+++ b/tests/w3c-shacl/core/property/datatype-ill-formed-shapes.ttl
@@ -0,0 +1,8 @@
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:s a sh:PropertyShape ;
+ sh:targetNode ex:i ;
+ sh:path ex:p ;
+ sh:datatype xsd:byte .
diff --git a/tests/w3c-shacl/core/property/datatype-ill-formed.ttl b/tests/w3c-shacl/core/property/datatype-ill-formed.ttl
new file mode 100644
index 00000000..08611e49
--- /dev/null
+++ b/tests/w3c-shacl/core/property/datatype-ill-formed.ttl
@@ -0,0 +1,43 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+@prefix ex: <http://example.org/shacl-test/> .
+
+<> rdf:type mf:Manifest ;
+ mf:entries (
+ <datatype-ill-formed>
+ ) .
+
+<datatype-ill-formed> rdf:type sht:Validate;
+ rdfs:label "Test of validation report for ill-formed literals" ;
+ mf:action [ sht:dataGraph <datatype-ill-formed-data.ttl> ;
+ sht:shapesGraph <datatype-ill-formed-shapes.ttl> ] ;
+ mf:result [ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:i ;
+ sh:value "300"^^xsd:byte ;
+ sh:resultPath ex:p ;
+ sh:sourceShape ex:s ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ;
+ sh:result [ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:i ;
+ sh:value "c"^^xsd:byte ;
+ sh:resultPath ex:p ;
+ sh:sourceShape ex:s ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ;
+ sh:result [ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:i ;
+ sh:value "55"^^xsd:integer ;
+ sh:resultPath ex:p ;
+ sh:sourceShape ex:s ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ] ;
+ mf:status sht:approved .
diff --git a/tests/w3c-shacl/core/property/disjoint-001.ttl b/tests/w3c-shacl/core/property/disjoint-001.ttl
new file mode 100644
index 00000000..8bfc6852
--- /dev/null
+++ b/tests/w3c-shacl/core/property/disjoint-001.ttl
@@ -0,0 +1,84 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/disjoint-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 "A" ;
+ ex:property2 "A" ;
+.
+ex:InvalidResource2
+ ex:property1 "A" ;
+ ex:property1 "B" ;
+ ex:property2 "A" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-property1 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:TestShape-property1
+ sh:path ex:property1 ;
+ sh:disjoint ex:property2 ;
+.
+ex:ValidResource1
+ ex:property1 "A" ;
+ ex:property2 "B" ;
+.
+ex:ValidResource2
+ ex:property1 "A" ;
+ ex:property1 "B" ;
+ ex:property2 "C" ;
+ ex:property2 "D" ;
+.
+ex:property1
+ rdf:type rdf:Property ;
+.
+ex:property2
+ rdf:type rdf:Property ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <disjoint-001>
+ ) ;
+.
+<disjoint-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:disjoint at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DisjointConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value "A" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DisjointConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value "A" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/equals-001.ttl b/tests/w3c-shacl/core/property/equals-001.ttl
new file mode 100644
index 00000000..64024cd4
--- /dev/null
+++ b/tests/w3c-shacl/core/property/equals-001.ttl
@@ -0,0 +1,119 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/equals-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 "A" ;
+ ex:property2 "B" ;
+.
+ex:InvalidResource2
+ ex:property1 "A" ;
+.
+ex:InvalidResource3
+ ex:property2 "A" ;
+.
+ex:InvalidResource4
+ ex:property1 "A" ;
+ ex:property1 "B" ;
+ ex:property2 "A" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-property1 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:InvalidResource3 ;
+ sh:targetNode ex:InvalidResource4 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:TestShape-property1
+ sh:path ex:property1 ;
+ sh:equals ex:property2 ;
+.
+ex:ValidResource1
+ ex:property1 "A" ;
+ ex:property2 "A" ;
+.
+ex:ValidResource2
+ ex:property1 "A" ;
+ ex:property1 "B" ;
+ ex:property2 "A" ;
+ ex:property2 "B" ;
+.
+ex:property1
+ rdf:type rdf:Property ;
+.
+ex:property2
+ rdf:type rdf:Property ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <equals-001>
+ ) ;
+.
+<equals-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:equals at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value "A" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value "B" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value "A" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource3 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value "A" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource4 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value "B" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/hasValue-001.ttl b/tests/w3c-shacl/core/property/hasValue-001.ttl
new file mode 100644
index 00000000..ffaa0ebb
--- /dev/null
+++ b/tests/w3c-shacl/core/property/hasValue-001.ttl
@@ -0,0 +1,68 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/hasValue-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidMalePerson
+ rdf:type ex:MalePerson ;
+ ex:gender "female" ;
+ rdfs:label "Invalid male person" ;
+.
+ex:MalePerson
+ rdf:type rdfs:Class ;
+ rdfs:label "Male person" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:PersonShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Person shape" ;
+ sh:property ex:PersonShape-gender ;
+ sh:targetClass ex:MalePerson ;
+.
+ex:PersonShape-gender
+ sh:path ex:gender ;
+ rdfs:label "gender" ;
+ sh:datatype xsd:string ;
+ sh:hasValue "male" ;
+.
+ex:ValidMalePerson1
+ rdf:type ex:MalePerson ;
+ ex:gender "male" ;
+.
+ex:ValidMalePerson2
+ rdf:type ex:MalePerson ;
+ ex:gender "female" ;
+ ex:gender "male" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <hasValue-001>
+ ) ;
+.
+<hasValue-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:hasValue at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidMalePerson ;
+ sh:resultPath ex:gender ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:HasValueConstraintComponent ;
+ sh:sourceShape ex:PersonShape-gender ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/in-001.ttl b/tests/w3c-shacl/core/property/in-001.ttl
new file mode 100644
index 00000000..cfd37cfb
--- /dev/null
+++ b/tests/w3c-shacl/core/property/in-001.ttl
@@ -0,0 +1,69 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/in-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:ShapeClass ;
+ ex:property "D" ;
+ rdfs:label "Invalid instance1" ;
+.
+ex:ShapeClass
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ sh:property ex:ShapeClass-property ;
+.
+ex:ShapeClass-property
+ sh:path ex:property ;
+ sh:datatype xsd:string ;
+ sh:in (
+ "A"
+ "B"
+ "C"
+ ) ;
+.
+ex:ValidInstance1
+ rdf:type ex:ShapeClass ;
+ ex:property "A" ;
+ rdfs:label "Valid instance1" ;
+.
+ex:ValidInstance2
+ rdf:type ex:ShapeClass ;
+ ex:property "A" ;
+ ex:property "B" ;
+ ex:property "C" ;
+ rdfs:label "Valid instance2" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <in-001>
+ ) ;
+.
+<in-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:in at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:InConstraintComponent ;
+ sh:sourceShape ex:ShapeClass-property ;
+ sh:value "D" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/languageIn-001.ttl b/tests/w3c-shacl/core/property/languageIn-001.ttl
new file mode 100644
index 00000000..00e9d98b
--- /dev/null
+++ b/tests/w3c-shacl/core/property/languageIn-001.ttl
@@ -0,0 +1,79 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/languageIn-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Berg
+ ex:prefLabel ex:BergLabel ;
+ ex:prefLabel "Berg" ;
+ ex:prefLabel "Berg"@de ;
+.
+ex:Mountain
+ ex:prefLabel "Hill"@en-NZ ;
+ ex:prefLabel "Maunga"@mi ;
+ ex:prefLabel "Mountain"@en ;
+.
+ex:NewZealandLanguagesShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:NewZealandLanguagesShape-prefLabel ;
+ sh:targetNode ex:Berg ;
+ sh:targetNode ex:Mountain ;
+.
+ex:NewZealandLanguagesShape-prefLabel
+ sh:path ex:prefLabel ;
+ sh:languageIn (
+ "en"
+ "mi"
+ ) ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <languageIn-001>
+ ) ;
+.
+<languageIn-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:languageIn at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Berg ;
+ sh:resultPath ex:prefLabel ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LanguageInConstraintComponent ;
+ sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ;
+ sh:value ex:BergLabel ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Berg ;
+ sh:resultPath ex:prefLabel ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LanguageInConstraintComponent ;
+ sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ;
+ sh:value "Berg" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Berg ;
+ sh:resultPath ex:prefLabel ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LanguageInConstraintComponent ;
+ sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ;
+ sh:value "Berg"@de ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/lessThan-001.ttl b/tests/w3c-shacl/core/property/lessThan-001.ttl
new file mode 100644
index 00000000..d76b37da
--- /dev/null
+++ b/tests/w3c-shacl/core/property/lessThan-001.ttl
@@ -0,0 +1,96 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/lessThan-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 4 ;
+ ex:property2 4 ;
+.
+ex:InvalidResource2
+ ex:property1 4 ;
+ ex:property1 6 ;
+ ex:property2 5 ;
+.
+ex:InvalidResource3
+ ex:property1 5 ;
+ ex:property2 4 ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-property1 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:InvalidResource3 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:TestShape-property1
+ sh:path ex:property1 ;
+ sh:lessThan ex:property2 ;
+.
+ex:ValidResource1
+ ex:property1 4 ;
+ ex:property2 6 ;
+.
+ex:ValidResource2
+ ex:property1 3.1 ;
+ ex:property1 3.2 ;
+.
+ex:property1
+ rdf:type rdf:Property ;
+.
+ex:property2
+ rdf:type rdf:Property ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <lessThan-001>
+ ) ;
+.
+<lessThan-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:lessThan at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value 4 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value 6 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource3 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value 5 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/lessThan-002.ttl b/tests/w3c-shacl/core/property/lessThan-002.ttl
new file mode 100644
index 00000000..9f352ef3
--- /dev/null
+++ b/tests/w3c-shacl/core/property/lessThan-002.ttl
@@ -0,0 +1,81 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/lessThan-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ ex:first 1 ;
+ ex:first 2 ;
+ ex:second "a" ;
+ ex:second "b" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-first ;
+ sh:targetNode ex:InvalidInstance1 ;
+.
+ex:TestShape-first
+ sh:path ex:first ;
+ sh:lessThan ex:second ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <lessThan-002>
+ ) ;
+.
+<lessThan-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:lessThan at property shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:first ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanConstraintComponent ;
+ sh:sourceShape ex:TestShape-first ;
+ sh:value 1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:first ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanConstraintComponent ;
+ sh:sourceShape ex:TestShape-first ;
+ sh:value 1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:first ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanConstraintComponent ;
+ sh:sourceShape ex:TestShape-first ;
+ sh:value 2 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:first ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanConstraintComponent ;
+ sh:sourceShape ex:TestShape-first ;
+ sh:value 2 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/lessThanOrEquals-001.ttl b/tests/w3c-shacl/core/property/lessThanOrEquals-001.ttl
new file mode 100644
index 00000000..c1ac111c
--- /dev/null
+++ b/tests/w3c-shacl/core/property/lessThanOrEquals-001.ttl
@@ -0,0 +1,87 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/lessThanOrEquals-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 5 ;
+ ex:property2 4 ;
+.
+ex:InvalidResource2
+ ex:property1 4 ;
+ ex:property1 6 ;
+ ex:property2 5 ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-property1 ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+ sh:targetNode ex:ValidResource3 ;
+.
+ex:TestShape-property1
+ sh:path ex:property1 ;
+ sh:lessThanOrEquals ex:property2 ;
+.
+ex:ValidResource1
+ ex:property1 4 ;
+ ex:property2 6 ;
+.
+ex:ValidResource2
+ ex:property1 3.1 ;
+ ex:property1 3.2 ;
+.
+ex:ValidResource3
+ ex:property1 5 ;
+ ex:property2 5 ;
+.
+ex:property1
+ rdf:type rdf:Property ;
+.
+ex:property2
+ rdf:type rdf:Property ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <lessThanOrEquals-001>
+ ) ;
+.
+<lessThanOrEquals-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:lessThanOrEquals at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value 5 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath ex:property1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ;
+ sh:sourceShape ex:TestShape-property1 ;
+ sh:value 6 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/manifest.ttl b/tests/w3c-shacl/core/property/manifest.ttl
new file mode 100644
index 00000000..034d2537
--- /dev/null
+++ b/tests/w3c-shacl/core/property/manifest.ttl
@@ -0,0 +1,46 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/property" ;
+ mf:include <and-001.ttl> ;
+ mf:include <class-001.ttl> ;
+ mf:include <datatype-001.ttl> ;
+ mf:include <datatype-002.ttl> ;
+ mf:include <datatype-003.ttl> ;
+ mf:include <datatype-ill-formed.ttl> ;
+ mf:include <disjoint-001.ttl> ;
+ mf:include <equals-001.ttl> ;
+ mf:include <hasValue-001.ttl> ;
+ mf:include <in-001.ttl> ;
+ mf:include <languageIn-001.ttl> ;
+ mf:include <lessThan-001.ttl> ;
+ mf:include <lessThan-002.ttl> ;
+ mf:include <lessThanOrEquals-001.ttl> ;
+ mf:include <maxCount-001.ttl> ;
+ mf:include <maxCount-002.ttl> ;
+ mf:include <maxExclusive-001.ttl> ;
+ mf:include <maxInclusive-001.ttl> ;
+ mf:include <maxLength-001.ttl> ;
+ mf:include <minCount-001.ttl> ;
+ mf:include <minCount-002.ttl> ;
+ mf:include <minExclusive-001.ttl> ;
+ mf:include <minExclusive-002.ttl> ;
+ mf:include <minLength-001.ttl> ;
+ mf:include <node-001.ttl> ;
+ mf:include <node-002.ttl> ;
+ mf:include <nodeKind-001.ttl> ;
+ mf:include <not-001.ttl> ;
+ mf:include <or-001.ttl> ;
+ mf:include <or-datatypes-001.ttl> ;
+ mf:include <pattern-001.ttl> ;
+ mf:include <pattern-002.ttl> ;
+ mf:include <property-001.ttl> ;
+ mf:include <qualifiedMinCountDisjoint-001.ttl> ;
+ mf:include <qualifiedValueShape-001.ttl> ;
+ mf:include <qualifiedValueShapesDisjoint-001.ttl> ;
+ mf:include <uniqueLang-001.ttl> ;
+ mf:include <uniqueLang-002.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/core/property/maxCount-001.ttl b/tests/w3c-shacl/core/property/maxCount-001.ttl
new file mode 100644
index 00000000..52653dec
--- /dev/null
+++ b/tests/w3c-shacl/core/property/maxCount-001.ttl
@@ -0,0 +1,64 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/maxCount-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidPerson
+ rdf:type ex:Person ;
+ ex:firstName "George" ;
+ ex:firstName "John" ;
+ rdfs:label "Invalid person" ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdfs:label "Person" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:PersonShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:PersonShape-firstName ;
+ sh:targetClass ex:Person ;
+ sh:targetNode ex:ValidResource ;
+.
+ex:PersonShape-firstName
+ sh:path ex:firstName ;
+ sh:datatype xsd:string ;
+ sh:maxCount 1 ;
+.
+ex:ValidResource
+ rdf:type ex:Person ;
+ ex:firstName "John" ;
+ rdfs:label "Valid resource" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxCount-001>
+ ) ;
+.
+<maxCount-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxCount at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidPerson ;
+ sh:resultPath ex:firstName ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:PersonShape-firstName ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/maxCount-002.ttl b/tests/w3c-shacl/core/property/maxCount-002.ttl
new file mode 100644
index 00000000..23d82a07
--- /dev/null
+++ b/tests/w3c-shacl/core/property/maxCount-002.ttl
@@ -0,0 +1,57 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/maxCount-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource
+ rdf:type rdfs:Resource ;
+ rdfs:label "Invalid resource" ;
+ owl:versionInfo "1.0" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-versionInfo ;
+ sh:targetNode ex:InvalidResource ;
+ sh:targetNode ex:ValidResource ;
+.
+ex:TestShape-versionInfo
+ sh:path owl:versionInfo ;
+ sh:maxCount 0 ;
+.
+ex:ValidResource
+ rdf:type rdfs:Resource ;
+ rdfs:label "Valid resource" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxCount-002>
+ ) ;
+.
+<maxCount-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxCount at property shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultPath owl:versionInfo ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:TestShape-versionInfo ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/maxExclusive-001.ttl b/tests/w3c-shacl/core/property/maxExclusive-001.ttl
new file mode 100644
index 00000000..47566a8f
--- /dev/null
+++ b/tests/w3c-shacl/core/property/maxExclusive-001.ttl
@@ -0,0 +1,84 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/maxExclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property 1 ;
+.
+ex:InvalidResource2
+ ex:property 2 ;
+.
+ex:InvalidResource3
+ ex:property "a" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-property ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:InvalidResource3 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:TestShape-property
+ sh:path ex:property ;
+ sh:maxExclusive 1 ;
+.
+ex:ValidResource1
+ ex:property 0 ;
+.
+ex:ValidResource2
+ ex:property -1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxExclusive-001>
+ ) ;
+.
+<maxExclusive-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxExclusive at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value 1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value 2 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource3 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value "a" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/maxInclusive-001.ttl b/tests/w3c-shacl/core/property/maxInclusive-001.ttl
new file mode 100644
index 00000000..2c5077f0
--- /dev/null
+++ b/tests/w3c-shacl/core/property/maxInclusive-001.ttl
@@ -0,0 +1,71 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/maxInclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property 2 ;
+.
+ex:InvalidResource2
+ ex:property "a" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-property ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:TestShape-property
+ sh:path ex:property ;
+ sh:maxInclusive 1 ;
+.
+ex:ValidResource1
+ ex:property 0 ;
+.
+ex:ValidResource2
+ ex:property 1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxInclusive-001>
+ ) ;
+.
+<maxInclusive-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxInclusive at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value 2 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value "a" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/maxLength-001.ttl b/tests/w3c-shacl/core/property/maxLength-001.ttl
new file mode 100644
index 00000000..b6d4b48f
--- /dev/null
+++ b/tests/w3c-shacl/core/property/maxLength-001.ttl
@@ -0,0 +1,61 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/maxLength-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty "ABC" ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-testProperty ;
+.
+ex:TestShape-testProperty
+ sh:path ex:testProperty ;
+ sh:datatype xsd:string ;
+ sh:maxLength 2 ;
+.
+ex:ValidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty "A" ;
+ ex:testProperty "AB" ;
+.
+ex:ValidInstance2
+ rdf:type ex:TestShape ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <maxLength-001>
+ ) ;
+.
+<maxLength-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:maxLength at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value "ABC" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/minCount-001.ttl b/tests/w3c-shacl/core/property/minCount-001.ttl
new file mode 100644
index 00000000..680f9c4b
--- /dev/null
+++ b/tests/w3c-shacl/core/property/minCount-001.ttl
@@ -0,0 +1,62 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/minCount-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidPerson
+ rdf:type ex:Person ;
+ rdfs:label "Invalid person" ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdfs:label "Person" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:PersonShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:PersonShape-firstName ;
+ sh:targetClass ex:Person ;
+ sh:targetNode ex:ValidResource ;
+.
+ex:PersonShape-firstName
+ sh:path ex:firstName ;
+ sh:datatype xsd:string ;
+ sh:minCount 1 ;
+.
+ex:ValidResource
+ rdf:type ex:Person ;
+ ex:firstName "John" ;
+ rdfs:label "Valid resource" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minCount-001>
+ ) ;
+.
+<minCount-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minCount at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidPerson ;
+ sh:resultPath ex:firstName ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape ex:PersonShape-firstName ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/minCount-002.ttl b/tests/w3c-shacl/core/property/minCount-002.ttl
new file mode 100644
index 00000000..d4b4f13b
--- /dev/null
+++ b/tests/w3c-shacl/core/property/minCount-002.ttl
@@ -0,0 +1,41 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/minCount-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:minCount 0 ;
+ sh:name "property" ;
+ ] ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minCount-002>
+ ) ;
+.
+<minCount-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minCount at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "true"^^xsd:boolean ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/minExclusive-001.ttl b/tests/w3c-shacl/core/property/minExclusive-001.ttl
new file mode 100644
index 00000000..8c99b43b
--- /dev/null
+++ b/tests/w3c-shacl/core/property/minExclusive-001.ttl
@@ -0,0 +1,69 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/minExclusive-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty 40 ;
+.
+ex:InvalidInstance2
+ rdf:type ex:TestShape ;
+ ex:testProperty 39 ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-testProperty ;
+.
+ex:TestShape-testProperty
+ sh:path ex:testProperty ;
+ sh:minExclusive 40 ;
+.
+ex:ValidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty 42 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minExclusive-001>
+ ) ;
+.
+<minExclusive-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minExclusive at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value 40 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value 39 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/minExclusive-002.ttl b/tests/w3c-shacl/core/property/minExclusive-002.ttl
new file mode 100644
index 00000000..2612e166
--- /dev/null
+++ b/tests/w3c-shacl/core/property/minExclusive-002.ttl
@@ -0,0 +1,65 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/minExclusive-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty "A string" ;
+.
+ex:InvalidInstance2
+ rdf:type ex:TestShape ;
+ ex:testProperty rdfs:Resource ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-testProperty ;
+.
+ex:TestShape-testProperty
+ sh:path ex:testProperty ;
+ sh:minExclusive 40 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minExclusive-002>
+ ) ;
+.
+<minExclusive-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minExclusive at property shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value "A string" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value rdfs:Resource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/minLength-001.ttl b/tests/w3c-shacl/core/property/minLength-001.ttl
new file mode 100644
index 00000000..06f286e2
--- /dev/null
+++ b/tests/w3c-shacl/core/property/minLength-001.ttl
@@ -0,0 +1,61 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/minLength-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty "A" ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-testProperty ;
+.
+ex:TestShape-testProperty
+ sh:path ex:testProperty ;
+ sh:datatype xsd:string ;
+ sh:minLength 2 ;
+.
+ex:ValidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty "AB" ;
+ ex:testProperty "ABC" ;
+.
+ex:ValidInstance2
+ rdf:type ex:TestShape ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <minLength-001>
+ ) ;
+.
+<minLength-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:minLength at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinLengthConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ sh:value "A" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/node-001.ttl b/tests/w3c-shacl/core/property/node-001.ttl
new file mode 100644
index 00000000..2245930b
--- /dev/null
+++ b/tests/w3c-shacl/core/property/node-001.ttl
@@ -0,0 +1,113 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/node-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Anon
+ rdf:type ex:Person ;
+ ex:firstName "Anon" ;
+.
+ex:Issue
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Issue" ;
+ rdfs:subClassOf rdfs:Resource ;
+ sh:property ex:Issue-assignedTo ;
+ sh:property ex:Issue-submittedBy ;
+.
+ex:Issue-assignedTo
+ sh:path ex:assignedTo ;
+ sh:class ex:Person ;
+ sh:node [
+ rdfs:comment "All assignees must have an email and a last name." ;
+ sh:property [
+ sh:path ex:email ;
+ sh:maxCount 1 ;
+ sh:minCount 1 ;
+ ] ;
+ sh:property [
+ sh:path ex:lastName ;
+ sh:maxCount 1 ;
+ sh:minCount 1 ;
+ ] ;
+ ] ;
+.
+ex:Issue-submittedBy
+ sh:path ex:submittedBy ;
+ sh:class ex:Person ;
+ sh:minCount 1 ;
+.
+ex:Issue_1
+ rdf:type ex:Issue ;
+ ex:assignedTo ex:Anon ;
+ ex:submittedBy ex:Anon ;
+ rdfs:label "Issue 1" ;
+.
+ex:Issue_2
+ rdf:type ex:Issue ;
+ ex:assignedTo ex:JohnDoeWithEmail ;
+ ex:submittedBy ex:Anon ;
+ rdfs:label "Issue 2" ;
+.
+ex:JohnDoeWithEmail
+ rdf:type ex:Person ;
+ ex:email "[email protected]" ;
+ ex:firstName "John" ;
+ ex:lastName "Doe" ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Person" ;
+ rdfs:subClassOf rdfs:Resource ;
+ sh:property [
+ sh:path ex:email ;
+ ex:datatype xsd:string ;
+ rdfs:label "email" ;
+ ] ;
+ sh:property [
+ sh:path ex:firstName ;
+ rdfs:label "first name" ;
+ sh:datatype xsd:string ;
+ sh:maxCount 1 ;
+ sh:minCount 1 ;
+ ] ;
+ sh:property [
+ sh:path ex:lastName ;
+ rdfs:label "last name" ;
+ sh:datatype xsd:string ;
+ ] ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <node-001>
+ ) ;
+.
+<node-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:node at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Issue_1 ;
+ sh:resultPath ex:assignedTo ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeConstraintComponent ;
+ sh:sourceShape ex:Issue-assignedTo ;
+ sh:value ex:Anon ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/node-002.ttl b/tests/w3c-shacl/core/property/node-002.ttl
new file mode 100644
index 00000000..f028f57f
--- /dev/null
+++ b/tests/w3c-shacl/core/property/node-002.ttl
@@ -0,0 +1,75 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/node-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:AddressShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:AddressShape-postalCode ;
+.
+ex:AddressShape-postalCode
+ sh:path ex:postalCode ;
+ sh:datatype xsd:string ;
+ sh:maxCount 1 ;
+.
+ex:Bob
+ rdf:type ex:Person ;
+ ex:address ex:BobsAddress ;
+.
+ex:BobsAddress
+ ex:postalCode "1234" ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdfs:label "Person" ;
+.
+ex:PersonShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:PersonShape-address ;
+ sh:targetClass ex:Person ;
+.
+ex:PersonShape-address
+ sh:path ex:address ;
+ sh:minCount 1 ;
+ sh:node ex:AddressShape ;
+.
+ex:Reto
+ rdf:type ex:Person ;
+ ex:address ex:RetosAddress ;
+.
+ex:RetosAddress
+ ex:postalCode 5678 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <node-002>
+ ) ;
+.
+<node-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:node at property shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Reto ;
+ sh:resultPath ex:address ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeConstraintComponent ;
+ sh:sourceShape ex:PersonShape-address ;
+ sh:value ex:RetosAddress ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/nodeKind-001.ttl b/tests/w3c-shacl/core/property/nodeKind-001.ttl
new file mode 100644
index 00000000..d40515d0
--- /dev/null
+++ b/tests/w3c-shacl/core/property/nodeKind-001.ttl
@@ -0,0 +1,371 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/nodeKind-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InstanceWithBlankNode
+ rdf:type ex:MyClass ;
+ ex:myProperty _:b55454 ;
+.
+ex:InstanceWithBlankNodeAndIRI
+ rdf:type ex:MyClass ;
+ ex:myProperty rdfs:Class ;
+ ex:myProperty _:b67098 ;
+.
+ex:InstanceWithBlankNodeAndLiteral
+ rdf:type ex:MyClass ;
+ ex:myProperty "Literal" ;
+ ex:myProperty _:b99026 ;
+.
+ex:InstanceWithIRI
+ rdf:type ex:MyClass ;
+ ex:myProperty rdfs:Class ;
+.
+ex:InstanceWithIRIAndLiteral
+ rdf:type ex:MyClass ;
+ ex:myProperty rdfs:Class ;
+ ex:myProperty "Literal" ;
+.
+ex:InstanceWithLiteral
+ rdf:type ex:MyClass ;
+ ex:myProperty "Literal" ;
+.
+ex:MyClass
+ rdf:type rdfs:Class ;
+ rdfs:label "My class" ;
+.
+ex:ShapeWithBlankNode
+ rdf:type sh:NodeShape ;
+ sh:property _:b38619 ;
+ sh:targetClass ex:MyClass ;
+.
+ex:ShapeWithBlankNodeOrIRI
+ rdf:type sh:NodeShape ;
+ sh:property _:b3078 ;
+ sh:targetClass ex:MyClass ;
+.
+ex:ShapeWithBlankNodeOrLiteral
+ rdf:type sh:NodeShape ;
+ sh:property _:b14975 ;
+ sh:targetClass ex:MyClass ;
+.
+ex:ShapeWithIRI
+ rdf:type sh:NodeShape ;
+ sh:property _:b97614 ;
+ sh:targetClass ex:MyClass ;
+.
+ex:ShapeWithIRIOrLiteral
+ rdf:type sh:NodeShape ;
+ sh:property _:b97860 ;
+ sh:targetClass ex:MyClass ;
+.
+ex:ShapeWithLiteral
+ rdf:type sh:NodeShape ;
+ sh:property _:b79526 ;
+ sh:targetClass ex:MyClass ;
+.
+ex:myProperty
+ rdf:type rdf:Property ;
+ rdfs:domain ex:MyClass ;
+ rdfs:label "my property" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <nodeKind-001>
+ ) ;
+.
+<nodeKind-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:nodeKind at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNode ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b79526 ;
+ sh:value _:b55454 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNode ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97614 ;
+ sh:value _:b55454 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNode ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97860 ;
+ sh:value _:b55454 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b14975 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b38619 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b79526 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b79526 ;
+ sh:value _:b67098 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97614 ;
+ sh:value _:b67098 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97860 ;
+ sh:value _:b67098 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b3078 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b38619 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b79526 ;
+ sh:value _:b99026 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97614 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97614 ;
+ sh:value _:b99026 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithBlankNodeAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97860 ;
+ sh:value _:b99026 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b14975 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b38619 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRI ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b79526 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRIAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b3078 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRIAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b14975 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRIAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b38619 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRIAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b38619 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRIAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b79526 ;
+ sh:value rdfs:Class ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithIRIAndLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97614 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b3078 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b38619 ;
+ sh:value "Literal" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InstanceWithLiteral ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
+ sh:sourceShape _:b97614 ;
+ sh:value "Literal" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b3078
+ sh:path ex:myProperty ;
+ sh:nodeKind sh:BlankNodeOrIRI ;
+.
+_:b14975
+ sh:path ex:myProperty ;
+ sh:nodeKind sh:BlankNodeOrLiteral ;
+.
+_:b38619
+ sh:path ex:myProperty ;
+ sh:nodeKind sh:BlankNode ;
+.
+_:b55454
+ rdf:type rdfs:Resource ;
+.
+_:b67098
+ rdf:type rdfs:Resource ;
+.
+_:b79526
+ sh:path ex:myProperty ;
+ sh:nodeKind sh:Literal ;
+.
+_:b97614
+ sh:path ex:myProperty ;
+ sh:nodeKind sh:IRI ;
+.
+_:b97860
+ sh:path ex:myProperty ;
+ sh:nodeKind sh:IRIOrLiteral ;
+.
+_:b99026
+ rdf:type rdfs:Resource ;
+.
diff --git a/tests/w3c-shacl/core/property/not-001.ttl b/tests/w3c-shacl/core/property/not-001.ttl
new file mode 100644
index 00000000..bad0e6fb
--- /dev/null
+++ b/tests/w3c-shacl/core/property/not-001.ttl
@@ -0,0 +1,68 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/not-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ ex:property 42 ;
+ ex:property "Test Valid" ;
+ rdfs:label "Invalid resource1" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-property ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:TestShape-property
+ sh:path ex:property ;
+ sh:not [
+ sh:datatype xsd:integer ;
+ ] ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+ rdfs:label "Valid resource1" ;
+.
+ex:ValidResource2
+ rdf:type rdfs:Resource ;
+ ex:property 1.5 ;
+ ex:property "String" ;
+ rdfs:label "Valid resource2" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <not-001>
+ ) ;
+.
+<not-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:not at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:NotConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value 42 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/or-001.ttl b/tests/w3c-shacl/core/property/or-001.ttl
new file mode 100644
index 00000000..323ed0f5
--- /dev/null
+++ b/tests/w3c-shacl/core/property/or-001.ttl
@@ -0,0 +1,76 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/or-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Address
+ rdf:type rdfs:Class ;
+ rdfs:label "Address" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:AddressShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Address shape" ;
+ sh:property ex:AddressShape-address ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+ sh:targetNode ex:ValidResource2 ;
+.
+ex:AddressShape-address
+ sh:path ex:address ;
+ sh:or (
+ [
+ sh:datatype xsd:string ;
+ ]
+ [
+ sh:class ex:Address ;
+ ]
+ ) ;
+.
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ ex:address "true"^^xsd:boolean ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+ ex:address "Home" ;
+.
+ex:ValidResource2
+ rdf:type rdfs:Resource ;
+ ex:address [
+ rdf:type ex:Address ;
+ ] ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <or-001>
+ ) ;
+.
+<or-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:or at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath ex:address ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:OrConstraintComponent ;
+ sh:sourceShape ex:AddressShape-address ;
+ sh:value "true"^^xsd:boolean ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/or-datatypes-001.ttl b/tests/w3c-shacl/core/property/or-datatypes-001.ttl
new file mode 100644
index 00000000..dc59b420
--- /dev/null
+++ b/tests/w3c-shacl/core/property/or-datatypes-001.ttl
@@ -0,0 +1,95 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/or-datatypes-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ rdfs:comment owl:Thing ;
+ rdfs:comment 42 ;
+ rdfs:comment "A string" ;
+ rdfs:comment "none"^^xsd:boolean ;
+ rdfs:label "Invalid resource1" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-comment ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:TestShape-comment
+ sh:path rdfs:comment ;
+ sh:or (
+ [
+ sh:datatype xsd:string ;
+ ]
+ [
+ sh:datatype rdf:HTML ;
+ ]
+ [
+ sh:datatype rdf:langString ;
+ ]
+ [
+ sh:datatype xsd:boolean ;
+ ]
+ ) ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+ rdfs:comment "<div>HTML</div>"^^rdf:HTML ;
+ rdfs:comment "A language string"@en ;
+ rdfs:comment "A string" ;
+ rdfs:label "Valid resource1" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <or-datatypes-001>
+ ) ;
+.
+<or-datatypes-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:or of sh:datatypes at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath rdfs:comment ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:OrConstraintComponent ;
+ sh:sourceShape ex:TestShape-comment ;
+ sh:value owl:Thing ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath rdfs:comment ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:OrConstraintComponent ;
+ sh:sourceShape ex:TestShape-comment ;
+ sh:value 42 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath rdfs:comment ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:OrConstraintComponent ;
+ sh:sourceShape ex:TestShape-comment ;
+ sh:value "none"^^xsd:boolean ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/pattern-001.ttl b/tests/w3c-shacl/core/property/pattern-001.ttl
new file mode 100644
index 00000000..2c63ad80
--- /dev/null
+++ b/tests/w3c-shacl/core/property/pattern-001.ttl
@@ -0,0 +1,74 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/pattern-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:TestShape ;
+ ex:property "Maria" ;
+ rdfs:label "Invalid instance1" ;
+.
+ex:InvalidInstance2
+ rdf:type ex:TestShape ;
+ ex:property "john" ;
+ rdfs:label "Invalid instance2" ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-property ;
+.
+ex:TestShape-property
+ sh:path ex:property ;
+ sh:datatype xsd:string ;
+ sh:pattern "Joh" ;
+.
+ex:ValidInstance1
+ rdf:type ex:TestShape ;
+ ex:property "Hi Joh" ;
+ ex:property "John" ;
+ rdfs:label "Valid instance1" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pattern-001>
+ ) ;
+.
+<pattern-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:pattern at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value "Maria" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value "john" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/pattern-002.ttl b/tests/w3c-shacl/core/property/pattern-002.ttl
new file mode 100644
index 00000000..498c2a3a
--- /dev/null
+++ b/tests/w3c-shacl/core/property/pattern-002.ttl
@@ -0,0 +1,66 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/pattern-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:TestShape ;
+ ex:property "Maria" ;
+ rdfs:label "Invalid instance1" ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-property ;
+.
+ex:TestShape-property
+ sh:path ex:property ;
+ rdfs:label "property" ;
+ sh:datatype xsd:string ;
+ sh:flags "i" ;
+ sh:pattern "joh" ;
+.
+ex:ValidInstance1
+ rdf:type ex:TestShape ;
+ ex:property "Hi Joh" ;
+ ex:property "John" ;
+ rdfs:label "Valid instance1" ;
+.
+ex:ValidInstance2
+ rdf:type ex:TestShape ;
+ ex:property "john" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pattern-002>
+ ) ;
+.
+<pattern-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:pattern at property shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:property ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:PatternConstraintComponent ;
+ sh:sourceShape ex:TestShape-property ;
+ sh:value "Maria" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/property-001.ttl b/tests/w3c-shacl/core/property/property-001.ttl
new file mode 100644
index 00000000..cd7bfd42
--- /dev/null
+++ b/tests/w3c-shacl/core/property/property-001.ttl
@@ -0,0 +1,100 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/property-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Address
+ rdf:type rdfs:Class ;
+ rdfs:label "Address" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:City
+ rdf:type rdfs:Class ;
+ rdfs:label "City" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:InvalidAddress
+ rdf:type ex:Address ;
+ ex:city ex:InvalidCity ;
+.
+ex:InvalidPerson1
+ rdf:type ex:Person ;
+ ex:address ex:InvalidAddress ;
+.
+ex:InvalidPerson2
+ rdf:type ex:Person ;
+ ex:address ex:InvalidAddress ;
+ ex:address ex:ValidAddress ;
+.
+ex:Person
+ rdf:type rdfs:Class ;
+ rdfs:label "Person" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:PersonShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Person shape" ;
+ sh:property [
+ sh:path ex:address ;
+ sh:property ex:PersonShape-address-city ;
+ ] ;
+ sh:targetClass ex:Person ;
+.
+ex:PersonShape-address-city
+ sh:path ex:city ;
+ sh:class ex:City ;
+.
+ex:ProperCity
+ rdf:type ex:City ;
+ rdfs:label "Proper city" ;
+.
+ex:ValidAddress
+ rdf:type ex:Address ;
+ ex:city ex:ProperCity ;
+.
+ex:ValidPerson1
+ rdf:type ex:Person ;
+ ex:address ex:ValidAddress ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <property-001>
+ ) ;
+.
+<property-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:property at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidAddress ;
+ sh:resultPath ex:city ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:PersonShape-address-city ;
+ sh:value ex:InvalidCity ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidAddress ;
+ sh:resultPath ex:city ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent ;
+ sh:sourceShape ex:PersonShape-address-city ;
+ sh:value ex:InvalidCity ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/qualifiedMinCountDisjoint-001.ttl b/tests/w3c-shacl/core/property/qualifiedMinCountDisjoint-001.ttl
new file mode 100644
index 00000000..00d91c24
--- /dev/null
+++ b/tests/w3c-shacl/core/property/qualifiedMinCountDisjoint-001.ttl
@@ -0,0 +1,116 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/qualifiedMinCountDisjoint-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Digit
+ rdf:type rdfs:Class ;
+ rdfs:label "Digit" ;
+.
+ex:Finger
+ rdf:type rdfs:Class ;
+ rdfs:label "Finger" ;
+ rdfs:subClassOf ex:Digit ;
+.
+ex:FingerAndThumb
+ rdf:type ex:Finger ;
+ rdf:type ex:Thumb ;
+ rdfs:label "Finger and thumb" ;
+.
+ex:FingerShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Finger shape" ;
+ sh:class ex:Finger ;
+.
+ex:Finger_1
+ rdf:type ex:Finger ;
+ rdfs:label "Finger 1" ;
+.
+ex:Hand
+ rdf:type rdfs:Class ;
+ rdfs:label "Hand" ;
+.
+ex:HandShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Hand shape" ;
+ sh:property ex:HandShape-digit-maxCount4 ;
+ sh:property ex:HandShape-digit-minCount1 ;
+ sh:targetClass ex:Hand ;
+.
+ex:HandShape-digit-maxCount4
+ rdf:type sh:PropertyShape ;
+ sh:path ex:digit ;
+ sh:qualifiedMaxCount 4 ;
+ sh:qualifiedValueShape ex:FingerShape ;
+ sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ;
+.
+ex:HandShape-digit-minCount1
+ rdf:type sh:PropertyShape ;
+ sh:path ex:digit ;
+ sh:qualifiedMinCount 1 ;
+ sh:qualifiedValueShape ex:ThumbShape ;
+ sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ;
+.
+ex:InvalidHand1
+ rdf:type ex:Hand ;
+ ex:digit ex:FingerAndThumb ;
+ rdfs:label "Invalid hand1" ;
+.
+ex:Thumb
+ rdf:type rdfs:Class ;
+ rdfs:label "Thumb" ;
+ rdfs:subClassOf ex:Digit ;
+.
+ex:ThumbShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Thumb shape" ;
+ sh:class ex:Thumb ;
+.
+ex:Thumb_1
+ rdf:type ex:Thumb ;
+ rdfs:label "Thumb 1" ;
+.
+ex:ValidHand1
+ rdf:type ex:Hand ;
+ ex:digit ex:Finger_1 ;
+ ex:digit ex:Thumb_1 ;
+ rdfs:label "Valid hand1" ;
+.
+ex:digit
+ rdf:type rdf:Property ;
+ rdfs:domain ex:Hand ;
+ rdfs:label "digit" ;
+ rdfs:range ex:Digit ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <qualifiedMinCountDisjoint-001>
+ ) ;
+.
+<qualifiedMinCountDisjoint-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:qualifiedMinCount with disjoint shapes at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidHand1 ;
+ sh:resultPath ex:digit ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ;
+ sh:sourceShape ex:HandShape-digit-minCount1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/qualifiedValueShape-001.ttl b/tests/w3c-shacl/core/property/qualifiedValueShape-001.ttl
new file mode 100644
index 00000000..ead8f719
--- /dev/null
+++ b/tests/w3c-shacl/core/property/qualifiedValueShape-001.ttl
@@ -0,0 +1,80 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/qualifiedValueShape-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:APGARObservationShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:APGARObservationShape-related ;
+ sh:targetNode ex:Observation1 ;
+.
+ex:APGARObservationShape-related
+ sh:path ex:related ;
+ sh:qualifiedMaxCount 3 ;
+ sh:qualifiedMinCount 3 ;
+ sh:qualifiedValueShape [
+ sh:property [
+ sh:path ex:related_target ;
+ sh:node [
+ sh:property [
+ sh:path ex:reference ;
+ sh:hasValue ex:something ;
+ ] ;
+ ] ;
+ ] ;
+ ] ;
+.
+ex:Observation1
+ rdf:type ex:Observation ;
+ ex:related [
+ ex:related_target [
+ ex:reference ex:something ;
+ ] ;
+ ex:related_type "has-component"^^ex:code ;
+ ] ;
+ ex:related [
+ ex:related_target [
+ ex:reference ex:something ;
+ ] ;
+ ex:related_type "has-component"^^ex:code ;
+ ] ;
+ ex:related [
+ ex:related_target [
+ ex:reference ex:unrelated ;
+ ] ;
+ ex:related_type "has-component"^^ex:code ;
+ ] ;
+ sh:nodeShape ex:APGARObservationShape ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <qualifiedValueShape-001>
+ ) ;
+.
+<qualifiedValueShape-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:qualifiedValueShape at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:Observation1 ;
+ sh:resultPath ex:related ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ;
+ sh:sourceShape ex:APGARObservationShape-related ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/qualifiedValueShapesDisjoint-001.ttl b/tests/w3c-shacl/core/property/qualifiedValueShapesDisjoint-001.ttl
new file mode 100644
index 00000000..1cc8cbc1
--- /dev/null
+++ b/tests/w3c-shacl/core/property/qualifiedValueShapesDisjoint-001.ttl
@@ -0,0 +1,128 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/qualifiedValueShapesDisjoint-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Finger
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Finger" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:Finger1
+ rdf:type ex:Finger ;
+ rdfs:label "Finger1" ;
+.
+ex:Finger2
+ rdf:type ex:Finger ;
+ rdfs:label "Finger2" ;
+.
+ex:Finger3
+ rdf:type ex:Finger ;
+ rdfs:label "Finger3" ;
+.
+ex:Finger4
+ rdf:type ex:Finger ;
+ rdfs:label "Finger4" ;
+.
+ex:FingerAndThumb
+ rdf:type ex:Finger ;
+ rdf:type ex:Thumb ;
+ rdfs:label "Finger and thumb" ;
+.
+ex:Hand
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Hand" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:HandShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:HandShape-digit1 ;
+ sh:property ex:HandShape-digit4 ;
+ sh:targetClass ex:Hand ;
+.
+ex:HandShape-digit1
+ sh:path ex:digit ;
+ sh:qualifiedMaxCount 1 ;
+ sh:qualifiedMinCount 1 ;
+ sh:qualifiedValueShape [
+ sh:class ex:Thumb ;
+ ] ;
+ sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ;
+.
+ex:HandShape-digit4
+ sh:path ex:digit ;
+ sh:qualifiedMaxCount 4 ;
+ sh:qualifiedMinCount 4 ;
+ sh:qualifiedValueShape [
+ sh:class ex:Finger ;
+ ] ;
+ sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ;
+.
+ex:InvalidHand1
+ rdf:type ex:Hand ;
+ ex:digit ex:Finger1 ;
+ ex:digit ex:Finger2 ;
+ ex:digit ex:Finger3 ;
+ ex:digit ex:FingerAndThumb ;
+.
+ex:Thumb
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Thumb" ;
+ rdfs:subClassOf rdfs:Resource ;
+.
+ex:Thumb1
+ rdf:type ex:Thumb ;
+ rdfs:label "Thumb1" ;
+.
+ex:ValidHand
+ rdf:type ex:Hand ;
+ ex:digit ex:Finger1 ;
+ ex:digit ex:Finger2 ;
+ ex:digit ex:Finger3 ;
+ ex:digit ex:Finger4 ;
+ ex:digit ex:Thumb1 ;
+ rdfs:label "Valid hand" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <qualifiedValueShapesDisjoint-001>
+ ) ;
+.
+<qualifiedValueShapesDisjoint-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:qualifiedValueShapesDisjoint at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidHand1 ;
+ sh:resultPath ex:digit ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ;
+ sh:sourceShape ex:HandShape-digit1 ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidHand1 ;
+ sh:resultPath ex:digit ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ;
+ sh:sourceShape ex:HandShape-digit4 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/uniqueLang-001.ttl b/tests/w3c-shacl/core/property/uniqueLang-001.ttl
new file mode 100644
index 00000000..ffec0ff0
--- /dev/null
+++ b/tests/w3c-shacl/core/property/uniqueLang-001.ttl
@@ -0,0 +1,86 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/property/uniqueLang-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty "Me" ;
+ ex:testProperty "Me"@en ;
+ ex:testProperty "Moi"@fr ;
+ ex:testProperty "Myself"@en ;
+.
+ex:InvalidInstance2
+ rdf:type ex:TestShape ;
+ ex:testProperty "I"@en ;
+ ex:testProperty "Ich"@de ;
+ ex:testProperty "Me"@en ;
+ ex:testProperty "Mich"@de ;
+ ex:testProperty "Myself"@en ;
+.
+ex:TestShape
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-testProperty ;
+.
+ex:TestShape-testProperty
+ sh:path ex:testProperty ;
+ rdfs:label "test property" ;
+ sh:uniqueLang "true"^^xsd:boolean ;
+.
+ex:ValidInstance1
+ rdf:type ex:TestShape ;
+ ex:testProperty "Me" ;
+ ex:testProperty "Me"@en ;
+ ex:testProperty "Moi"@fr ;
+ ex:testProperty "Myself" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <uniqueLang-001>
+ ) ;
+.
+<uniqueLang-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:uniqueLang at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultPath ex:testProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ;
+ sh:sourceShape ex:TestShape-testProperty ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/property/uniqueLang-002-data.ttl b/tests/w3c-shacl/core/property/uniqueLang-002-data.ttl
new file mode 100644
index 00000000..4db2738e
--- /dev/null
+++ b/tests/w3c-shacl/core/property/uniqueLang-002-data.ttl
@@ -0,0 +1,3 @@
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:i ex:message "HI"@en, "Hi"@en .
diff --git a/tests/w3c-shacl/core/property/uniqueLang-002-shapes.ttl b/tests/w3c-shacl/core/property/uniqueLang-002-shapes.ttl
new file mode 100644
index 00000000..648d4821
--- /dev/null
+++ b/tests/w3c-shacl/core/property/uniqueLang-002-shapes.ttl
@@ -0,0 +1,12 @@
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix ex: <http://example.org/shacl-test/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:s1 a sh:PropertyShape ;
+ sh:targetNode ex:i ;
+ sh:path ex:message ;
+ sh:uniqueLang "1"^^xsd:boolean .
+
+# Note that the value above is "1"^^xsd:boolean, which is distinct from "true"^^xsd:boolean.
+# Only true is mentioned in the spec, meaning that "1" will not activate the constraint
+# and the constraint is being ignored.
diff --git a/tests/w3c-shacl/core/property/uniqueLang-002.ttl b/tests/w3c-shacl/core/property/uniqueLang-002.ttl
new file mode 100644
index 00000000..c1b1f3bb
--- /dev/null
+++ b/tests/w3c-shacl/core/property/uniqueLang-002.ttl
@@ -0,0 +1,23 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/path/path-complex-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<> a mf:Manifest ;
+ mf:entries (
+ <uniqueLang-002>
+ ) .
+
+<uniqueLang-002> a sht:Validate ;
+ rdfs:label "Test uniqueLang with other boolean literal for true" ;
+ mf:action [
+ sht:dataGraph <uniqueLang-002-data.ttl> ;
+ sht:shapesGraph <uniqueLang-002-shapes.ttl> ] ;
+ mf:result [ a sh:ValidationReport ;
+ sh:conforms "true"^^xsd:boolean ] ;
+ mf:status sht:approved .
diff --git a/tests/w3c-shacl/core/targets/manifest.ttl b/tests/w3c-shacl/core/targets/manifest.ttl
new file mode 100644
index 00000000..ee7699b7
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/manifest.ttl
@@ -0,0 +1,15 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/targets" ;
+ mf:include <multipleTargets-001.ttl> ;
+ mf:include <targetClass-001.ttl> ;
+ mf:include <targetClassImplicit-001.ttl> ;
+ mf:include <targetNode-001.ttl> ;
+ mf:include <targetObjectsOf-001.ttl> ;
+ mf:include <targetSubjectsOf-001.ttl> ;
+ mf:include <targetSubjectsOf-002.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/core/targets/multipleTargets-001.ttl b/tests/w3c-shacl/core/targets/multipleTargets-001.ttl
new file mode 100644
index 00000000..81a99e81
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/multipleTargets-001.ttl
@@ -0,0 +1,56 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/targets/multipleTargets-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:property1 "Also a value" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:in (
+ ex:ValidResource1
+ ex:ValidResource2
+ ) ;
+ sh:targetSubjectsOf ex:property1 ;
+ sh:targetSubjectsOf ex:property2 ;
+.
+ex:ValidResource1
+ ex:property1 "Some value" ;
+.
+ex:ValidResource2
+ ex:property2 "Other value" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <multipleTargets-001>
+ ) ;
+.
+<multipleTargets-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of multiple targets 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:InConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource1 ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/targets/targetClass-001.ttl b/tests/w3c-shacl/core/targets/targetClass-001.ttl
new file mode 100644
index 00000000..e1d5a55c
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/targetClass-001.ttl
@@ -0,0 +1,62 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/targets/targetClass-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:MyClass ;
+ ex:myProperty "A" ;
+ ex:myProperty "B" ;
+.
+ex:MyClass
+ rdf:type rdfs:Class ;
+.
+ex:MyShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:MyShape-myProperty ;
+ sh:targetClass ex:MyClass ;
+.
+ex:MyShape-myProperty
+ sh:path ex:myProperty ;
+ sh:maxCount 1 ;
+.
+ex:ValidInstance1
+ rdf:type ex:MyClass ;
+ ex:myProperty "A" ;
+.
+ex:ValidInstance2
+ ex:myProperty "A" ;
+ ex:myProperty "B" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <targetClass-001>
+ ) ;
+.
+<targetClass-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:targetClass 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:MyShape-myProperty ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/targets/targetClassImplicit-001.ttl b/tests/w3c-shacl/core/targets/targetClassImplicit-001.ttl
new file mode 100644
index 00000000..05cafccb
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/targetClassImplicit-001.ttl
@@ -0,0 +1,58 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/targets/targetClassImplicit-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance
+ rdf:type ex:SubClass ;
+ rdfs:label "Invalid instance" ;
+.
+ex:SubClass
+ rdf:type rdfs:Class ;
+ rdfs:label "Sub class" ;
+ rdfs:subClassOf ex:SuperClass ;
+.
+ex:SuperClass
+ rdf:type rdfs:Class ;
+ rdf:type sh:NodeShape ;
+ rdfs:label "Super class" ;
+ sh:in (
+ ex:ValidInstance
+ ) ;
+.
+ex:ValidInstance
+ rdf:type ex:SubClass ;
+ rdfs:label "Valid instance" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <targetClassImplicit-001>
+ ) ;
+.
+<targetClassImplicit-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of implicit sh:targetClass 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:InConstraintComponent ;
+ sh:sourceShape ex:SuperClass ;
+ sh:value ex:InvalidInstance ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/targets/targetNode-001.ttl b/tests/w3c-shacl/core/targets/targetNode-001.ttl
new file mode 100644
index 00000000..195e3ffc
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/targetNode-001.ttl
@@ -0,0 +1,57 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/targets/targetNode-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ rdfs:label "Invalid resource 1" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:property ex:TestShape-label ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:TestShape-label
+ sh:path rdfs:label ;
+ rdfs:label "label" ;
+ sh:datatype xsd:string ;
+ sh:maxCount 0 ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <targetNode-001>
+ ) ;
+.
+<targetNode-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:targetNode 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath rdfs:label ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:TestShape-label ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/targets/targetObjectsOf-001.ttl b/tests/w3c-shacl/core/targets/targetObjectsOf-001.ttl
new file mode 100644
index 00000000..09eeea65
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/targetObjectsOf-001.ttl
@@ -0,0 +1,65 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/targets/targetObjectsOf-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ ex:testProperty "String" ;
+.
+ex:InvalidResource2
+ ex:testProperty rdfs:Resource ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:datatype xsd:integer ;
+ sh:targetObjectsOf ex:testProperty ;
+.
+ex:ValidResource1
+ ex:testProperty 100 ;
+ ex:testProperty 42 ;
+.
+ex:testProperty
+ rdf:type rdf:Property ;
+ rdfs:label "test property" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <targetObjectsOf-001>
+ ) ;
+.
+<targetObjectsOf-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:targetObjectsOf 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode rdfs:Resource ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value rdfs:Resource ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "String" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "String" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/targets/targetSubjectsOf-001.ttl b/tests/w3c-shacl/core/targets/targetSubjectsOf-001.ttl
new file mode 100644
index 00000000..9069f17b
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/targetSubjectsOf-001.ttl
@@ -0,0 +1,57 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/targets/targetSubjectsOf-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ ex:myProperty "A" ;
+ ex:myProperty "B" ;
+.
+ex:MyClass
+ rdf:type rdfs:Class ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-myProperty ;
+ sh:targetSubjectsOf ex:myProperty ;
+.
+ex:TestShape-myProperty
+ rdf:type sh:PropertyShape ;
+ sh:path ex:myProperty ;
+ sh:maxCount 1 ;
+.
+ex:ValidInstance1
+ ex:myProperty "A" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <targetSubjectsOf-001>
+ ) ;
+.
+<targetSubjectsOf-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:targetSubjectsOf 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:TestShape-myProperty ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/targets/targetSubjectsOf-002.ttl b/tests/w3c-shacl/core/targets/targetSubjectsOf-002.ttl
new file mode 100644
index 00000000..e4adacdc
--- /dev/null
+++ b/tests/w3c-shacl/core/targets/targetSubjectsOf-002.ttl
@@ -0,0 +1,74 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/core/targets/targetSubjectsOf-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidInstance1
+ rdf:type ex:MyClass ;
+ ex:myProperty "A" ;
+ ex:myProperty "B" ;
+.
+ex:InvalidInstance2
+ ex:myProperty "A" ;
+ ex:myProperty "B" ;
+.
+ex:MyClass
+ rdf:type rdfs:Class ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:property ex:TestShape-myProperty ;
+ sh:targetClass ex:MyClass ;
+ sh:targetSubjectsOf ex:myProperty ;
+.
+ex:TestShape-myProperty
+ sh:path ex:myProperty ;
+ sh:maxCount 1 ;
+.
+ex:ValidInstance1
+ rdf:type ex:MyClass ;
+ ex:myProperty "A" ;
+.
+ex:ValidInstance2
+ ex:myProperty "A" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <targetSubjectsOf-002>
+ ) ;
+.
+<targetSubjectsOf-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:targetSubjectsOf 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance1 ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:TestShape-myProperty ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidInstance2 ;
+ sh:resultPath ex:myProperty ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
+ sh:sourceShape ex:TestShape-myProperty ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/core/validation-reports/manifest.ttl b/tests/w3c-shacl/core/validation-reports/manifest.ttl
new file mode 100644
index 00000000..b200ca17
--- /dev/null
+++ b/tests/w3c-shacl/core/validation-reports/manifest.ttl
@@ -0,0 +1,9 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests for validation reports" ;
+ mf:include <shared.ttl> ;
+.
diff --git a/tests/w3c-shacl/core/validation-reports/shared-data.ttl b/tests/w3c-shacl/core/validation-reports/shared-data.ttl
new file mode 100644
index 00000000..5263a71c
--- /dev/null
+++ b/tests/w3c-shacl/core/validation-reports/shared-data.ttl
@@ -0,0 +1,4 @@
+@prefix ex: <http://example.org/shacl-test/> .
+ex:i ex:p ex:j .
+ex:i ex:q ex:j .
+ex:j ex:r ex:k .
diff --git a/tests/w3c-shacl/core/validation-reports/shared-shapes.ttl b/tests/w3c-shacl/core/validation-reports/shared-shapes.ttl
new file mode 100644
index 00000000..26f4b731
--- /dev/null
+++ b/tests/w3c-shacl/core/validation-reports/shared-shapes.ttl
@@ -0,0 +1,16 @@
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix ex: <http://example.org/shacl-test/> .
+
+ex:s1 a sh:NodeShape ;
+ sh:targetNode ex:i ;
+ sh:property ex:s2 ;
+ sh:property ex:s3 .
+
+ex:s2 sh:path ex:p ;
+ sh:property ex:s4 .
+
+ex:s3 sh:path ex:q ;
+ sh:property ex:s4 .
+
+ex:s4 sh:path ex:r ;
+ sh:class ex:C .
diff --git a/tests/w3c-shacl/core/validation-reports/shared.ttl b/tests/w3c-shacl/core/validation-reports/shared.ttl
new file mode 100644
index 00000000..ae4b01ca
--- /dev/null
+++ b/tests/w3c-shacl/core/validation-reports/shared.ttl
@@ -0,0 +1,52 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+@prefix ex: <http://example.org/shacl-test/> .
+
+# This test case is under discussion, as there are different interpretations
+# on whether the nested sh:property constraint that is reached twice should
+# also be reported twice.
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <shared>
+ ) ;
+.
+
+<shared>
+ rdf:type sht:Validate;
+ rdfs:label "Test of validation report for shape shared by property constraints" ;
+ mf:action [
+ sht:dataGraph <shared-data.ttl> ;
+ sht:shapesGraph <shared-shapes.ttl>
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:j ;
+ sh:value ex:k ;
+ sh:resultPath ex:r ;
+ sh:sourceShape ex:s4 ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:resultSeverity sh:Violation ;
+ sh:focusNode ex:j ;
+ sh:value ex:k ;
+ sh:resultPath ex:r ;
+ sh:sourceShape ex:s4 ;
+ sh:sourceConstraintComponent sh:ClassConstraintComponent
+ ]
+ ] ;
+ mf:status sht:approved .
+
\ No newline at end of file
diff --git a/tests/w3c-shacl/manifest.ttl b/tests/w3c-shacl/manifest.ttl
new file mode 100644
index 00000000..08a5a1b9
--- /dev/null
+++ b/tests/w3c-shacl/manifest.ttl
@@ -0,0 +1,9 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ mf:include <core/manifest.ttl> ;
+ mf:include <sparql/manifest.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/sparql/component/manifest.ttl b/tests/w3c-shacl/sparql/component/manifest.ttl
new file mode 100644
index 00000000..631566a2
--- /dev/null
+++ b/tests/w3c-shacl/sparql/component/manifest.ttl
@@ -0,0 +1,11 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/component" ;
+ mf:include <optional-001.ttl> ;
+ mf:include <propertyValidator-select-001.ttl> ;
+ mf:include <validator-001.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/sparql/component/nodeValidator-001.ttl b/tests/w3c-shacl/sparql/component/nodeValidator-001.ttl
new file mode 100644
index 00000000..1bcabc45
--- /dev/null
+++ b/tests/w3c-shacl/sparql/component/nodeValidator-001.ttl
@@ -0,0 +1,83 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test>
+ sh:declare [
+ rdf:type sh:PrefixDeclaration ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test#"^^xsd:anyURI ;
+ sh:prefix "ex" ;
+ ] ;
+.
+ex:InvalidResource1
+ ex:property "Other" ;
+.
+ex:TestConstraintComponent
+ rdf:type sh:ConstraintComponent ;
+ rdfs:label "Test constraint component" ;
+ sh:nodeValidator [
+ rdf:type sh:SPARQLSelectValidator ;
+ sh:select """
+ SELECT DISTINCT $this
+ WHERE {
+ $this ?p ?o .
+ FILTER NOT EXISTS {
+ $this ex:property ?requiredParam .
+ }}""" ;
+ sh:prefixes <http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test> ;
+ ] ;
+ sh:parameter [
+ sh:path ex:optionalParam ;
+ sh:datatype xsd:integer ;
+ sh:name "optional param" ;
+ sh:optional "true"^^xsd:boolean ;
+ ] ;
+ sh:parameter [
+ sh:path ex:requiredParam ;
+ sh:datatype xsd:string ;
+ sh:name "required param" ;
+ ] ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ ex:requiredParam "Value" ;
+ rdfs:label "Test shape" ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:ValidResource1
+ ex:property "Value" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <nodeValidator-001>
+ ) ;
+.
+<nodeValidator-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:nodeValidator 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:TestConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource1 ;
+ ] ;
+ ] ;
+ mf:status sht:proposed ;
+.
\ No newline at end of file
diff --git a/tests/w3c-shacl/sparql/component/optional-001.ttl b/tests/w3c-shacl/sparql/component/optional-001.ttl
new file mode 100644
index 00000000..0f3ba1f8
--- /dev/null
+++ b/tests/w3c-shacl/sparql/component/optional-001.ttl
@@ -0,0 +1,113 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/component/optional-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://datashapes.org/sh/tests/sparql/component/optional-001.test>
+ sh:declare [
+ rdf:type sh:PrefixDeclaration ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/component/optional-001.test#"^^xsd:anyURI ;
+ sh:prefix "ex" ;
+ ] ;
+.
+ex:IncompleteShape
+ rdf:type sh:NodeShape ;
+ ex:optionalParam "Some" ;
+ rdfs:label "Incomplete shape" ;
+ sh:targetNode "One" ;
+ sh:targetNode "Three" ;
+ sh:targetNode "Two" ;
+.
+ex:TestConstraintComponent
+ rdf:type sh:ConstraintComponent ;
+ rdfs:label "Test constraint component" ;
+ sh:parameter [
+ sh:path ex:optionalParam ;
+ sh:name "optional param" ;
+ sh:optional "true"^^xsd:boolean ;
+ ] ;
+ sh:parameter [
+ sh:path ex:requiredParam ;
+ sh:name "required param" ;
+ ] ;
+ sh:validator [
+ rdf:type sh:SPARQLAskValidator ;
+ sh:ask """ASK {
+ FILTER ($value != $requiredParam && $value != COALESCE(?optionalParam, \"Three\")) .
+}""" ;
+ sh:prefixes <http://datashapes.org/sh/tests/sparql/component/optional-001.test> ;
+ ] ;
+.
+ex:TestShape1
+ rdf:type sh:NodeShape ;
+ ex:requiredParam "One" ;
+ rdfs:label "Test shape 1" ;
+ sh:targetNode "One" ;
+ sh:targetNode "Three" ;
+ sh:targetNode "Two" ;
+.
+ex:TestShape2
+ rdf:type sh:NodeShape ;
+ ex:optionalParam "Two" ;
+ ex:requiredParam "One" ;
+ rdfs:label "Test shape 1" ;
+ sh:targetNode "One" ;
+ sh:targetNode "Three" ;
+ sh:targetNode "Two" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <optional-001>
+ ) ;
+.
+<optional-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:optional 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "One" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:TestConstraintComponent ;
+ sh:sourceShape ex:TestShape1 ;
+ sh:value "One" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "One" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:TestConstraintComponent ;
+ sh:sourceShape ex:TestShape2 ;
+ sh:value "One" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Three" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:TestConstraintComponent ;
+ sh:sourceShape ex:TestShape1 ;
+ sh:value "Three" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Two" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:TestConstraintComponent ;
+ sh:sourceShape ex:TestShape2 ;
+ sh:value "Two" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/component/propertyValidator-select-001.ttl b/tests/w3c-shacl/sparql/component/propertyValidator-select-001.ttl
new file mode 100644
index 00000000..a501c542
--- /dev/null
+++ b/tests/w3c-shacl/sparql/component/propertyValidator-select-001.ttl
@@ -0,0 +1,107 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/component/propertyValidator-select-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Country
+ rdf:type rdfs:Class ;
+ rdfs:label "Country" ;
+.
+ex:InvalidCountry1
+ rdf:type ex:Country ;
+ ex:englishLabel "Munich" ;
+ ex:germanLabel "Muenchen" ;
+ rdfs:label "Invalid country1" ;
+.
+ex:LanguageConstraintComponentUsingSELECT
+ rdf:type sh:ConstraintComponent ;
+ rdfs:label "Language constraint component" ;
+ sh:labelTemplate "Values are literals with language \"{$lang}\"" ;
+ sh:parameter [
+ sh:path ex:lang ;
+ sh:datatype xsd:string ;
+ sh:description "The language tag, e.g. \"de\"." ;
+ sh:minLength 2 ;
+ sh:name "language" ;
+ ] ;
+ sh:propertyValidator [
+ rdf:type sh:SPARQLSelectValidator ;
+ sh:message "Values are literals with language \"{?lang}\"" ;
+ sh:prefixes <http://datashapes.org/sh/tests/sparql/component/LanguageConstraintComponentUsingSELECT.test> ;
+ sh:select """
+ SELECT DISTINCT $this ?value
+ WHERE {
+ $this $PATH ?value .
+ FILTER (!isLiteral(?value) || !langMatches(lang(?value), $lang))
+ }
+ """ ;
+ ] ;
+.
+ex:LanguageExampleShape
+ rdf:type sh:NodeShape ;
+ sh:property _:b56647 ;
+ sh:property _:b71712 ;
+ sh:targetClass ex:Country ;
+.
+ex:ValidCountry1
+ rdf:type ex:Country ;
+ ex:englishLabel "Beijing"@en ;
+ ex:germanLabel "Peking"@de ;
+ rdfs:label "Valid country1" ;
+.
+ex:englishLabel
+ rdfs:domain ex:Country ;
+.
+ex:germanLabel
+ rdfs:domain ex:Country ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <propertyValidator-select-001>
+ ) ;
+.
+<propertyValidator-select-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:propertyValidator with SELECT 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidCountry1 ;
+ sh:resultPath ex:englishLabel ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:LanguageConstraintComponentUsingSELECT ;
+ sh:sourceShape _:b56647 ;
+ sh:value "Munich" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidCountry1 ;
+ sh:resultPath ex:germanLabel ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:LanguageConstraintComponentUsingSELECT ;
+ sh:sourceShape _:b71712 ;
+ sh:value "Muenchen" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
+_:b56647
+ sh:path ex:englishLabel ;
+ ex:lang "en" ;
+.
+_:b71712
+ sh:path ex:germanLabel ;
+ ex:lang "de" ;
+.
diff --git a/tests/w3c-shacl/sparql/component/validator-001.ttl b/tests/w3c-shacl/sparql/component/validator-001.ttl
new file mode 100644
index 00000000..67b9d94a
--- /dev/null
+++ b/tests/w3c-shacl/sparql/component/validator-001.ttl
@@ -0,0 +1,81 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/component/validator-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://datashapes.org/sh/tests/sparql/component/validator-001.test>
+ owl:imports <http://datashapes.org/dash> ;
+.
+ex:ConstraintComponent
+ rdf:type rdfs:Class ;
+ rdfs:label "Constraint component" ;
+ rdfs:subClassOf sh:ConstraintComponent ;
+.
+ex:SPARQLAskValidator
+ rdfs:subClassOf sh:SPARQLAskValidator ;
+.
+ex:TestConstraintComponent
+ rdf:type ex:ConstraintComponent ;
+ rdfs:comment """A simple test component with two parameters, which flags all values as invalid unless they are the concatenation of the two parameters.
+
+Part of this test is to also use various subclasses of the system classes.""" ;
+ rdfs:label "Test constraint component" ;
+ sh:parameter ex:TestParameter1 ;
+ sh:parameter ex:TestParameter2 ;
+ sh:validator [
+ rdf:type ex:SPARQLAskValidator ;
+ sh:ask """
+ASK { FILTER (?value = CONCAT($test1, $test2)) }
+ """ ;
+ ] ;
+.
+ex:TestParameter1
+ rdf:type sh:Parameter ;
+ sh:path ex:test1 ;
+ sh:datatype xsd:string ;
+.
+ex:TestParameter2
+ rdf:type sh:Parameter ;
+ sh:path ex:test2 ;
+ sh:datatype xsd:string ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ ex:test1 "Hello " ;
+ ex:test2 "World" ;
+ rdfs:label "Test shape" ;
+ sh:targetNode "Hallo Welt" ;
+ sh:targetNode "Hello World" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <validator-001>
+ ) ;
+.
+<validator-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:validator 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode "Hallo Welt" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent ex:TestConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Hallo Welt" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/manifest.ttl b/tests/w3c-shacl/sparql/manifest.ttl
new file mode 100644
index 00000000..d823c551
--- /dev/null
+++ b/tests/w3c-shacl/sparql/manifest.ttl
@@ -0,0 +1,11 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ mf:include <component/manifest.ttl> ;
+ mf:include <node/manifest.ttl> ;
+ mf:include <property/manifest.ttl> ;
+ mf:include <pre-binding/manifest.ttl> ;
+ .
diff --git a/tests/w3c-shacl/sparql/node/manifest.ttl b/tests/w3c-shacl/sparql/node/manifest.ttl
new file mode 100644
index 00000000..c5f4b86e
--- /dev/null
+++ b/tests/w3c-shacl/sparql/node/manifest.ttl
@@ -0,0 +1,12 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/node" ;
+ mf:include <prefixes-001.ttl> ;
+ mf:include <sparql-001.ttl> ;
+ mf:include <sparql-002.ttl> ;
+ mf:include <sparql-003.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/sparql/node/prefixes-001.ttl b/tests/w3c-shacl/sparql/node/prefixes-001.ttl
new file mode 100644
index 00000000..de29d1f6
--- /dev/null
+++ b/tests/w3c-shacl/sparql/node/prefixes-001.ttl
@@ -0,0 +1,70 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/node/prefixes-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://datashapes.org/sh/tests/sparql/node/prefixes-001.test>
+ sh:declare [
+ rdf:type sh:PrefixDeclaration ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/node/prefixes-001.test#"^^xsd:anyURI ;
+ sh:prefix "ex" ;
+ ] ;
+.
+ex:InvalidResource1
+ ex:property <http://test.com/ns#Value> ;
+.
+ex:TestPrefixes
+ owl:imports <http://datashapes.org/sh/tests/sparql/node/prefixes-001.test> ;
+ sh:declare [
+ sh:namespace "http://test.com/ns#"^^xsd:anyURI ;
+ sh:prefix "test" ;
+ ] ;
+.
+ex:TestSPARQL
+ sh:prefixes ex:TestPrefixes ;
+ sh:select """
+ SELECT $this ?value
+ WHERE {
+ $this ex:property ?value .
+ FILTER (?value = test:Value) .
+ } """ ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ sh:sparql ex:TestSPARQL ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <prefixes-001>
+ ) ;
+.
+<prefixes-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:prefixes 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestSPARQL ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value <http://test.com/ns#Value> ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/node/sparql-001.ttl b/tests/w3c-shacl/sparql/node/sparql-001.ttl
new file mode 100644
index 00000000..eae95ebc
--- /dev/null
+++ b/tests/w3c-shacl/sparql/node/sparql-001.ttl
@@ -0,0 +1,89 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/node/sparql-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:InvalidResource1
+ rdf:type rdfs:Resource ;
+ rdfs:label "Invalid resource 1" ;
+.
+ex:InvalidResource2
+ rdf:type rdfs:Resource ;
+ rdfs:label "Invalid label 1" ;
+ rdfs:label "Invalid label 2" ;
+.
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource1 ;
+ sh:targetNode ex:InvalidResource2 ;
+ sh:targetNode ex:ValidResource1 ;
+.
+ex:TestShape-sparql
+ sh:message "Cannot have a label" ;
+ sh:prefixes <http://datashapes.org/sh/tests/sparql/node/sparql-001.test> ;
+ sh:select """
+ SELECT $this ?path ?value
+ WHERE {
+ $this ?path ?value .
+ FILTER (?path = <http://www.w3.org/2000/01/rdf-schema#label>) .
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <sparql-001>
+ ) ;
+.
+<sparql-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:sparql at node shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource1 ;
+ sh:resultPath rdfs:label ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Invalid resource 1" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath rdfs:label ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Invalid label 1" ;
+ ] ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource2 ;
+ sh:resultPath rdfs:label ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value "Invalid label 2" ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/node/sparql-002.ttl b/tests/w3c-shacl/sparql/node/sparql-002.ttl
new file mode 100644
index 00000000..e6dd7c11
--- /dev/null
+++ b/tests/w3c-shacl/sparql/node/sparql-002.ttl
@@ -0,0 +1,69 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/node/sparql-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://datashapes.org/sh/tests/sparql/node/sparql-002.test>
+ sh:declare [
+ rdf:type sh:PrefixDeclaration ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-002.test#"^^xsd:anyURI ;
+ sh:prefix "ex" ;
+ ] ;
+.
+ex:InvalidCountry
+ rdf:type ex:Country ;
+ ex:germanLabel "Spain"@en ;
+.
+ex:LanguageExampleShape
+ rdf:type sh:NodeShape ;
+ rdf:type sh:SPARQLConstraint ;
+ sh:message "Values are literals with German language tag." ;
+ sh:prefixes <http://datashapes.org/sh/tests/sparql/node/sparql-002.test> ;
+ sh:select """
+ SELECT $this (ex:germanLabel AS ?path) ?value
+ WHERE {
+ $this ex:germanLabel ?value .
+ FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\"))
+ }
+ """ ;
+ sh:sparql ex:LanguageExampleShape ;
+ sh:targetClass ex:Country ;
+.
+ex:ValidCountry
+ rdf:type ex:Country ;
+ ex:germanLabel "Spanien"@de ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <sparql-002>
+ ) ;
+.
+<sparql-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:sparql at node shape 002" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidCountry ;
+ sh:resultPath ex:germanLabel ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:LanguageExampleShape ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:LanguageExampleShape ;
+ sh:value "Spain"@en ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/node/sparql-003.ttl b/tests/w3c-shacl/sparql/node/sparql-003.ttl
new file mode 100644
index 00000000..2c603e1a
--- /dev/null
+++ b/tests/w3c-shacl/sparql/node/sparql-003.ttl
@@ -0,0 +1,70 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/node/sparql-003.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://datashapes.org/sh/tests/sparql/node/sparql-003.test>
+ sh:declare [
+ rdf:type sh:PrefixDeclaration ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-003.test#"^^xsd:anyURI ;
+ sh:prefix "ex" ;
+ ] ;
+.
+ex:InvalidCountry
+ rdf:type ex:Country ;
+ ex:germanLabel "Spain"@en ;
+.
+ex:LanguageExampleShape
+ rdf:type sh:NodeShape ;
+ rdf:type sh:SPARQLConstraint ;
+ sh:message "Values are literals with German language tag." ;
+ sh:prefixes <http://datashapes.org/sh/tests/sparql/node/sparql-003.test> ;
+ sh:select """
+ SELECT $this (ex:germanLabel AS ?path)
+ WHERE {
+ $this ex:germanLabel ?value .
+ FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\"))
+ }
+ """ ;
+ sh:severity sh:Warning ;
+ sh:sparql ex:LanguageExampleShape ;
+ sh:targetClass ex:Country ;
+.
+ex:ValidCountry
+ rdf:type ex:Country ;
+ ex:germanLabel "Spanien"@de ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <sparql-003>
+ ) ;
+.
+<sparql-003>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:sparql at node shape 003" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidCountry ;
+ sh:resultPath ex:germanLabel ;
+ sh:resultSeverity sh:Warning ;
+ sh:sourceConstraint ex:LanguageExampleShape ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:LanguageExampleShape ;
+ sh:value ex:InvalidCountry ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/manifest.ttl b/tests/w3c-shacl/sparql/pre-binding/manifest.ttl
new file mode 100644
index 00000000..187159a6
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/manifest.ttl
@@ -0,0 +1,22 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests for pre-binding" ;
+ mf:include <pre-binding-001.ttl> ;
+ mf:include <pre-binding-002.ttl> ;
+ mf:include <pre-binding-003.ttl> ;
+ mf:include <pre-binding-004.ttl> ;
+ mf:include <pre-binding-005.ttl> ;
+ mf:include <pre-binding-006.ttl> ;
+ mf:include <pre-binding-007.ttl> ;
+ mf:include <shapesGraph-001.ttl> ;
+ mf:include <unsupported-sparql-001.ttl> ;
+ mf:include <unsupported-sparql-002.ttl> ;
+ mf:include <unsupported-sparql-003.ttl> ;
+ mf:include <unsupported-sparql-004.ttl> ;
+ mf:include <unsupported-sparql-005.ttl> ;
+ mf:include <unsupported-sparql-006.ttl> ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/pre-binding-001.ttl b/tests/w3c-shacl/sparql/pre-binding/pre-binding-001.ttl
new file mode 100644
index 00000000..cf902754
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/pre-binding-001.ttl
@@ -0,0 +1,63 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-001.test#"^^xsd:anyURI ;
+ ] .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape-sparql
+ sh:message "Test message" ;
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ FILTER ($this = ex:InvalidResource) .
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pre-binding-001>
+ ) ;
+.
+<pre-binding-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of pre-binding in FILTER" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultMessage "Test message" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/pre-binding-002.ttl b/tests/w3c-shacl/sparql/pre-binding/pre-binding-002.ttl
new file mode 100644
index 00000000..819b6816
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/pre-binding-002.ttl
@@ -0,0 +1,67 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-002.test#"^^xsd:anyURI ;
+ ] .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape-sparql
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ {
+ FILTER (false) .
+ }
+ UNION
+ {
+ FILTER ($this = ex:InvalidResource) .
+ }
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pre-binding-002>
+ ) ;
+.
+<pre-binding-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of pre-binding in UNION" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/pre-binding-003.ttl b/tests/w3c-shacl/sparql/pre-binding/pre-binding-003.ttl
new file mode 100644
index 00000000..2cc510c4
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/pre-binding-003.ttl
@@ -0,0 +1,67 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-003.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-003.test#"^^xsd:anyURI ;
+ ] .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape-sparql
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ {
+ {
+ FILTER ($this = ex:InvalidResource) .
+ }
+ FILTER bound($this) .
+ }
+ FILTER (true) .
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pre-binding-003>
+ ) ;
+.
+<pre-binding-003>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of pre-binding in inner {...} blocks" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/pre-binding-004.ttl b/tests/w3c-shacl/sparql/pre-binding/pre-binding-004.ttl
new file mode 100644
index 00000000..e19c2e0d
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/pre-binding-004.ttl
@@ -0,0 +1,62 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-004.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-004.test#"^^xsd:anyURI ;
+ ] .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape-sparql
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ BIND ($this AS ?that) .
+ FILTER (?that = ex:InvalidResource) .
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pre-binding-004>
+ ) ;
+.
+<pre-binding-004>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of pre-binding in BIND expressions" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/pre-binding-005.ttl b/tests/w3c-shacl/sparql/pre-binding/pre-binding-005.ttl
new file mode 100644
index 00000000..83790bb3
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/pre-binding-005.ttl
@@ -0,0 +1,68 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-005.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-005.test#"^^xsd:anyURI ;
+ ] .
+
+ex:InvalidResource
+ ex:property "Label" .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape-sparql
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ {
+ FILTER (bound($this))
+ }
+ $this ex:property "Label" .
+ FILTER (bound($this)) .
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pre-binding-005>
+ ) ;
+.
+<pre-binding-005>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of pre-binding in BGP and FILTER" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/pre-binding-006.ttl b/tests/w3c-shacl/sparql/pre-binding/pre-binding-006.ttl
new file mode 100644
index 00000000..5e8062b6
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/pre-binding-006.ttl
@@ -0,0 +1,54 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-006.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-006.test#"^^xsd:anyURI ;
+ ] .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape-sparql
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ {
+ SELECT *
+ WHERE {
+ FILTER ($this = ex:InvalidResource) .
+ }
+ }
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pre-binding-006>
+ ) ;
+.
+<pre-binding-006>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of pre-binding in nested SELECT" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result sht:Failure ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/pre-binding-007.ttl b/tests/w3c-shacl/sparql/pre-binding/pre-binding-007.ttl
new file mode 100644
index 00000000..bba550e6
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/pre-binding-007.ttl
@@ -0,0 +1,66 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-007.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-007.test#"^^xsd:anyURI ;
+ ] .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+.
+ex:TestShape-sparql
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ {
+ SELECT $this
+ WHERE {
+ FILTER ($this = ex:InvalidResource) .
+ }
+ }
+ }""" ;
+.
+ex:ValidResource1
+ rdf:type rdfs:Resource ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <pre-binding-007>
+ ) ;
+.
+<pre-binding-007>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of pre-binding in nested SELECT" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/shapesGraph-001.ttl b/tests/w3c-shacl/sparql/pre-binding/shapesGraph-001.ttl
new file mode 100644
index 00000000..c8058512
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/shapesGraph-001.ttl
@@ -0,0 +1,64 @@
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/shapesGraph-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:
+ sh:declare [
+ sh:prefix "ex" ;
+ sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/shapesGraph-001.test#"^^xsd:anyURI ;
+ ] .
+
+ex:TestShape
+ rdf:type sh:NodeShape ;
+ rdfs:label "Test shape" ;
+ sh:sparql ex:TestShape-sparql ;
+ sh:targetNode ex:InvalidResource ;
+ ex:property 42 ;
+.
+ex:TestShape-sparql
+ sh:message "Test message" ;
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this
+ WHERE {
+ FILTER bound($shapesGraph) .
+ GRAPH $shapesGraph {
+ FILTER bound($currentShape) .
+ $currentShape ex:property 42 .
+ }
+ }""" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <shapesGraph-001>
+ ) ;
+.
+<shapesGraph-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of $shapesGraph and $currentShape" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidResource ;
+ sh:resultMessage "Test message" ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:TestShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:TestShape ;
+ sh:value ex:InvalidResource ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-001.ttl b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-001.ttl
new file mode 100644
index 00000000..ddc007aa
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-001.ttl
@@ -0,0 +1,34 @@
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/unsupported-sparql-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries ( <unsupported-sparql-001> ) .
+
+<unsupported-sparql-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of unsupported MINUS" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result sht:Failure ;
+ mf:status sht:approved .
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:targetNode ex:InvalidResource ;
+ sh:sparql [
+ sh:select """
+ SELECT $this
+ WHERE {
+ $this ?x ?any .
+ MINUS { $this ?x "Value" }
+ }""" ;
+ ] .
diff --git a/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-002.ttl b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-002.ttl
new file mode 100644
index 00000000..529ef9a0
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-002.ttl
@@ -0,0 +1,33 @@
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/unsupported-sparql-002.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries ( <unsupported-sparql-002> ) .
+
+<unsupported-sparql-002>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of unsupported VALUES" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result sht:Failure ;
+ mf:status sht:approved .
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:targetNode ex:InvalidResource ;
+ sh:sparql [
+ sh:select """
+ SELECT $this
+ WHERE {
+ VALUES ?any { true }
+ }""" ;
+ ] .
diff --git a/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-003.ttl b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-003.ttl
new file mode 100644
index 00000000..02c191ec
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-003.ttl
@@ -0,0 +1,36 @@
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/unsupported-sparql-003.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries ( <unsupported-sparql-003> ) .
+
+<unsupported-sparql-003>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of unsupported SERVICE" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result sht:Failure ;
+ mf:status sht:approved .
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:targetNode ex:InvalidResource ;
+ sh:sparql [
+ sh:select """
+ SELECT $this
+ WHERE {
+ $this ?x ?any .
+ SERVICE <http://aldi.de> {
+ ?a ?b ?c .
+ }
+ }""" ;
+ ] .
diff --git a/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-004.ttl b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-004.ttl
new file mode 100644
index 00000000..7ebf22fa
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-004.ttl
@@ -0,0 +1,39 @@
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/unsupported-sparql-004.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries ( <unsupported-sparql-004> ) .
+
+<unsupported-sparql-004>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of unsupported SELECT" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result sht:Failure ;
+ mf:status sht:approved .
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:targetNode ex:InvalidResource ;
+ sh:sparql [
+ sh:select """
+ SELECT $this
+ WHERE {
+ $this ?x ?any .
+ {
+ SELECT ?other ?b
+ WHERE {
+ ?other ?b ?c .
+ }
+ }
+ }""" ;
+ ] .
diff --git a/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-005.ttl b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-005.ttl
new file mode 100644
index 00000000..3d47bce5
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-005.ttl
@@ -0,0 +1,33 @@
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/unsupported-sparql-005.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries ( <unsupported-sparql-005> ) .
+
+<unsupported-sparql-005>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of unsupported AS ?prebound" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result sht:Failure ;
+ mf:status sht:approved .
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:targetNode ex:InvalidResource ;
+ sh:sparql [
+ sh:select """
+ SELECT $this
+ WHERE {
+ BIND (true AS $this) .
+ }""" ;
+ ] .
diff --git a/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-006.ttl b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-006.ttl
new file mode 100644
index 00000000..89f43743
--- /dev/null
+++ b/tests/w3c-shacl/sparql/pre-binding/unsupported-sparql-006.ttl
@@ -0,0 +1,85 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/pre-binding/unsupported-sparql-006.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Country
+ rdf:type rdfs:Class ;
+ rdfs:label "Country" ;
+.
+ex:InvalidCountry1
+ rdf:type ex:Country ;
+ ex:englishLabel "Munich" ;
+ ex:germanLabel "Muenchen" ;
+ rdfs:label "Invalid country1" ;
+.
+ex:LanguageConstraintComponentUsingASK
+ rdf:type sh:ConstraintComponent ;
+ rdfs:label "Language constraint component" ;
+ sh:labelTemplate "Values are literals with language \"{$lang}\"" ;
+ sh:parameter [
+ sh:path ex:lang ;
+ sh:datatype xsd:string ;
+ sh:description "The language tag, e.g. \"de\"." ;
+ sh:minLength 2 ;
+ sh:name "language" ;
+ ] ;
+ sh:validator ex:hasLang ; # This was changed by HK on 2018-09-21, see https://github.com/w3c/data-shapes/issues/101
+.
+ex:LanguageExampleShape
+ rdf:type sh:NodeShape ;
+ sh:property _:b41651 ;
+ sh:property _:b75747 ;
+ sh:targetClass ex:Country ;
+.
+ex:ValidCountry1
+ rdf:type ex:Country ;
+ ex:englishLabel "Beijing"@en ;
+ ex:germanLabel "Peking"@de ;
+ rdfs:label "Valid country1" ;
+.
+ex:englishLabel
+ rdfs:domain ex:Country ;
+.
+ex:germanLabel
+ rdfs:domain ex:Country ;
+.
+ex:hasLang
+ rdf:type sh:SPARQLAskValidator ;
+ sh:ask """
+ ASK {
+ BIND (true AS ?value) .
+ FILTER (isLiteral(?value) && langMatches(lang(?value), $lang))
+ }
+ """ ;
+ sh:message "Values are literals with language \"{?lang}\"" ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <unsupported-sparql-006>
+ ) ;
+.
+<unsupported-sparql-006>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of ASK trying to reassign ?value" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result sht:Failure ;
+ mf:status sht:approved ;
+.
+_:b41651
+ sh:path ex:englishLabel ;
+ ex:lang "en" ;
+.
+_:b75747
+ sh:path ex:germanLabel ;
+ ex:lang "de" ;
+.
diff --git a/tests/w3c-shacl/sparql/property/manifest.ttl b/tests/w3c-shacl/sparql/property/manifest.ttl
new file mode 100644
index 00000000..bb76f42b
--- /dev/null
+++ b/tests/w3c-shacl/sparql/property/manifest.ttl
@@ -0,0 +1,9 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/property" ;
+ mf:include <sparql-001.ttl> ;
+ .
\ No newline at end of file
diff --git a/tests/w3c-shacl/sparql/property/sparql-001.ttl b/tests/w3c-shacl/sparql/property/sparql-001.ttl
new file mode 100644
index 00000000..d7aae032
--- /dev/null
+++ b/tests/w3c-shacl/sparql/property/sparql-001.ttl
@@ -0,0 +1,68 @@
+@prefix dash: <http://datashapes.org/dash#> .
+@prefix ex: <http://datashapes.org/sh/tests/sparql/property/sparql-001.test#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix sht: <http://www.w3.org/ns/shacl-test#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+ex:Country
+ rdf:type rdfs:Class ;
+.
+ex:InvalidCountry
+ rdf:type ex:Country ;
+ ex:germanLabel "Spain"@en ;
+.
+ex:LanguageExamplePropertyShape
+ rdf:type sh:PropertyShape ;
+ sh:path ex:germanLabel ;
+ sh:sparql ex:LanguageExamplePropertyShape-sparql ;
+ sh:targetClass ex:Country ;
+.
+ex:LanguageExamplePropertyShape-sparql
+ rdf:type sh:SPARQLConstraint ;
+ sh:message "Values are literals with German language tag." ;
+ sh:prefixes ex: ;
+ sh:select """
+ SELECT $this ?value
+ WHERE {
+ $this $PATH ?value .
+ FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\"))
+ }
+ """ ;
+.
+ex:ValidCountry
+ rdf:type ex:Country ;
+ ex:germanLabel "Spanien"@de ;
+.
+<>
+ rdf:type mf:Manifest ;
+ mf:entries (
+ <sparql-001>
+ ) ;
+.
+<sparql-001>
+ rdf:type sht:Validate ;
+ rdfs:label "Test of sh:sparql at property shape 001" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms "false"^^xsd:boolean ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:InvalidCountry ;
+ sh:resultPath ex:germanLabel ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraint ex:LanguageExamplePropertyShape-sparql ;
+ sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
+ sh:sourceShape ex:LanguageExamplePropertyShape ;
+ sh:value "Spain"@en ;
+ ] ;
+ ] ;
+ mf:status sht:approved ;
+.
diff --git a/tests/w3c_shacl_baseline.json b/tests/w3c_shacl_baseline.json
new file mode 100644
index 00000000..9746130b
--- /dev/null
+++ b/tests/w3c_shacl_baseline.json
@@ -0,0 +1,134 @@
+{
+ "note": "W3C SHACL test suite conformance, ratcheted. PASS may not drop, FAIL may not rise, and no named PASS may regress. Regenerate with OO_W3C_SHACL_UPDATE_BASELINE=1 cargo test --test w3c_shacl_conformance_test. Lowering any number here is a deliberate act and should say why.",
+ "suite_commit": "94d8bc2bd4fc4fdc6f2964d1ec4a892329e05f06",
+ "counts": {
+ "total": 120,
+ "pass": 36,
+ "fail": 24,
+ "undetermined": 60,
+ "error": 0
+ },
+ "partial_compliance": 37,
+ "outcomes": {
+ "core/complex/personexample": "UNDETERMINED",
+ "core/complex/shacl-shacl": "UNDETERMINED",
+ "core/misc/deactivated-001": "UNDETERMINED",
+ "core/misc/deactivated-002": "UNDETERMINED",
+ "core/misc/message-001": "UNDETERMINED",
+ "core/misc/severity-001": "UNDETERMINED",
+ "core/misc/severity-002": "FAIL",
+ "core/node/and-001": "UNDETERMINED",
+ "core/node/and-002": "UNDETERMINED",
+ "core/node/class-001": "UNDETERMINED",
+ "core/node/class-002": "UNDETERMINED",
+ "core/node/class-003": "UNDETERMINED",
+ "core/node/closed-001": "UNDETERMINED",
+ "core/node/closed-002": "UNDETERMINED",
+ "core/node/datatype-001": "UNDETERMINED",
+ "core/node/datatype-002": "UNDETERMINED",
+ "core/node/disjoint-001": "UNDETERMINED",
+ "core/node/equals-001": "UNDETERMINED",
+ "core/node/hasValue-001": "UNDETERMINED",
+ "core/node/in-001": "UNDETERMINED",
+ "core/node/languageIn-001": "UNDETERMINED",
+ "core/node/maxExclusive-001": "UNDETERMINED",
+ "core/node/maxInclusive-001": "UNDETERMINED",
+ "core/node/maxLength-001": "UNDETERMINED",
+ "core/node/minExclusive-001": "UNDETERMINED",
+ "core/node/minInclusive-001": "UNDETERMINED",
+ "core/node/minInclusive-002": "UNDETERMINED",
+ "core/node/minInclusive-003": "UNDETERMINED",
+ "core/node/minLength-001": "UNDETERMINED",
+ "core/node/node-001": "UNDETERMINED",
+ "core/node/nodeKind-001": "UNDETERMINED",
+ "core/node/not-001": "UNDETERMINED",
+ "core/node/not-002": "UNDETERMINED",
+ "core/node/or-001": "PASS",
+ "core/node/pattern-001": "UNDETERMINED",
+ "core/node/pattern-002": "UNDETERMINED",
+ "core/node/qualified-001": "UNDETERMINED",
+ "core/node/xone-001": "UNDETERMINED",
+ "core/node/xone-duplicate": "UNDETERMINED",
+ "core/path/path-alternative-001": "FAIL",
+ "core/path/path-complex-001": "FAIL",
+ "core/path/path-complex-002": "FAIL",
+ "core/path/path-inverse-001": "PASS",
+ "core/path/path-oneOrMore-001": "FAIL",
+ "core/path/path-sequence-001": "FAIL",
+ "core/path/path-sequence-002": "FAIL",
+ "core/path/path-sequence-duplicate-001": "UNDETERMINED",
+ "core/path/path-strange-001": "FAIL",
+ "core/path/path-strange-002": "FAIL",
+ "core/path/path-unused-001": "UNDETERMINED",
+ "core/path/path-zeroOrMore-001": "FAIL",
+ "core/path/path-zeroOrOne-001": "FAIL",
+ "core/property/and-001": "UNDETERMINED",
+ "core/property/class-001": "PASS",
+ "core/property/datatype-001": "PASS",
+ "core/property/datatype-002": "PASS",
+ "core/property/datatype-003": "PASS",
+ "core/property/datatype-ill-formed": "FAIL",
+ "core/property/disjoint-001": "UNDETERMINED",
+ "core/property/equals-001": "UNDETERMINED",
+ "core/property/hasValue-001": "PASS",
+ "core/property/in-001": "PASS",
+ "core/property/languageIn-001": "UNDETERMINED",
+ "core/property/lessThan-001": "PASS",
+ "core/property/lessThan-002": "FAIL",
+ "core/property/lessThanOrEquals-001": "PASS",
+ "core/property/maxCount-001": "PASS",
+ "core/property/maxCount-002": "PASS",
+ "core/property/maxExclusive-001": "PASS",
+ "core/property/maxInclusive-001": "PASS",
+ "core/property/maxLength-001": "PASS",
+ "core/property/minCount-001": "PASS",
+ "core/property/minCount-002": "PASS",
+ "core/property/minExclusive-001": "PASS",
+ "core/property/minExclusive-002": "PASS",
+ "core/property/minLength-001": "PASS",
+ "core/property/node-001": "UNDETERMINED",
+ "core/property/node-002": "PASS",
+ "core/property/nodeKind-001": "PASS",
+ "core/property/not-001": "PASS",
+ "core/property/or-001": "PASS",
+ "core/property/or-datatypes-001": "PASS",
+ "core/property/pattern-001": "PASS",
+ "core/property/pattern-002": "UNDETERMINED",
+ "core/property/property-001": "UNDETERMINED",
+ "core/property/qualifiedMinCountDisjoint-001": "UNDETERMINED",
+ "core/property/qualifiedValueShape-001": "UNDETERMINED",
+ "core/property/qualifiedValueShapesDisjoint-001": "UNDETERMINED",
+ "core/property/uniqueLang-001": "UNDETERMINED",
+ "core/property/uniqueLang-002": "PASS",
+ "core/targets/multipleTargets-001": "UNDETERMINED",
+ "core/targets/targetClass-001": "PASS",
+ "core/targets/targetClassImplicit-001": "UNDETERMINED",
+ "core/targets/targetNode-001": "PASS",
+ "core/targets/targetObjectsOf-001": "UNDETERMINED",
+ "core/targets/targetSubjectsOf-001": "PASS",
+ "core/targets/targetSubjectsOf-002": "PASS",
+ "core/validation-reports/shared": "UNDETERMINED",
+ "sparql/component/optional-001": "FAIL",
+ "sparql/component/propertyValidator-select-001": "FAIL",
+ "sparql/component/validator-001": "FAIL",
+ "sparql/node/prefixes-001": "PASS",
+ "sparql/node/sparql-001": "PASS",
+ "sparql/node/sparql-002": "UNDETERMINED",
+ "sparql/node/sparql-003": "UNDETERMINED",
+ "sparql/pre-binding/pre-binding-001": "PASS",
+ "sparql/pre-binding/pre-binding-002": "PASS",
+ "sparql/pre-binding/pre-binding-003": "FAIL",
+ "sparql/pre-binding/pre-binding-004": "FAIL",
+ "sparql/pre-binding/pre-binding-005": "FAIL",
+ "sparql/pre-binding/pre-binding-006": "FAIL",
+ "sparql/pre-binding/pre-binding-007": "PASS",
+ "sparql/pre-binding/shapesGraph-001": "FAIL",
+ "sparql/pre-binding/unsupported-sparql-001": "UNDETERMINED",
+ "sparql/pre-binding/unsupported-sparql-002": "FAIL",
+ "sparql/pre-binding/unsupported-sparql-003": "UNDETERMINED",
+ "sparql/pre-binding/unsupported-sparql-004": "UNDETERMINED",
+ "sparql/pre-binding/unsupported-sparql-005": "UNDETERMINED",
+ "sparql/pre-binding/unsupported-sparql-006": "FAIL",
+ "sparql/property/sparql-001": "FAIL"
+ }
+}
diff --git a/tests/w3c_shacl_conformance_test.rs b/tests/w3c_shacl_conformance_test.rs
new file mode 100644
index 00000000..fbc625b1
--- /dev/null
+++ b/tests/w3c_shacl_conformance_test.rs
@@ -0,0 +1,1106 @@
+//! The official W3C SHACL test suite, run against this engine as a ratchet.
+//!
+//! # Why this exists
+//!
+//! On 13 Sep 2026 an adversarial audit found four SHACL defects by hand, one at
+//! a time: `strip_quotes` truncating a typed literal mid-query, a blank-node
+//! node shape splicing into SPARQL as a non-distinguished variable, a
+//! `sh:deactivated true` honoured on shapes and ignored on a `sh:sparql`
+//! constraint node, and `sh:prefixes` never resolved so a twice-bound prefix
+//! was decided by store row order (`tests/shacl_audit_regressions_test.rs`).
+//! Every one of those is a conformance gap against a published Recommendation,
+//! and the Working Group publishes a machine-readable suite that enumerates
+//! gaps of exactly that kind in seconds. This repository was not running it.
+//! Finding conformance bugs by inspection when the standards body ships the
+//! list is the expensive way to be wrong.
+//!
+//! # What this file measures, and what it does not
+//!
+//! The suite is manifest-driven. `tests/w3c-shacl/manifest.ttl` includes a tree
+//! of manifests down to individual test files; each file carries one entry
+//! typed `sht:Validate` with an `mf:action` naming a data graph and a shapes
+//! graph, and an `mf:result` giving either an expected `sh:ValidationReport` or
+//! the sentinel `sht:Failure`.
+//!
+//! The suite's own report (<https://w3c.github.io/data-shapes/data-shapes-test-suite/>)
+//! defines two levels. **Partial compliance** is agreeing on the `sh:conforms`
+//! boolean and nothing else. **Full compliance** is producing a report
+//! isomorphic to the expected one over a fixed predicate list. This harness
+//! sits between them, deliberately, and the line is:
+//!
+//! COMPARED
+//! * the `sh:conforms` verdict, whenever the engine gives one;
+//! * the SET of `(focus node, sh:sourceShape, sh:sourceConstraintComponent)`
+//! triples, one per validation result, on both sides. The engine emits
+//! `source_shape` and `source_constraint_component` on every violation
+//! (#131), so this is a real comparison and not a proxy.
+//!
+//! IGNORED, each for a stated reason
+//! * `sh:resultPath`. Paths are blank-node structures for anything past a
+//! plain predicate (`sh:inversePath`, `sh:alternativePath`, sequences), and
+//! comparing them needs the graph-isomorphism step full compliance
+//! requires. Comparing only the easy half would silently pass the hard
+//! half, which is the failure mode this repository exists to catch.
+//! * `sh:value`. Same argument, and it is redundant with the focus node for
+//! most node-shape tests.
+//! * `sh:resultSeverity`. The engine's `severity` field is not yet driven by
+//! `sh:severity` in the shapes graph; including it would collapse a
+//! specific, nameable gap into a generic mismatch on dozens of tests
+//! instead of leaving it visible as its own future comparison.
+//! * `sh:resultMessage`. The suite itself only compares messages that the
+//! expected graph names explicitly.
+//! * MULTIPLICITY. The comparison is over sets, not multisets. One test in
+//! the suite turns on multiplicity, `core/validation-reports/shared`, whose
+//! own comment records that the Working Group has not settled whether a
+//! nested shape reached twice is reported twice. `src/shacl.rs` documents a
+//! deliberate non-deduplication that inflates counts in the other
+//! direction. Set comparison is the answer that does not encode either
+//! unsettled choice into a gate.
+//! * Blank node IDENTITY. A blank node on either side canonicalises to the
+//! opaque token `_:`. Labels are not portable across two parses of the same
+//! file, let alone across engines, and the suite's own guidance is to avoid
+//! blank nodes as `sh:sourceShape` values for this reason. Tests that do
+//! use them (`core/complex/personexample`, `core/property/nodeKind-001`)
+//! are therefore compared more loosely than the rest, and that is named
+//! here rather than hidden.
+//!
+//! # The yardstick is calibrated, not asserted
+//!
+//! A low conformance score means nothing until you know whether the harness is
+//! harsh. `tools/w3c_shacl_pyshacl_oracle.py` runs the same walk and the same
+//! comparison with pyshacl 0.40.1 as the engine. On 2026-09-13, suite commit
+//! 94d8bc2, pyshacl scored PASS 111 / FAIL 8 / ERROR 1 of 120 under this exact
+//! lens, against this engine's PASS 32 / FAIL 26 / UNDETERMINED 62 / ERROR 0.
+//! The comparison is therefore not the reason the number is low. Re-run that
+//! script whenever this file's comparison changes; it is not in CI, because a
+//! gate should not move when someone else's engine does.
+//!
+//! # Four buckets, because this engine has three answers
+//!
+//! PASS the verdict and the result set both agree; or the test expects
+//! `sht:Failure` and `validate` returned an error, which is the
+//! suite's definition of passing such a test.
+//! FAIL the engine answered, and the answer is wrong. The serious
+//! bucket. Sub-labelled `verdict` (wrong `sh:conforms`) or
+//! `results` (right verdict, wrong result set).
+//! UNDETERMINED `conforms: null`. Not a pass and not a failure: the engine
+//! declined to answer because a constraint was not evaluated
+//! (`skipped_constraints`) or no focus node matched
+//! (`unmatched_shapes`). That refusal is the whole design of this
+//! validator and it is counted on its own line. It is NOT credit.
+//! ERROR `validate` returned `Err`, or a graph did not load. Also its
+//! own line, because a crash and a wrong answer need different
+//! work.
+//!
+//! # The gate is a ratchet
+//!
+//! This engine does not pass the whole suite and will not tomorrow. A gate set
+//! at "pass everything" would be red forever, which is the same as no gate; a
+//! gate set at "run it and print" is the silent success this codebase keeps
+//! finding in other people's repositories. So the committed baseline in
+//! `tests/w3c_shacl_baseline.json` records today's answer per test, and the
+//! gate is monotone:
+//!
+//! 1. the PASS count may not drop;
+//! 2. the FAIL count may not rise;
+//! 3. no test that passed in the baseline may stop passing, by name.
+//!
+//! Rule 3 is stronger than the counts and is here because a change that breaks
+//! one test and fixes another leaves both counts flat. All three can only be
+//! satisfied by improvement or by a deliberate, reviewable edit to the
+//! baseline, which is a diff a reviewer can see. Re-cut it with
+//! `OO_W3C_SHACL_UPDATE_BASELINE=1 cargo test --test w3c_shacl_conformance_test`.
+//!
+//! UNDETERMINED and ERROR are reported but not gated. Gating UNDETERMINED
+//! downward would push against the engine's own design principle, and the work
+//! that moves a test out of it lands as a PASS, which rule 1 already counts.
+//!
+//! # One workaround, which is itself a finding
+//!
+//! `ShaclValidator::validate` takes the shapes graph as inline Turtle and
+//! parses it with `RdfParser::from_format(RdfFormat::Turtle)` and no base IRI.
+//! Every file in this suite uses relative IRIs (`<>` for "this graph",
+//! `<minLength-001>` for the entry), which is what any shapes graph published
+//! at a URL looks like, and oxigraph rejects a relative IRI outright when no
+//! base is set. Handing the raw file to `validate` therefore fails to parse for
+//! 121 of 121 tests. The harness loads the shapes file into a `GraphStore` with
+//! an explicit base and hands `validate` the resulting N-Triples, which is
+//! valid Turtle with every IRI already absolute. That is a harness workaround
+//! for an engine gap: the public SHACL entry point has no way to supply a base
+//! IRI. Reported, not fixed, because this task is measurement.
+
+mod common;
+
+use open_ontologies::graph::GraphStore;
+use open_ontologies::shacl::ShaclValidator;
+use oxigraph::io::{RdfFormat, RdfParser};
+use oxigraph::sparql::{QueryResults, SparqlEvaluator};
+use oxigraph::store::Store;
+use serde::{Deserialize, Serialize};
+use std::collections::{BTreeMap, BTreeSet, HashMap};
+use std::io::Cursor;
+use std::path::{Path, PathBuf};
+use std::sync::{Arc, OnceLock};
+
+/// The base every relative IRI in the suite resolves against.
+///
+/// A fixed https base rather than the local `file://` path: the resolved IRIs
+/// end up inside `sh:sourceShape` on both the expected and the actual side, so
+/// a base that varied with the checkout directory would make the comparison
+/// machine-dependent. This one is the suite's published location.
+const SUITE_BASE: &str = "https://w3c.github.io/data-shapes/data-shapes-test-suite/tests/";
+
+/// The upstream commit `tests/w3c-shacl/` was taken from. Recorded in the
+/// baseline so a suite refresh and an engine change are distinguishable in a
+/// diff.
+const SUITE_COMMIT: &str = "94d8bc2bd4fc4fdc6f2964d1ec4a892329e05f06";
+
+/// Entries reachable from the root manifest at `SUITE_COMMIT`.
+///
+/// The tree carries 121 files with an `sht:Validate` entry and 120 of them are
+/// reachable. `sparql/component/nodeValidator-001.ttl` is not named by
+/// `sparql/component/manifest.ttl`, so no manifest-driven harness runs it,
+/// including the Working Group's own. That is an upstream defect against the
+/// suite's own rule that "all approved tests must be reachable from the root
+/// manifest", not a gap in this walk: see `the_vendored_suite_is_whole`, which
+/// names every unreachable file so a refresh that fixes it upstream is visible
+/// here rather than silent.
+const EXPECTED_ENTRIES: usize = 120;
+
+/// Files carrying an `sht:Validate` entry that no manifest includes, at
+/// `SUITE_COMMIT`. Named, not ignored.
+const KNOWN_ORPHANS: [&str; 1] = ["sparql/component/nodeValidator-001.ttl"];
+
+const PREFIXES: &str = r#"
+PREFIX mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>
+PREFIX sht: <http://www.w3.org/ns/shacl-test#>
+PREFIX sh: <http://www.w3.org/ns/shacl#>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+"#;
+
+fn repo() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR"))
+}
+
+fn suite_root() -> PathBuf {
+ repo().join("tests").join("w3c-shacl")
+}
+
+fn baseline_path() -> PathBuf {
+ repo().join("tests").join("w3c_shacl_baseline.json")
+}
+
+/// Loud skip when the vendored suite is not in the tree, fatal under
+/// `OO_REQUIRE_FIXTURES=1`. The CI job sets that, so the gate cannot be
+/// satisfied by the suite having gone missing.
+fn skip() -> bool {
+ common::skip_unless(
+ suite_root().join("manifest.ttl").is_file(),
+ "the vendored W3C SHACL test suite at tests/w3c-shacl/",
+ "see tests/w3c-shacl/README.md for the refresh command; it is normally committed",
+ )
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// Manifest parsing
+// ─────────────────────────────────────────────────────────────────────────────
+
+#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
+struct ResultKey {
+ focus: String,
+ shape: String,
+ component: String,
+}
+
+impl std::fmt::Display for ResultKey {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "({}, {}, {})", short(&self.focus), short(&self.shape), short(&self.component))
+ }
+}
+
+#[derive(Debug, Clone)]
+enum Expectation {
+ /// `mf:result sht:Failure`: the engine is required to report a failure
+ /// rather than a verdict.
+ Failure,
+ Report {
+ conforms: bool,
+ results: BTreeSet<ResultKey>,
+ },
+}
+
+#[derive(Debug, Clone)]
+struct TestCase {
+ /// `core/node/minLength-001`, stable across machines, used as the baseline key.
+ name: String,
+ label: String,
+ status: String,
+ data: PathBuf,
+ shapes: PathBuf,
+ expected: Expectation,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+enum Outcome {
+ Pass,
+ Fail(String),
+ Undetermined(String),
+ Error(String),
+}
+
+impl Outcome {
+ fn bucket(&self) -> &'static str {
+ match self {
+ Outcome::Pass => "PASS",
+ Outcome::Fail(_) => "FAIL",
+ Outcome::Undetermined(_) => "UNDETERMINED",
+ Outcome::Error(_) => "ERROR",
+ }
+ }
+ fn detail(&self) -> &str {
+ match self {
+ Outcome::Pass => "",
+ Outcome::Fail(d) | Outcome::Undetermined(d) | Outcome::Error(d) => d,
+ }
+ }
+}
+
+/// Last path segment or fragment of an IRI, for readable tables. Left alone if
+/// it is not an IRI, so literals and the `_:` token survive unharmed.
+fn short(iri: &str) -> String {
+ if iri.starts_with('"') || iri.starts_with("_:") || !iri.contains(['#', '/']) {
+ return iri.to_string();
+ }
+ iri.rsplit(['#', '/']).next().unwrap_or(iri).to_string()
+}
+
+/// Canonical comparison form for one RDF term printed in N-Triples style.
+///
+/// IRIs lose their angle brackets (the engine already strips them, so this
+/// makes the two sides symmetric). Blank nodes collapse to `_:`; see the
+/// module docs for why. Literals are left exactly as oxigraph printed them,
+/// which is the N-Triples canonical form on both sides.
+fn canon(term: &str) -> String {
+ let t = term.trim();
+ if t.starts_with("_:") {
+ return "_:".to_string();
+ }
+ if let Some(inner) = t.strip_prefix('<').and_then(|s| s.strip_suffix('>')) {
+ return inner.to_string();
+ }
+ t.to_string()
+}
+
+fn rows(store: &Store, query: &str) -> anyhow::Result<Vec<HashMap<String, String>>> {
+ let mut out = Vec::new();
+ if let QueryResults::Solutions(solutions) =
+ SparqlEvaluator::new().parse_query(query)?.on_store(store).execute()?
+ {
+ let vars: Vec<String> = solutions.variables().iter().map(|v| v.as_str().to_string()).collect();
+ for solution in solutions {
+ let solution = solution?;
+ let mut row = HashMap::new();
+ for v in &vars {
+ if let Some(t) = solution.get(v.as_str()) {
+ row.insert(v.clone(), t.to_string());
+ }
+ }
+ out.push(row);
+ }
+ }
+ Ok(out)
+}
+
+fn cell(row: &HashMap<String, String>, var: &str) -> String {
+ row.get(var).cloned().unwrap_or_else(|| "(none)".to_string())
+}
+
+/// Path under `tests/w3c-shacl`, slash-separated, for a file in the suite.
+fn rel(path: &Path) -> String {
+ path.strip_prefix(suite_root())
+ .unwrap_or(path)
+ .components()
+ .map(|c| c.as_os_str().to_string_lossy().to_string())
+ .collect::<Vec<_>>()
+ .join("/")
+}
+
+fn base_of(path: &Path) -> String {
+ format!("{SUITE_BASE}{}", rel(path))
+}
+
+/// Inverse of `base_of`: the local file an absolute suite IRI names.
+fn path_of(iri: &str) -> Option<PathBuf> {
+ iri.strip_prefix(SUITE_BASE).map(|r| suite_root().join(r))
+}
+
+/// Parse one Turtle file into its own store, with the file's own IRI as base.
+fn load_graph(path: &Path) -> anyhow::Result<Store> {
+ let text = std::fs::read_to_string(path)?;
+ let store = Store::new()?;
+ let parser = RdfParser::from_format(RdfFormat::Turtle)
+ .with_base_iri(base_of(path))?
+ .for_reader(Cursor::new(text.as_bytes()));
+ for quad in parser {
+ store.insert(&quad?)?;
+ }
+ Ok(store)
+}
+
+/// Walk `mf:include` from the root manifest and collect every `sht:Validate`
+/// entry. Entries before includes, includes in sorted order, so the run order
+/// is fixed on every machine.
+fn collect_tests() -> anyhow::Result<(Vec<TestCase>, BTreeSet<PathBuf>)> {
+ let mut seen: BTreeSet<PathBuf> = BTreeSet::new();
+ let mut out: Vec<TestCase> = Vec::new();
+ walk(&suite_root().join("manifest.ttl"), &mut seen, &mut out)?;
+ out.sort_by(|a, b| a.name.cmp(&b.name));
+ Ok((out, seen))
+}
+
+/// Files under `tests/w3c-shacl/` that declare an `sht:Validate` entry and that
+/// the include walk never reached, so nothing runs them. Returned rather than
+/// asserted on, so `the_vendored_suite_is_whole` can name each one.
+fn unreachable_tests(reached: &BTreeSet<PathBuf>) -> Vec<String> {
+ fn visit(dir: &Path, reached: &BTreeSet<PathBuf>, out: &mut Vec<String>) {
+ let Ok(entries) = std::fs::read_dir(dir) else { return };
+ let mut paths: Vec<PathBuf> = entries.filter_map(|e| e.ok().map(|e| e.path())).collect();
+ paths.sort();
+ for p in paths {
+ if p.is_dir() {
+ visit(&p, reached, out);
+ } else if p.extension().is_some_and(|e| e == "ttl") {
+ let canonical = std::fs::canonicalize(&p).unwrap_or_else(|_| p.clone());
+ if reached.contains(&canonical) {
+ continue;
+ }
+ if std::fs::read_to_string(&p).is_ok_and(|t| t.contains("sht:Validate")) {
+ out.push(rel(&p));
+ }
+ }
+ }
+ }
+ let mut out = Vec::new();
+ visit(&suite_root(), reached, &mut out);
+ out.sort();
+ out
+}
+
+fn walk(manifest: &Path, seen: &mut BTreeSet<PathBuf>, out: &mut Vec<TestCase>) -> anyhow::Result<()> {
+ let canonical = std::fs::canonicalize(manifest).unwrap_or_else(|_| manifest.to_path_buf());
+ if !seen.insert(canonical) {
+ return Ok(());
+ }
+ let store = load_graph(manifest)?;
+
+ for entry in entries(&store)? {
+ out.push(read_entry(&store, manifest, &entry)?);
+ }
+
+ let mut includes: Vec<String> =
+ rows(&store, &format!("{PREFIXES} SELECT ?i WHERE {{ ?m mf:include ?i }}"))?
+ .into_iter()
+ .filter_map(|r| r.get("i").map(|s| canon(s)))
+ .collect();
+ includes.sort();
+ includes.dedup();
+ for inc in includes {
+ match path_of(&inc) {
+ Some(p) if p.is_file() => walk(&p, seen, out)?,
+ // A network fetch here would defeat the point of vendoring, so an
+ // include that escapes the tree is an error rather than a skip.
+ _ => anyhow::bail!("{}: mf:include leaves the vendored suite: {inc}", rel(manifest)),
+ }
+ }
+ Ok(())
+}
+
+fn entries(store: &Store) -> anyhow::Result<Vec<String>> {
+ Ok(rows(
+ store,
+ &format!(
+ "{PREFIXES}
+ SELECT ?e WHERE {{ ?m mf:entries/rdf:rest*/rdf:first ?e . ?e a sht:Validate . }}"
+ ),
+ )?
+ .into_iter()
+ .filter_map(|r| r.get("e").cloned())
+ .collect())
+}
+
+fn read_entry(store: &Store, manifest: &Path, entry: &str) -> anyhow::Result<TestCase> {
+ let action = rows(
+ store,
+ &format!(
+ "{PREFIXES}
+ SELECT ?d ?s WHERE {{ {entry} mf:action ?a . ?a sht:dataGraph ?d ; sht:shapesGraph ?s . }}"
+ ),
+ )?;
+ let Some(a) = action.first() else {
+ anyhow::bail!("{}: entry {entry} has no mf:action naming both graphs", rel(manifest));
+ };
+ let data = path_of(&canon(&cell(a, "d")))
+ .ok_or_else(|| anyhow::anyhow!("{}: sht:dataGraph outside the suite", rel(manifest)))?;
+ let shapes = path_of(&canon(&cell(a, "s")))
+ .ok_or_else(|| anyhow::anyhow!("{}: sht:shapesGraph outside the suite", rel(manifest)))?;
+
+ let label = rows(store, &format!("{PREFIXES} SELECT ?l WHERE {{ {entry} rdfs:label ?l }}"))?
+ .first()
+ .map(|r| cell(r, "l").trim_matches('"').to_string())
+ .unwrap_or_default();
+ let status = rows(store, &format!("{PREFIXES} SELECT ?s WHERE {{ {entry} mf:status ?s }}"))?
+ .first()
+ .map(|r| short(&canon(&cell(r, "s"))))
+ .unwrap_or_else(|| "unstated".to_string());
+
+ // `sht:Failure` sits in object position as an IRI; an expected report is a
+ // blank node carrying sh:conforms.
+ let result_term = rows(store, &format!("{PREFIXES} SELECT ?r WHERE {{ {entry} mf:result ?r }}"))?
+ .first()
+ .map(|r| cell(r, "r"))
+ .unwrap_or_else(|| "(none)".to_string());
+
+ let expected = if canon(&result_term) == "http://www.w3.org/ns/shacl-test#Failure" {
+ Expectation::Failure
+ } else {
+ let conforms = rows(
+ store,
+ &format!("{PREFIXES} SELECT ?c WHERE {{ {entry} mf:result ?r . ?r sh:conforms ?c }}"),
+ )?
+ .first()
+ .map(|r| {
+ let c = cell(r, "c");
+ c.starts_with("\"true\"") || c == "true"
+ })
+ .ok_or_else(|| {
+ anyhow::anyhow!("{}: entry {entry} has neither sh:conforms nor sht:Failure", rel(manifest))
+ })?;
+
+ let mut results = BTreeSet::new();
+ for row in rows(
+ store,
+ &format!(
+ "{PREFIXES}
+ SELECT ?f ?sh ?c WHERE {{
+ {entry} mf:result ?r . ?r sh:result ?res .
+ OPTIONAL {{ ?res sh:focusNode ?f }}
+ OPTIONAL {{ ?res sh:sourceShape ?sh }}
+ OPTIONAL {{ ?res sh:sourceConstraintComponent ?c }}
+ }}"
+ ),
+ )? {
+ results.insert(ResultKey {
+ focus: canon(&cell(&row, "f")),
+ shape: canon(&cell(&row, "sh")),
+ component: canon(&cell(&row, "c")),
+ });
+ }
+ Expectation::Report { conforms, results }
+ };
+
+ let mut name = rel(manifest);
+ name.truncate(name.len().saturating_sub(".ttl".len()));
+ let local = short(&canon(entry));
+ if !name.ends_with(&local) {
+ name = format!("{name}::{local}");
+ }
+
+ Ok(TestCase { name, label, status, data, shapes, expected })
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// Running one test
+// ─────────────────────────────────────────────────────────────────────────────
+
+fn run_case(tc: &TestCase) -> Outcome {
+ // Data graph: loaded with its own IRI as base, so `<>` and friends resolve
+ // to the same terms the expected report names.
+ let data = Arc::new(GraphStore::new());
+ let data_text = match std::fs::read_to_string(&tc.data) {
+ Ok(t) => t,
+ Err(e) => return Outcome::Error(format!("data graph unreadable: {e}")),
+ };
+ if let Err(e) = data.load_turtle(&data_text, Some(&base_of(&tc.data))) {
+ return Outcome::Error(format!("data graph does not parse: {}", first_line(&e.to_string())));
+ }
+
+ // Shapes graph: through a store and back out as N-Triples. See the module
+ // docs; `validate` cannot be given a base IRI, and every file here uses
+ // relative IRIs.
+ let shapes_store = GraphStore::new();
+ let shapes_text = match std::fs::read_to_string(&tc.shapes) {
+ Ok(t) => t,
+ Err(e) => return Outcome::Error(format!("shapes graph unreadable: {e}")),
+ };
+ if let Err(e) = shapes_store.load_turtle(&shapes_text, Some(&base_of(&tc.shapes))) {
+ return Outcome::Error(format!("shapes graph does not parse: {}", first_line(&e.to_string())));
+ }
+ let shapes_nt = match shapes_store.serialize("ntriples") {
+ Ok(s) => s,
+ Err(e) => return Outcome::Error(format!("shapes graph will not re-serialise: {e}")),
+ };
+
+ let raw = match ShaclValidator::validate(&data, &shapes_nt) {
+ Ok(r) => r,
+ Err(e) => {
+ // The suite's rule: a test whose mf:result is sht:Failure passes if
+ // the validation reported a failure. An error IS that report.
+ return match tc.expected {
+ Expectation::Failure => Outcome::Pass,
+ _ => Outcome::Error(format!("validate returned Err: {}", first_line(&e.to_string()))),
+ };
+ }
+ };
+ let report: serde_json::Value = match serde_json::from_str(&raw) {
+ Ok(v) => v,
+ Err(e) => return Outcome::Error(format!("report is not JSON: {e}")),
+ };
+
+ // The third answer, before any comparison. An engine that declined to
+ // answer has not passed and has not failed, whatever the expectation was.
+ if report["conforms"].is_null() {
+ return Outcome::Undetermined(why_undetermined(&report));
+ }
+
+ let Some(actual_conforms) = report["conforms"].as_bool() else {
+ return Outcome::Error(format!("conforms is neither bool nor null: {}", report["conforms"]));
+ };
+
+ let actual: BTreeSet<ResultKey> = report["violations"]
+ .as_array()
+ .map(|vs| {
+ vs.iter()
+ .map(|v| ResultKey {
+ focus: canon(v["focus_node"].as_str().unwrap_or("(none)")),
+ shape: canon(v["source_shape"].as_str().unwrap_or("(none)")),
+ component: canon(v["source_constraint_component"].as_str().unwrap_or("(none)")),
+ })
+ .collect()
+ })
+ .unwrap_or_default();
+
+ match &tc.expected {
+ Expectation::Failure => Outcome::Fail(format!(
+ "verdict: the suite requires a reported failure for this shapes graph; \
+ the engine returned conforms={actual_conforms}"
+ )),
+ Expectation::Report { conforms, results } => {
+ if actual_conforms != *conforms {
+ return Outcome::Fail(format!(
+ "verdict: expected conforms={conforms}, got {actual_conforms} \
+ ({} expected result(s), {} produced)",
+ results.len(),
+ actual.len()
+ ));
+ }
+ if actual == *results {
+ return Outcome::Pass;
+ }
+ let missing: Vec<String> = results.difference(&actual).map(|k| k.to_string()).collect();
+ let extra: Vec<String> = actual.difference(results).map(|k| k.to_string()).collect();
+ Outcome::Fail(format!(
+ "results: verdict agrees (conforms={conforms}) but the result set differs; \
+ {} missing {}, {} unexpected {}",
+ missing.len(),
+ preview(&missing),
+ extra.len(),
+ preview(&extra)
+ ))
+ }
+ }
+}
+
+/// Which of the two routes to `conforms: null` this report took, and what it
+/// names. Reported rather than collapsed, because "a constraint was not
+/// implemented" and "no focus node matched" are different pieces of work.
+fn why_undetermined(report: &serde_json::Value) -> String {
+ if let Some(skipped) = report["skipped_constraints"].as_array() {
+ let kinds: BTreeSet<String> = skipped
+ .iter()
+ .map(|s| {
+ s["constraint"]
+ .as_str()
+ .or_else(|| s["reason"].as_str())
+ .or_else(|| s.as_str())
+ .unwrap_or("unnamed")
+ .to_string()
+ })
+ .collect();
+ let named = if kinds.is_empty() {
+ "unnamed".to_string()
+ } else {
+ kinds.into_iter().collect::<Vec<_>>().join(", ")
+ };
+ format!("skipped {} constraint(s): {named}", skipped.len())
+ } else {
+ let n = report["unmatched_shapes"].as_array().map(|a| a.len()).unwrap_or(0);
+ format!("no focus node matched ({n} unmatched shape(s))")
+ }
+}
+
+fn first_line(s: &str) -> String {
+ s.lines().next().unwrap_or(s).to_string()
+}
+
+fn preview(items: &[String]) -> String {
+ if items.is_empty() {
+ return "[]".to_string();
+ }
+ let shown: Vec<&str> = items.iter().take(2).map(String::as_str).collect();
+ if items.len() > 2 {
+ format!("[{}, ...]", shown.join("; "))
+ } else {
+ format!("[{}]", shown.join("; "))
+ }
+}
+
+/// Constraint components a test turns on, taken from the expected report. Used
+/// to cluster failures so the next piece of work is chosen by evidence and not
+/// by whichever bug someone tripped over last.
+fn components_of(tc: &TestCase) -> BTreeSet<String> {
+ match &tc.expected {
+ Expectation::Failure => {
+ BTreeSet::from(["(sht:Failure, SPARQL pre-binding)".to_string()])
+ }
+ Expectation::Report { results, .. } => {
+ let s: BTreeSet<String> = results.iter().map(|r| short(&r.component)).collect();
+ if s.is_empty() {
+ // A conforming test names no component, so the feature under
+ // test is the directory it lives in.
+ BTreeSet::from([format!("(conforming test in {})", area(tc))])
+ } else {
+ s
+ }
+ }
+ }
+}
+
+fn area(tc: &TestCase) -> String {
+ tc.name.rsplit_once('/').map(|(d, _)| d.to_string()).unwrap_or_else(|| tc.name.clone())
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// The run, memoised so the tests below share one pass over the suite
+// ─────────────────────────────────────────────────────────────────────────────
+
+struct Run {
+ cases: Vec<TestCase>,
+ outcomes: Vec<Outcome>,
+ /// Test files carrying an entry that no manifest includes.
+ orphans: Vec<String>,
+ counts: Counts,
+ /// Tests that agreed on `sh:conforms` whatever the result set did. The
+ /// suite calls this partial compliance; it is the number this engine could
+ /// report to the Working Group today, and it is not the gated number.
+ partial: usize,
+ /// Tests expecting `sht:Failure` that landed in UNDETERMINED. Under a
+ /// lenient reading of "the validation reported a failure" these would be
+ /// passes. Counted, never credited.
+ failure_via_undetermined: usize,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
+struct Counts {
+ total: usize,
+ pass: usize,
+ fail: usize,
+ undetermined: usize,
+ error: usize,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+struct Baseline {
+ /// For the reader of the file, ignored by the gate.
+ note: String,
+ suite_commit: String,
+ counts: Counts,
+ partial_compliance: usize,
+ /// Per test, so a swap that leaves the counts flat is still a diff.
+ outcomes: BTreeMap<String, String>,
+}
+
+fn run() -> &'static Run {
+ static RUN: OnceLock<Run> = OnceLock::new();
+ RUN.get_or_init(|| {
+ let (cases, reached) = collect_tests().expect("walk the vendored W3C SHACL manifests");
+ let orphans = unreachable_tests(&reached);
+ let mut outcomes = Vec::with_capacity(cases.len());
+ let mut counts = Counts { total: cases.len(), ..Default::default() };
+ let mut partial = 0usize;
+ let mut failure_via_undetermined = 0usize;
+ for tc in &cases {
+ let o = run_case(tc);
+ match &o {
+ Outcome::Pass => {
+ counts.pass += 1;
+ partial += 1;
+ }
+ Outcome::Fail(d) => {
+ counts.fail += 1;
+ // "results:" means the verdict was right and only the
+ // result set was wrong, which is partial compliance.
+ if d.starts_with("results:") {
+ partial += 1;
+ }
+ }
+ Outcome::Undetermined(_) => {
+ counts.undetermined += 1;
+ if matches!(tc.expected, Expectation::Failure) {
+ failure_via_undetermined += 1;
+ }
+ }
+ Outcome::Error(_) => counts.error += 1,
+ }
+ outcomes.push(o);
+ }
+ Run { cases, outcomes, orphans, counts, partial, failure_via_undetermined }
+ })
+}
+
+fn outcome_map(r: &Run) -> BTreeMap<String, String> {
+ r.cases
+ .iter()
+ .zip(r.outcomes.iter())
+ .map(|(c, o)| (c.name.clone(), o.bucket().to_string()))
+ .collect()
+}
+
+/// The three ratchet rules, in one place so the gate and the test that proves
+/// the gate bites cannot drift apart.
+fn ratchet_verdict(
+ base: &Counts,
+ base_outcomes: &BTreeMap<String, String>,
+ now: &Counts,
+ now_outcomes: &BTreeMap<String, String>,
+) -> Vec<String> {
+ let mut broken = Vec::new();
+ if now.pass < base.pass {
+ broken.push(format!("PASS dropped from {} to {}", base.pass, now.pass));
+ }
+ if now.fail > base.fail {
+ broken.push(format!("FAIL rose from {} to {}", base.fail, now.fail));
+ }
+ let regressed: Vec<&str> = base_outcomes
+ .iter()
+ .filter(|(n, b)| {
+ b.as_str() == "PASS" && now_outcomes.get(*n).map(String::as_str) != Some("PASS")
+ })
+ .map(|(n, _)| n.as_str())
+ .collect();
+ if !regressed.is_empty() {
+ broken.push(format!(
+ "{} test(s) that passed in the baseline no longer pass: {}",
+ regressed.len(),
+ regressed.join(", ")
+ ));
+ }
+ broken
+}
+
+fn pct(n: usize, d: usize) -> f64 {
+ if d == 0 { 0.0 } else { 100.0 * n as f64 / d as f64 }
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// Tests
+// ─────────────────────────────────────────────────────────────────────────────
+
+/// The suite is present, complete and reachable from the root manifest.
+///
+/// Without this, a botched vendoring that dropped half the tree would show up
+/// as an improvement: fewer tests, fewer failures, and the FAIL ratchet
+/// satisfied by deletion.
+#[test]
+fn the_vendored_suite_is_whole() {
+ if skip() {
+ return;
+ }
+ let r = run();
+ assert!(
+ r.cases.len() >= EXPECTED_ENTRIES,
+ "the manifest walk found only {} sht:Validate entries; upstream {SUITE_COMMIT} carries \
+ {EXPECTED_ENTRIES}. A shrunken suite makes the ratchet meaningless.",
+ r.cases.len()
+ );
+ let approved = r.cases.iter().filter(|c| c.status == "approved").count();
+ let proposed = r.cases.iter().filter(|c| c.status == "proposed").count();
+ eprintln!("suite: {} entries, {approved} approved, {proposed} proposed", r.cases.len());
+ assert_eq!(
+ approved + proposed,
+ r.cases.len(),
+ "every entry must carry mf:status sht:approved or sht:proposed; another status means a \
+ test the Working Group rejected, and it must not be scored"
+ );
+ // Every referenced graph is in the tree, not on the network.
+ for c in &r.cases {
+ assert!(c.data.is_file(), "{}: data graph missing at {}", c.name, c.data.display());
+ assert!(c.shapes.is_file(), "{}: shapes graph missing at {}", c.name, c.shapes.display());
+ }
+ let names: BTreeSet<&str> = r.cases.iter().map(|c| c.name.as_str()).collect();
+ assert_eq!(
+ names.len(),
+ r.cases.len(),
+ "two entries share a baseline key, so one would shadow the other in the ratchet"
+ );
+
+ // Every test file the walk did not reach, named. The suite's own rule is
+ // that all approved tests are reachable from the root manifest; where that
+ // is false upstream, saying so here is the difference between an excluded
+ // test and a lost one.
+ for orphan in &r.orphans {
+ eprintln!("UNREACHABLE_TEST: {orphan} declares an sht:Validate entry that no manifest includes");
+ }
+ assert_eq!(
+ r.orphans,
+ KNOWN_ORPHANS.map(str::to_string).to_vec(),
+ "the set of unreachable test files changed. If upstream fixed the include, drop it from \
+ KNOWN_ORPHANS and raise EXPECTED_ENTRIES; if a new one appeared, a test just went dark."
+ );
+}
+
+/// The whole report: buckets, clusters, and the ten worst tests.
+///
+/// Printing is the point, so run it with `-- --nocapture`.
+#[test]
+fn the_conformance_report() {
+ if skip() {
+ return;
+ }
+ let r = run();
+ let c = r.counts;
+
+ eprintln!("\n====== W3C SHACL conformance, open-ontologies ======");
+ eprintln!("suite commit {SUITE_COMMIT} (2026-09-12)\n");
+ eprintln!(" total {:>4}", c.total);
+ eprintln!(" PASS {:>4} ({:.1}%)", c.pass, pct(c.pass, c.total));
+ eprintln!(
+ " FAIL {:>4} ({:.1}%) <- wrong answer, the serious bucket",
+ c.fail,
+ pct(c.fail, c.total)
+ );
+ eprintln!(
+ " UNDETERMINED {:>4} ({:.1}%) <- conforms:null, the engine declined to answer",
+ c.undetermined,
+ pct(c.undetermined, c.total)
+ );
+ eprintln!(
+ " ERROR {:>4} ({:.1}%) <- crash or parse failure",
+ c.error,
+ pct(c.error, c.total)
+ );
+ eprintln!(
+ "\n partial compliance (sh:conforms agrees, result set ignored): {} of {} ({:.1}%)",
+ r.partial,
+ c.total,
+ pct(r.partial, c.total)
+ );
+ eprintln!(
+ " sht:Failure tests answered with conforms:null rather than an error: {}",
+ r.failure_via_undetermined
+ );
+
+ // Where the non-passes cluster, by SHACL constraint component and by area.
+ let mut by_component: BTreeMap<String, [usize; 3]> = BTreeMap::new(); // fail, undet, error
+ let mut by_area: BTreeMap<String, [usize; 4]> = BTreeMap::new(); // pass, fail, undet, error
+ for (tc, o) in r.cases.iter().zip(r.outcomes.iter()) {
+ let a = by_area.entry(area(tc)).or_insert([0; 4]);
+ let slot = match o {
+ Outcome::Pass => 0,
+ Outcome::Fail(_) => 1,
+ Outcome::Undetermined(_) => 2,
+ Outcome::Error(_) => 3,
+ };
+ a[slot] += 1;
+ if slot == 0 {
+ continue;
+ }
+ for comp in components_of(tc) {
+ by_component.entry(comp).or_insert([0; 3])[slot - 1] += 1;
+ }
+ }
+
+ eprintln!("\n-- where the non-passes cluster, by constraint component --");
+ eprintln!(" {:<46} {:>5} {:>6} {:>6}", "component", "FAIL", "UNDET", "ERROR");
+ let mut ranked: Vec<(&String, &[usize; 3])> = by_component.iter().collect();
+ ranked.sort_by(|x, y| {
+ (y.1[0] + y.1[2], y.1[1], x.0).cmp(&(x.1[0] + x.1[2], x.1[1], y.0))
+ });
+ for (comp, n) in &ranked {
+ eprintln!(" {:<46} {:>5} {:>6} {:>6}", comp, n[0], n[1], n[2]);
+ }
+
+ eprintln!("\n-- by suite area --");
+ eprintln!(" {:<32} {:>5} {:>5} {:>6} {:>6}", "area", "PASS", "FAIL", "UNDET", "ERROR");
+ for (a, n) in &by_area {
+ eprintln!(" {:<32} {:>5} {:>5} {:>6} {:>6}", a, n[0], n[1], n[2], n[3]);
+ }
+
+ eprintln!("\n-- the ten worst individual failures (FAIL first, then ERROR) --");
+ let mut worst: Vec<(&TestCase, &Outcome)> = r
+ .cases
+ .iter()
+ .zip(r.outcomes.iter())
+ .filter(|(_, o)| matches!(o, Outcome::Fail(_) | Outcome::Error(_)))
+ .collect();
+ worst.sort_by(|x, y| {
+ (matches!(x.1, Outcome::Error(_)), &x.0.name).cmp(&(matches!(y.1, Outcome::Error(_)), &y.0.name))
+ });
+ for (tc, o) in worst.iter().take(10) {
+ eprintln!(" {:<42} {}: {}", tc.name, o.bucket(), o.detail());
+ }
+
+ eprintln!("\n-- every test --");
+ for (tc, o) in r.cases.iter().zip(r.outcomes.iter()) {
+ eprintln!(" {:<12} {:<42} {} {}", o.bucket(), tc.name, tc.label, o.detail());
+ }
+ eprintln!("===================================================\n");
+
+ assert_eq!(
+ c.pass + c.fail + c.undetermined + c.error,
+ c.total,
+ "every test must land in exactly one bucket"
+ );
+}
+
+/// The ratchet. See the module docs for why it is monotone rather than pass-all.
+#[test]
+fn the_conformance_ratchet_holds() {
+ if skip() {
+ return;
+ }
+ let r = run();
+ let now = outcome_map(r);
+
+ if std::env::var("OO_W3C_SHACL_UPDATE_BASELINE").as_deref() == Ok("1") {
+ let b = Baseline {
+ note: "W3C SHACL test suite conformance, ratcheted. PASS may not drop, FAIL may not \
+ rise, and no named PASS may regress. Regenerate with \
+ OO_W3C_SHACL_UPDATE_BASELINE=1 cargo test --test w3c_shacl_conformance_test. \
+ Lowering any number here is a deliberate act and should say why."
+ .to_string(),
+ suite_commit: SUITE_COMMIT.to_string(),
+ counts: r.counts,
+ partial_compliance: r.partial,
+ outcomes: now,
+ };
+ std::fs::write(baseline_path(), format!("{}\n", serde_json::to_string_pretty(&b).unwrap()))
+ .expect("write the baseline");
+ eprintln!("baseline rewritten at {}", baseline_path().display());
+ return;
+ }
+
+ let text = std::fs::read_to_string(baseline_path()).unwrap_or_else(|e| {
+ panic!(
+ "no baseline at {}: {e}. Cut one with \
+ OO_W3C_SHACL_UPDATE_BASELINE=1 cargo test --test w3c_shacl_conformance_test",
+ baseline_path().display()
+ )
+ });
+ let base: Baseline = serde_json::from_str(&text).expect("parse the baseline");
+
+ if base.suite_commit != SUITE_COMMIT || base.counts.total != r.counts.total {
+ // Not a failure on its own: upstream adds tests, and a refresh is a
+ // deliberate act. Loud, because comparing an engine number against a
+ // baseline cut on a different suite is comparing two things.
+ eprintln!(
+ "NOTE: baseline was cut on suite {} with {} tests; this run is suite {SUITE_COMMIT} \
+ with {} tests. Re-cut the baseline.",
+ base.suite_commit, base.counts.total, r.counts.total
+ );
+ }
+
+ let broken = ratchet_verdict(&base.counts, &base.outcomes, &r.counts, &now);
+ if !broken.is_empty() {
+ // Name what each regressed test now does, so the failure is a diagnosis
+ // and not a number.
+ let detail: Vec<String> = r
+ .cases
+ .iter()
+ .zip(r.outcomes.iter())
+ .filter(|(c, o)| {
+ base.outcomes.get(&c.name).map(String::as_str) == Some("PASS")
+ && !matches!(o, Outcome::Pass)
+ })
+ .map(|(c, o)| format!(" {} -> {} ({})", c.name, o.bucket(), o.detail()))
+ .collect();
+ panic!(
+ "W3C SHACL conformance regressed:\n {}\n{}\nbaseline {:?}\nnow {:?}\n\n\
+ If this is a deliberate, justified move, re-cut the baseline with \
+ OO_W3C_SHACL_UPDATE_BASELINE=1 and say why in the commit message.",
+ broken.join("\n "),
+ detail.join("\n"),
+ base.counts,
+ r.counts
+ );
+ }
+
+ let gained = r.counts.pass as i64 - base.counts.pass as i64;
+ eprintln!(
+ "ratchet ok: PASS {} (baseline {}, {gained:+}), FAIL {} (baseline {}), \
+ UNDETERMINED {}, ERROR {}, partial compliance {} (baseline {})",
+ r.counts.pass,
+ base.counts.pass,
+ r.counts.fail,
+ base.counts.fail,
+ r.counts.undetermined,
+ r.counts.error,
+ r.partial,
+ base.partial_compliance
+ );
+ if gained > 0 {
+ eprintln!(
+ "NOTE: {gained} more test(s) pass than the baseline records. Re-cut it so the gate \
+ holds the new floor, or the gain can be lost again silently."
+ );
+ }
+}
+
+/// A gate that cannot fail is not a gate.
+///
+/// `ratchet_verdict` is the function the real gate calls, and it is driven here
+/// against synthetic counts so all three rules are known to bite rather than
+/// assumed to. Without this, a comparison inverted by a typo is a permanently
+/// green job.
+#[test]
+fn the_ratchet_can_say_no() {
+ let base = Counts { total: 121, pass: 40, fail: 50, undetermined: 25, error: 6 };
+ let outcomes = |v: [(&str, &str); 3]| -> BTreeMap<String, String> {
+ v.into_iter().map(|(k, s)| (k.to_string(), s.to_string())).collect()
+ };
+ let base_outcomes = outcomes([("a", "PASS"), ("b", "PASS"), ("c", "FAIL")]);
+
+ // Holding steady passes.
+ assert!(ratchet_verdict(&base, &base_outcomes, &base, &base_outcomes).is_empty());
+
+ // Improving passes: one FAIL becomes a PASS.
+ let better = Counts { pass: 41, fail: 49, ..base };
+ let better_outcomes = outcomes([("a", "PASS"), ("b", "PASS"), ("c", "PASS")]);
+ assert!(ratchet_verdict(&base, &base_outcomes, &better, &better_outcomes).is_empty());
+
+ // Rule 1: fewer passes.
+ let fewer = Counts { pass: 39, undetermined: 26, ..base };
+ assert!(
+ ratchet_verdict(&base, &base_outcomes, &fewer, &base_outcomes)
+ .iter()
+ .any(|m| m.contains("PASS dropped")),
+ "a drop in PASS must be caught"
+ );
+
+ // Rule 2: more failures.
+ let worse = Counts { fail: 51, undetermined: 24, ..base };
+ assert!(
+ ratchet_verdict(&base, &base_outcomes, &worse, &base_outcomes)
+ .iter()
+ .any(|m| m.contains("FAIL rose")),
+ "a rise in FAIL must be caught"
+ );
+
+ // Rule 3: a swap that leaves both counts flat.
+ let swapped = outcomes([("a", "PASS"), ("b", "FAIL"), ("c", "PASS")]);
+ let msgs = ratchet_verdict(&base, &base_outcomes, &base, &swapped);
+ assert!(
+ msgs.iter().any(|m| m.contains("no longer pass") && m.contains('b')),
+ "a test swapped out of PASS with both counts unchanged must be caught, got {msgs:?}"
+ );
+}
diff --git a/tools/w3c_shacl_pyshacl_oracle.py b/tools/w3c_shacl_pyshacl_oracle.py
new file mode 100644
index 00000000..fc1f03e6
--- /dev/null
+++ b/tools/w3c_shacl_pyshacl_oracle.py
@@ -0,0 +1,168 @@
+#!/usr/bin/env python3
+"""Calibration for tests/w3c_shacl_conformance_test.rs: run the same suite, the
+same walk and the same comparison, with pyshacl as the engine.
+
+A conformance score is only a measurement if the yardstick is known to be
+fair. `tests/w3c_shacl_conformance_test.rs` compares the `sh:conforms` verdict
+plus the SET of (focus node, sh:sourceShape, sh:sourceConstraintComponent)
+triples, with blank nodes canonicalised. That is stricter than the W3C's
+"partial compliance" and looser than its "full compliance", so neither
+published number tells you whether a low score means a weak engine or a harsh
+harness.
+
+This script answers that. It walks `mf:include` from tests/w3c-shacl/manifest.ttl
+exactly as the Rust harness does, applies exactly the same comparison, and
+drives pyshacl instead of open-ontologies. A mature engine scoring near the top
+under this lens means the lens is sound.
+
+Measured 2026-09-13, pyshacl 0.40.1 / rdflib 7.6.0, suite commit 94d8bc2:
+
+ total 120 PASS 111 FAIL 8 ERROR 1
+
+against open-ontologies' PASS 32 / FAIL 26 / UNDETERMINED 62 / ERROR 0 on the
+same run. The gap is the engine, not the harness.
+
+Deliberately NOT wired into CI. The `w3c-shacl` job has to stay offline, cheap
+and deterministic, and adding a Python dependency to it would buy a number that
+changes when pyshacl changes rather than when this engine does. Run it by hand
+when the harness itself is edited.
+
+Usage:
+ pip install pyshacl
+ python3 tools/w3c_shacl_pyshacl_oracle.py [--suite tests/w3c-shacl]
+"""
+import argparse
+import os
+import pathlib
+import sys
+
+try:
+ import pyshacl
+ from rdflib import BNode, Graph, Namespace, RDF, URIRef
+except ImportError: # pragma: no cover - the message is the whole handler
+ sys.exit("this script needs pyshacl and rdflib: pip install pyshacl")
+
+BASE = "https://w3c.github.io/data-shapes/data-shapes-test-suite/tests/"
+MF = Namespace("http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#")
+SHT = Namespace("http://www.w3.org/ns/shacl-test#")
+SH = Namespace("http://www.w3.org/ns/shacl#")
+NONE = URIRef("urn:open-ontologies:absent")
+
+
+def canon(term):
+ """The Rust harness's `canon`: blank nodes are opaque, IRIs are bare, and
+ literals keep their N-Triples form."""
+ if isinstance(term, BNode):
+ return "_:"
+ if isinstance(term, URIRef):
+ return str(term)
+ return term.n3()
+
+
+def result_keys(graph, report_node, predicate):
+ keys = set()
+ for r in graph.objects(report_node, predicate):
+ keys.add((
+ canon(graph.value(r, SH.focusNode) or NONE),
+ canon(graph.value(r, SH.sourceShape) or NONE),
+ canon(graph.value(r, SH.sourceConstraintComponent) or NONE),
+ ))
+ return keys
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ default_suite = pathlib.Path(__file__).resolve().parent.parent / "tests" / "w3c-shacl"
+ ap.add_argument("--suite", default=str(default_suite))
+ args = ap.parse_args()
+ root = os.path.realpath(args.suite)
+
+ def base_of(p):
+ return BASE + os.path.relpath(p, root)
+
+ def path_of(iri):
+ if not str(iri).startswith(BASE):
+ sys.exit(f"include leaves the vendored suite: {iri}")
+ return os.path.join(root, str(iri)[len(BASE):])
+
+ def load(p):
+ g = Graph()
+ g.parse(p, format="turtle", publicID=base_of(p))
+ return g
+
+ cases, seen = [], set()
+
+ def walk(path):
+ path = os.path.realpath(path)
+ if path in seen:
+ return
+ seen.add(path)
+ g = load(path)
+ for manifest in g.subjects(RDF.type, MF.Manifest):
+ for entries in g.objects(manifest, MF.entries):
+ for entry in g.items(entries):
+ if (entry, RDF.type, SHT.Validate) not in g:
+ continue
+ action = g.value(entry, MF.action)
+ name = os.path.relpath(path, root)[: -len(".ttl")]
+ cases.append((
+ name,
+ path_of(g.value(action, SHT.dataGraph)),
+ path_of(g.value(action, SHT.shapesGraph)),
+ g.value(entry, MF.result),
+ g,
+ ))
+ for inc in g.objects(None, MF.include):
+ walk(path_of(inc))
+
+ walk(os.path.join(root, "manifest.ttl"))
+ cases.sort(key=lambda c: c[0])
+
+ passed = failed = errored = 0
+ notes = []
+ for name, data_path, shapes_path, result, manifest_graph in cases:
+ expect_failure = result == SHT.Failure
+ try:
+ ok, report, _ = pyshacl.validate(
+ load(data_path), shacl_graph=load(shapes_path), advanced=True, inplace=False
+ )
+ except Exception as exc: # noqa: BLE001 - an engine crash is a bucket, not a bug here
+ if expect_failure:
+ passed += 1
+ else:
+ errored += 1
+ notes.append((name, "ERROR", str(exc).splitlines()[0][:100]))
+ continue
+
+ if expect_failure:
+ failed += 1
+ notes.append((name, "FAIL", "the suite requires a reported failure; pyshacl gave a verdict"))
+ continue
+
+ expected_conforms = bool(manifest_graph.value(result, SH.conforms))
+ expected = result_keys(manifest_graph, result, SH.result)
+ actual = result_keys(report, next(report.subjects(RDF.type, SH.ValidationReport)), SH.result)
+ if ok != expected_conforms:
+ failed += 1
+ notes.append((name, "FAIL", f"verdict: expected conforms={expected_conforms}, got {ok}"))
+ elif actual != expected:
+ failed += 1
+ notes.append((
+ name,
+ "FAIL",
+ f"results: {len(expected - actual)} missing, {len(actual - expected)} unexpected",
+ ))
+ else:
+ passed += 1
+
+ print(
+ f"pyshacl under the open-ontologies comparison: "
+ f"total {len(cases)} PASS {passed} FAIL {failed} ERROR {errored}"
+ )
+ for name, bucket, why in notes:
+ print(f" {name:<44} {bucket}: {why}")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())