This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jena.git
The following commit(s) were added to refs/heads/master by this push:
new b645c6c JENA-1797: Test for instance of subclass of implicit target
new 4b8b890 Merge pull request #653 from afs/shacl-target-test
b645c6c is described below
commit b645c6ccb1af4d72a89ae952452628a840b2d32a
Author: Andy Seaborne <[email protected]>
AuthorDate: Sat Dec 14 17:52:48 2019 +0000
JENA-1797: Test for instance of subclass of implicit target
---
.../local/additional/target-class-subclass-1.ttl | 51 ++++++++++++++++++++++
jena-shacl/src/test/resources/local/manifest.ttl | 1 +
2 files changed, 52 insertions(+)
diff --git
a/jena-shacl/src/test/resources/local/additional/target-class-subclass-1.ttl
b/jena-shacl/src/test/resources/local/additional/target-class-subclass-1.ttl
new file mode 100644
index 0000000..f0c668e
--- /dev/null
+++ b/jena-shacl/src/test/resources/local/additional/target-class-subclass-1.ttl
@@ -0,0 +1,51 @@
+PREFIX ex: <http://example/>
+
+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 sht: <http://www.w3.org/ns/shacl-test#>
+PREFIX mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>
+
+ex:A rdf:type rdfs:Class .
+
+ex:B #rdf:type rdfs:Class ;
+ rdfs:subClassOf ex:A .
+
+ex:x rdf:type ex:B .
+
+ex:ShapeDef
+ rdf:type sh:NodeShape ;
+ sh:targetClass ex:A;
+ sh:property [
+ sh:path rdfs:label ;
+ sh:minCount 1 ;
+ ] .
+
+<>
+ rdf:type mf:Manifest ;
+ mf:entries ( <target-class-subclass-1> )
+ .
+
+<target-class-subclass-1>
+ rdf:type sht:Validate ;
+ rdfs:label "Instance of implicit class target and subclass test" ;
+ mf:action [
+ sht:dataGraph <> ;
+ sht:shapesGraph <> ;
+ ] ;
+ mf:result [
+ rdf:type sh:ValidationReport ;
+ sh:conforms false ;
+ sh:result [
+ rdf:type sh:ValidationResult ;
+ sh:focusNode ex:x ;
+ sh:resultMessage "minCount[1]: Invalid cardinality:
expected min 1: Got count = 0" ;
+ sh:resultPath rdfs:label ;
+ sh:resultSeverity sh:Violation ;
+ sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
+ sh:sourceShape []
+ ]
+ ] .
diff --git a/jena-shacl/src/test/resources/local/manifest.ttl
b/jena-shacl/src/test/resources/local/manifest.ttl
index bb465b6..45479b7 100644
--- a/jena-shacl/src/test/resources/local/manifest.ttl
+++ b/jena-shacl/src/test/resources/local/manifest.ttl
@@ -11,4 +11,5 @@ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
rdf:type mf:Manifest ;
mf:include <additional/lang-simple-1.ttl> ;
mf:include <additional/implicit-subclass-1.ttl> ;
+ mf:include <additional/target-class-subclass-1.ttl> ;
.