aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-10-14 22:18:17 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commit2901a3669de67025f4daa47e5c452a4ffbec1476 (patch)
tree826da112a6338ff6f53edc78fb9e978f662ce7ee /tests
parent9afb76e19e67951f6e6273acbbd35ceafb376e45 (diff)
downloadserd-2901a3669de67025f4daa47e5c452a4ffbec1476.tar.gz
serd-2901a3669de67025f4daa47e5c452a4ffbec1476.tar.bz2
serd-2901a3669de67025f4daa47e5c452a4ffbec1476.zip
Add validation to command line interface
Diffstat (limited to 'tests')
-rw-r--r--tests/validate/bad-all-values-from.ttl18
-rw-r--r--tests/validate/bad-cardinality-high.ttl18
-rw-r--r--tests/validate/bad-cardinality-low.ttl16
-rw-r--r--tests/validate/bad-cardinality.ttl18
-rw-r--r--tests/validate/bad-datatype-property.ttl18
-rw-r--r--tests/validate/bad-domain.ttl19
-rw-r--r--tests/validate/bad-functional-property.ttl13
-rw-r--r--tests/validate/bad-inverse-functional-property.ttl15
-rw-r--r--tests/validate/bad-literal-pattern.ttl7
-rw-r--r--tests/validate/bad-literal-value-high-exclusive.ttl18
-rw-r--r--tests/validate/bad-literal-value-high-inclusive.ttl18
-rw-r--r--tests/validate/bad-literal-value-low-exclusive.ttl18
-rw-r--r--tests/validate/bad-literal-value-low-inclusive.ttl19
-rw-r--r--tests/validate/bad-object-property.ttl12
-rw-r--r--tests/validate/bad-pattern.ttl21
-rw-r--r--tests/validate/bad-plain-literal.ttl12
-rw-r--r--tests/validate/bad-range-instance-not-literal.ttl18
-rw-r--r--tests/validate/bad-range-instance.ttl21
-rw-r--r--tests/validate/bad-range-literal-not-instance.ttl15
-rw-r--r--tests/validate/bad-range-literal.ttl25
-rw-r--r--tests/validate/bad-some-values-from.ttl18
-rw-r--r--tests/validate/bad-string-literal-value-high.ttl19
-rw-r--r--tests/validate/bad-string-literal-value-low.ttl19
-rw-r--r--tests/validate/bad-unknown-datatype.ttl6
-rw-r--r--tests/validate/bad-unknown-property.ttl6
-rw-r--r--tests/validate/good-cardinality.ttl17
-rw-r--r--tests/validate/good-literal-value-high-inclusive.ttl19
-rw-r--r--tests/validate/good-literal-value-low-inclusive.ttl19
-rw-r--r--tests/validate/good-pattern.ttl20
-rw-r--r--tests/validate/good-some-values-from.ttl17
-rw-r--r--tests/validate/good-string-literal-value-low.ttl19
-rw-r--r--tests/validate/manifest.ttl205
32 files changed, 723 insertions, 0 deletions
diff --git a/tests/validate/bad-all-values-from.ttl b/tests/validate/bad-all-values-from.ttl
new file mode 100644
index 00000000..e8243423
--- /dev/null
+++ b/tests/validate/bad-all-values-from.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:Thing
+ a rdfs:Class ;
+ rdfs:subClassOf [
+ a owl:Restriction ;
+ owl:onProperty rdfs:label ;
+ owl:allValuesFrom rdf:PlainLiteral
+ ] .
+
+eg:s
+ a eg:Thing ;
+ rdfs:label "plain" ,
+ "not plain"^^rdf:XMLLiteral .
+
diff --git a/tests/validate/bad-cardinality-high.ttl b/tests/validate/bad-cardinality-high.ttl
new file mode 100644
index 00000000..7e1605c3
--- /dev/null
+++ b/tests/validate/bad-cardinality-high.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:Thing
+ a rdfs:Class ;
+ rdfs:subClassOf [
+ a owl:Restriction ;
+ owl:onProperty rdf:value ;
+ owl:maxCardinality 1
+ ] .
+
+eg:s
+ a eg:Thing ;
+ rdf:value 1 ,
+ 2 .
+
diff --git a/tests/validate/bad-cardinality-low.ttl b/tests/validate/bad-cardinality-low.ttl
new file mode 100644
index 00000000..93dd0051
--- /dev/null
+++ b/tests/validate/bad-cardinality-low.ttl
@@ -0,0 +1,16 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:Thing
+ a rdfs:Class ;
+ rdfs:subClassOf [
+ a owl:Restriction ;
+ owl:onProperty rdf:value ;
+ owl:minCardinality 1
+ ] .
+
+eg:s
+ a eg:Thing .
+
diff --git a/tests/validate/bad-cardinality.ttl b/tests/validate/bad-cardinality.ttl
new file mode 100644
index 00000000..481fe456
--- /dev/null
+++ b/tests/validate/bad-cardinality.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:Thing
+ a rdfs:Class ;
+ rdfs:subClassOf [
+ a owl:Restriction ;
+ owl:onProperty rdf:value ;
+ owl:cardinality 3
+ ] .
+
+eg:s
+ a eg:Thing ;
+ rdf:value 1 ,
+ 2 .
+
diff --git a/tests/validate/bad-datatype-property.ttl b/tests/validate/bad-datatype-property.ttl
new file mode 100644
index 00000000..a3e993f3
--- /dev/null
+++ b/tests/validate/bad-datatype-property.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:value
+ rdfs:label "value" ;
+ a owl:DatatypeProperty .
+
+eg:Thing
+ a rdfs:Class .
+
+eg:s1
+ a eg:Thing .
+
+eg:s2
+ eg:value eg:s1 .
+
diff --git a/tests/validate/bad-domain.ttl b/tests/validate/bad-domain.ttl
new file mode 100644
index 00000000..d36b5652
--- /dev/null
+++ b/tests/validate/bad-domain.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:Thing
+ a rdfs:Class .
+
+eg:NonThing
+ a rdfs:Class .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:domain eg:Thing .
+
+eg:nonthing
+ a eg:NonThing ;
+ eg:value 42 .
+
diff --git a/tests/validate/bad-functional-property.ttl b/tests/validate/bad-functional-property.ttl
new file mode 100644
index 00000000..53a73ccd
--- /dev/null
+++ b/tests/validate/bad-functional-property.ttl
@@ -0,0 +1,13 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:identity
+ rdfs:label "identity" ;
+ a owl:FunctionalProperty .
+
+eg:s
+ eg:identity "me" ,
+ "you" .
+
diff --git a/tests/validate/bad-inverse-functional-property.ttl b/tests/validate/bad-inverse-functional-property.ttl
new file mode 100644
index 00000000..95c0aaea
--- /dev/null
+++ b/tests/validate/bad-inverse-functional-property.ttl
@@ -0,0 +1,15 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:identity
+ rdfs:label "identity" ;
+ a owl:InverseFunctionalProperty .
+
+eg:s1
+ eg:identity "me" .
+
+eg:s2
+ eg:identity "me" .
+
diff --git a/tests/validate/bad-literal-pattern.ttl b/tests/validate/bad-literal-pattern.ttl
new file mode 100644
index 00000000..40f9eec0
--- /dev/null
+++ b/tests/validate/bad-literal-pattern.ttl
@@ -0,0 +1,7 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:s
+ rdf:value "no"^^xsd:boolean .
+
diff --git a/tests/validate/bad-literal-value-high-exclusive.ttl b/tests/validate/bad-literal-value-high-exclusive.ttl
new file mode 100644
index 00000000..9e2bfe47
--- /dev/null
+++ b/tests/validate/bad-literal-value-high-exclusive.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:Normal
+ a rdfs:Datatype ;
+ rdfs:label "normal" ;
+ owl:onDatatype xsd:double ;
+ owl:withRestrictions (
+ [
+ xsd:maxExclusive 1.0
+ ] [
+ xsd:minExclusive 0.0
+ ]
+ ) .
+
+eg:s
+ rdf:value "1.0"^^eg:Normal .
diff --git a/tests/validate/bad-literal-value-high-inclusive.ttl b/tests/validate/bad-literal-value-high-inclusive.ttl
new file mode 100644
index 00000000..b58793ec
--- /dev/null
+++ b/tests/validate/bad-literal-value-high-inclusive.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:Normal
+ a rdfs:Datatype ;
+ rdfs:label "normal" ;
+ owl:onDatatype xsd:double ;
+ owl:withRestrictions (
+ [
+ xsd:maxInclusive 1.0
+ ] [
+ xsd:minInclusive 0.0
+ ]
+ ) .
+
+eg:s
+ rdf:value "1.1"^^eg:Normal .
diff --git a/tests/validate/bad-literal-value-low-exclusive.ttl b/tests/validate/bad-literal-value-low-exclusive.ttl
new file mode 100644
index 00000000..fdcaf94a
--- /dev/null
+++ b/tests/validate/bad-literal-value-low-exclusive.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:Normal
+ a rdfs:Datatype ;
+ rdfs:label "normal" ;
+ owl:onDatatype xsd:double ;
+ owl:withRestrictions (
+ [
+ xsd:maxExclusive 1.0
+ ] [
+ xsd:minExclusive 0.0
+ ]
+ ) .
+
+eg:s
+ rdf:value "0.0"^^eg:Normal .
diff --git a/tests/validate/bad-literal-value-low-inclusive.ttl b/tests/validate/bad-literal-value-low-inclusive.ttl
new file mode 100644
index 00000000..c88123dd
--- /dev/null
+++ b/tests/validate/bad-literal-value-low-inclusive.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:Normal
+ a rdfs:Datatype ;
+ rdfs:label "normal" ;
+ owl:onDatatype xsd:double ;
+ owl:withRestrictions (
+ [
+ xsd:maxInclusive 1.0
+ ] [
+ xsd:minInclusive 0.0
+ ]
+ ) .
+
+eg:s
+ rdf:value "-0.1"^^eg:Normal .
+
diff --git a/tests/validate/bad-object-property.ttl b/tests/validate/bad-object-property.ttl
new file mode 100644
index 00000000..b4a31f9d
--- /dev/null
+++ b/tests/validate/bad-object-property.ttl
@@ -0,0 +1,12 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:value
+ rdfs:label "value" ;
+ a owl:ObjectProperty .
+
+eg:s
+ eg:value "literal" .
+
diff --git a/tests/validate/bad-pattern.ttl b/tests/validate/bad-pattern.ttl
new file mode 100644
index 00000000..1c367bd2
--- /dev/null
+++ b/tests/validate/bad-pattern.ttl
@@ -0,0 +1,21 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:BrokenLiteral
+ a rdfs:Datatype ;
+ rdfs:label "broken literal" ;
+ owl:withRestrictions (
+ [
+ xsd:pattern "["
+ ]
+ ) .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:range eg:BinaryLiteral .
+
+eg:s
+ eg:value "no match"^^eg:BrokenLiteral .
+
diff --git a/tests/validate/bad-plain-literal.ttl b/tests/validate/bad-plain-literal.ttl
new file mode 100644
index 00000000..116faac0
--- /dev/null
+++ b/tests/validate/bad-plain-literal.ttl
@@ -0,0 +1,12 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:range rdf:PlainLiteral .
+
+eg:s
+ eg:value "literal"^^rdf:XMLLiteral .
+
diff --git a/tests/validate/bad-range-instance-not-literal.ttl b/tests/validate/bad-range-instance-not-literal.ttl
new file mode 100644
index 00000000..ea7803f6
--- /dev/null
+++ b/tests/validate/bad-range-instance-not-literal.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:Thing
+ a rdfs:Class .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:range rdfs:Literal .
+
+eg:thing
+ a eg:Thing .
+
+eg:s
+ eg:value eg:thing .
+
diff --git a/tests/validate/bad-range-instance.ttl b/tests/validate/bad-range-instance.ttl
new file mode 100644
index 00000000..a04a5476
--- /dev/null
+++ b/tests/validate/bad-range-instance.ttl
@@ -0,0 +1,21 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:Thing
+ a rdfs:Class .
+
+eg:NonThing
+ a rdfs:Class .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:range eg:Thing .
+
+eg:nonthing
+ a eg:NonThing .
+
+eg:s
+ eg:value eg:nonthing .
+
diff --git a/tests/validate/bad-range-literal-not-instance.ttl b/tests/validate/bad-range-literal-not-instance.ttl
new file mode 100644
index 00000000..f46de8ce
--- /dev/null
+++ b/tests/validate/bad-range-literal-not-instance.ttl
@@ -0,0 +1,15 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:Thing
+ a rdfs:Class .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:range eg:Thing .
+
+eg:s
+ eg:value "literal" .
+
diff --git a/tests/validate/bad-range-literal.ttl b/tests/validate/bad-range-literal.ttl
new file mode 100644
index 00000000..cbeb4074
--- /dev/null
+++ b/tests/validate/bad-range-literal.ttl
@@ -0,0 +1,25 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:Normal
+ a rdfs:Datatype ;
+ rdfs:label "normal" ;
+ owl:onDatatype xsd:double ;
+ owl:withRestrictions (
+ [
+ xsd:maxExclusive 1.0
+ ] [
+ xsd:minExclusive 0.0
+ ]
+ ) .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:range eg:Normal .
+
+eg:s
+ eg:value 2.0 .
+
+
diff --git a/tests/validate/bad-some-values-from.ttl b/tests/validate/bad-some-values-from.ttl
new file mode 100644
index 00000000..259bfb88
--- /dev/null
+++ b/tests/validate/bad-some-values-from.ttl
@@ -0,0 +1,18 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:Thing
+ a rdfs:Class ;
+ rdfs:subClassOf [
+ a owl:Restriction ;
+ owl:onProperty rdfs:label ;
+ owl:someValuesFrom rdf:PlainLiteral
+ ] .
+
+eg:s
+ a eg:Thing ;
+ rdfs:label "not plain"^^rdf:XMLLiteral .
+
+
diff --git a/tests/validate/bad-string-literal-value-high.ttl b/tests/validate/bad-string-literal-value-high.ttl
new file mode 100644
index 00000000..7119e30a
--- /dev/null
+++ b/tests/validate/bad-string-literal-value-high.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:startsWithC
+ a rdfs:Datatype ;
+ rdfs:label "starts with C" ;
+ owl:onDatatype xsd:string ;
+ owl:withRestrictions (
+ [
+ xsd:maxExclusive "D"
+ ] [
+ xsd:minInclusive "B"
+ ]
+ ) .
+
+eg:s
+ rdf:value "Door"^^eg:startsWithC .
+
diff --git a/tests/validate/bad-string-literal-value-low.ttl b/tests/validate/bad-string-literal-value-low.ttl
new file mode 100644
index 00000000..93c2f17e
--- /dev/null
+++ b/tests/validate/bad-string-literal-value-low.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:betweenBAndD
+ a rdfs:Datatype ;
+ rdfs:label "between B and D" ;
+ owl:onDatatype xsd:string ;
+ owl:withRestrictions (
+ [
+ xsd:maxInclusive "D"
+ ] [
+ xsd:minExclusive "B"
+ ]
+ ) .
+
+eg:s
+ rdf:value "Aardvark"^^eg:betweenBAndD .
+
diff --git a/tests/validate/bad-unknown-datatype.ttl b/tests/validate/bad-unknown-datatype.ttl
new file mode 100644
index 00000000..be2fc132
--- /dev/null
+++ b/tests/validate/bad-unknown-datatype.ttl
@@ -0,0 +1,6 @@
+@prefix eg: <http://example.org/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:s
+ rdfs:label "bad datatype"^^rdf:UndefinedLiteral .
+
diff --git a/tests/validate/bad-unknown-property.ttl b/tests/validate/bad-unknown-property.ttl
new file mode 100644
index 00000000..0db1e85c
--- /dev/null
+++ b/tests/validate/bad-unknown-property.ttl
@@ -0,0 +1,6 @@
+@prefix eg: <http://example.org/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:s
+ eg:undefined 0 .
+
diff --git a/tests/validate/good-cardinality.ttl b/tests/validate/good-cardinality.ttl
new file mode 100644
index 00000000..6b0b87da
--- /dev/null
+++ b/tests/validate/good-cardinality.ttl
@@ -0,0 +1,17 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:Thing
+ a rdfs:Class ;
+ rdfs:subClassOf [
+ a owl:Restriction ;
+ owl:onProperty rdf:value ;
+ owl:cardinality 2
+ ] .
+
+eg:s
+ a eg:Thing ;
+ rdf:value 1 ,
+ 2 .
diff --git a/tests/validate/good-literal-value-high-inclusive.ttl b/tests/validate/good-literal-value-high-inclusive.ttl
new file mode 100644
index 00000000..df9cf565
--- /dev/null
+++ b/tests/validate/good-literal-value-high-inclusive.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:Normal
+ a rdfs:Datatype ;
+ rdfs:label "normal" ;
+ owl:onDatatype xsd:double ;
+ owl:withRestrictions (
+ [
+ xsd:maxInclusive 1.0
+ ]
+ [
+ xsd:minInclusive 0.0
+ ]
+ ) .
+
+eg:s
+ rdf:value "1.0"^^eg:Normal .
diff --git a/tests/validate/good-literal-value-low-inclusive.ttl b/tests/validate/good-literal-value-low-inclusive.ttl
new file mode 100644
index 00000000..6145ee53
--- /dev/null
+++ b/tests/validate/good-literal-value-low-inclusive.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:Normal
+ a rdfs:Datatype ;
+ rdfs:label "normal" ;
+ owl:onDatatype xsd:double ;
+ owl:withRestrictions (
+ [
+ xsd:maxInclusive 1.0
+ ]
+ [
+ xsd:minInclusive 0.0
+ ]
+ ) .
+
+eg:s
+ rdf:value "0.0"^^eg:Normal .
diff --git a/tests/validate/good-pattern.ttl b/tests/validate/good-pattern.ttl
new file mode 100644
index 00000000..96e426ca
--- /dev/null
+++ b/tests/validate/good-pattern.ttl
@@ -0,0 +1,20 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:CapitalLiteral
+ a rdfs:Datatype ;
+ rdfs:label "capital literal" ;
+ owl:withRestrictions (
+ [
+ xsd:pattern "[A-Z][a-z]*"
+ ]
+ ) .
+
+eg:value
+ a rdf:Property ;
+ rdfs:label "value" ;
+ rdfs:range eg:CapitalLiteral .
+
+eg:s
+ eg:value "Uppercase"^^eg:CapitalLiteral .
diff --git a/tests/validate/good-some-values-from.ttl b/tests/validate/good-some-values-from.ttl
new file mode 100644
index 00000000..1da49270
--- /dev/null
+++ b/tests/validate/good-some-values-from.ttl
@@ -0,0 +1,17 @@
+@prefix eg: <http://example.org/> .
+@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#> .
+
+eg:Thing
+ a rdfs:Class ;
+ rdfs:subClassOf [
+ a owl:Restriction ;
+ owl:onProperty rdfs:label ;
+ owl:someValuesFrom rdf:PlainLiteral
+ ] .
+
+eg:s
+ a eg:Thing ;
+ rdfs:label "not plain"^^rdf:XMLLiteral ,
+ "plain" .
diff --git a/tests/validate/good-string-literal-value-low.ttl b/tests/validate/good-string-literal-value-low.ttl
new file mode 100644
index 00000000..0d2c8e6b
--- /dev/null
+++ b/tests/validate/good-string-literal-value-low.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+eg:betweenBAndD
+ a rdfs:Datatype ;
+ rdfs:label "between B and D" ;
+ owl:onDatatype xsd:string ;
+ owl:withRestrictions (
+ [
+ xsd:maxInclusive "D"
+ ]
+ [
+ xsd:minExclusive "B"
+ ]
+ ) .
+
+eg:s
+ rdf:value "Cat"^^eg:betweenBAndD .
diff --git a/tests/validate/manifest.ttl b/tests/validate/manifest.ttl
new file mode 100644
index 00000000..68853073
--- /dev/null
+++ b/tests/validate/manifest.ttl
@@ -0,0 +1,205 @@
+@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 rdft: <http://www.w3.org/ns/rdftest#> .
+@prefix serd: <http://drobilla.net/ns/serd#> .
+
+serd:TestTurtleNegativeValidate
+ a rdfs:Class ;
+ rdfs:subClassOf rdft:Test .
+
+serd:TestTurtlePositiveValidate
+ a rdfs:Class ;
+ rdfs:subClassOf rdft:Test .
+
+<>
+ rdf:type mf:Manifest ;
+ rdfs:comment "Serd validation test cases" ;
+ mf:entries (
+ <#bad-all-values-from>
+ <#bad-cardinality-high>
+ <#bad-cardinality-low>
+ <#bad-cardinality>
+ <#bad-datatype-property>
+ <#bad-domain>
+ <#bad-functional-property>
+ <#bad-inverse-functional-property>
+ <#bad-literal-pattern>
+ <#bad-literal-value-high-inclusive>
+ <#bad-literal-value-low-inclusive>
+ <#bad-literal-value-high-exclusive>
+ <#bad-literal-value-low-exclusive>
+ <#bad-string-literal-value-high>
+ <#bad-string-literal-value-low>
+ <#bad-object-property>
+ <#bad-pattern>
+ <#bad-plain-literal>
+ <#bad-range-instance-not-literal>
+ <#bad-range-instance>
+ <#bad-range-literal-not-instance>
+ <#bad-range-literal>
+ <#bad-some-values-from>
+ <#bad-unknown-datatype>
+ <#bad-unknown-property>
+ <#good-cardinality>
+ <#good-literal-value-high-inclusive>
+ <#good-literal-value-low-inclusive>
+ <#good-pattern>
+ <#good-some-values-from>
+ <#good-string-literal-value-low>
+ ) .
+
+<#bad-all-values-from>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-all-values-from" ;
+ mf:action <bad-all-values-from.ttl> .
+
+<#bad-cardinality-low>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-cardinality-low" ;
+ mf:action <bad-cardinality-low.ttl> .
+
+<#bad-cardinality-high>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-cardinality-high" ;
+ mf:action <bad-cardinality-high.ttl> .
+
+<#bad-cardinality>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-cardinality" ;
+ mf:action <bad-cardinality.ttl> .
+
+<#bad-datatype-property>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-datatype-property" ;
+ mf:action <bad-datatype-property.ttl> .
+
+<#bad-domain>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-domain" ;
+ mf:action <bad-domain.ttl> .
+
+<#bad-functional-property>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-functional-property" ;
+ mf:action <bad-functional-property.ttl> .
+
+<#bad-inverse-functional-property>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-inverse-functional-property" ;
+ mf:action <bad-inverse-functional-property.ttl> .
+
+<#bad-literal-pattern>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-literal-pattern" ;
+ mf:action <bad-literal-pattern.ttl> .
+
+<#bad-literal-value-low-inclusive>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-literal-value-low-inclusive" ;
+ mf:action <bad-literal-value-low-inclusive.ttl> .
+
+<#bad-literal-value-high-inclusive>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-literal-value-high-inclusive" ;
+ mf:action <bad-literal-value-high-inclusive.ttl> .
+
+<#bad-literal-value-low-exclusive>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-literal-value-low-exclusive" ;
+ mf:action <bad-literal-value-low-exclusive.ttl> .
+
+<#bad-literal-value-high-exclusive>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-literal-value-high-exclusive" ;
+ mf:action <bad-literal-value-high-exclusive.ttl> .
+
+<#bad-string-literal-value-low>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-string-literal-value-low" ;
+ mf:action <bad-string-literal-value-low.ttl> .
+
+<#bad-string-literal-value-high>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-string-literal-value-high" ;
+ mf:action <bad-string-literal-value-high.ttl> .
+
+<#bad-object-property>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-object-property" ;
+ mf:action <bad-object-property.ttl> .
+
+<#bad-pattern>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-pattern" ;
+ mf:action <bad-pattern.ttl> .
+
+<#bad-plain-literal>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-plain-literal" ;
+ mf:action <bad-plain-literal.ttl> .
+
+<#bad-range-instance-not-literal>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-range-instance-not-literal" ;
+ mf:action <bad-range-instance-not-literal.ttl> .
+
+<#bad-range-instance>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-range-instance" ;
+ mf:action <bad-range-instance.ttl> .
+
+<#bad-range-literal-not-instance>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-range-literal-not-instance" ;
+ mf:action <bad-range-literal-not-instance.ttl> .
+
+<#bad-range-literal>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-range-literal" ;
+ mf:action <bad-range-literal.ttl> .
+
+<#bad-some-values-from>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-some-values-from" ;
+ mf:action <bad-some-values-from.ttl> .
+
+<#bad-unknown-datatype>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-unknown-datatype" ;
+ mf:action <bad-unknown-datatype.ttl> .
+
+<#bad-unknown-property>
+ rdf:type serd:TestTurtleNegativeValidate ;
+ mf:name "bad-unknown-property" ;
+ mf:action <bad-unknown-property.ttl> .
+
+<#good-cardinality>
+ rdf:type serd:TestTurtlePositiveValidate ;
+ mf:name "good-cardinality" ;
+ mf:action <good-cardinality.ttl> .
+
+<#good-literal-value-low-inclusive>
+ rdf:type serd:TestTurtlePositiveValidate ;
+ mf:name "good-literal-value-low-inclusive" ;
+ mf:action <good-literal-value-low-inclusive.ttl> .
+
+<#good-literal-value-high-inclusive>
+ rdf:type serd:TestTurtlePositiveValidate ;
+ mf:name "good-literal-value-high-inclusive" ;
+ mf:action <good-literal-value-high-inclusive.ttl> .
+
+<#good-some-values-from>
+ rdf:type serd:TestTurtlePositiveValidate ;
+ mf:name "good-some-values-from" ;
+ mf:action <good-some-values-from.ttl> .
+
+<#good-pattern>
+ rdf:type serd:TestTurtlePositiveValidate ;
+ mf:name "good-pattern" ;
+ mf:action <good-pattern.ttl> .
+
+<#good-string-literal-value-low>
+ rdf:type serd:TestTurtlePositiveValidate ;
+ mf:name "good-string-literal-value-low" ;
+ mf:action <good-string-literal-value-low.ttl> .