-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VET-3274] Add SHACL validation (#60)
* [VET-3274] Add VALIDATE * [VET-3274] Add tests from docs * [VET-3274] Actually follow the docs w.r.t. expressions it supports + learn chevrotain * [VET-3274] Update test snapshots * [VET-3274] Add badDog failing cases; fix initial clause * [VET-3274] Remove stray comment * [VET-3274] Break up ValidateQuery into more clauses * [VET-3274] Ensure all test files end with newlines
- Loading branch information
1 parent
4c19def
commit 13d7a1f
Showing
27 changed files
with
1,602 additions
and
1,457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,720 changes: 1,360 additions & 1,360 deletions
2,720
src/__tests__/shacl/__snapshots__/lexer.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE ALL something:else |
2 changes: 2 additions & 0 deletions
2
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-limit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE LIMIT 10 ALL |
2 changes: 2 additions & 0 deletions
2
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-limit-combined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE ALL LIMIT 100 LIMIT PER SHAPE 1 LIMIT 10 |
2 changes: 2 additions & 0 deletions
2
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-limit-per-shape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE ALL LIMIT PER 10 |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX ex: <tag:stardog:example:> | ||
VALIDATE ex:MyNode GRAPH ex:duplicateGraph GRAPH ex:graph1 ex:graph2 |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-node-from-graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX ex: <tag:stardog:example:> | ||
VALIDATE ex:MyNode GRAPH ex:graph1 ALL |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-shapes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX : <tag:stardog:example:> | ||
VALIDATE USING SHAPES :SongShape :AlbumShape |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-shapes-2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX : <tag:stardog:example:> | ||
VALIDATE ALL USING :SongShape :AlbumShape |
14 changes: 14 additions & 0 deletions
14
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-shapes-external
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
PREFIX : <tag:stardog:example:> | ||
|
||
VALIDATE ALL LIMIT 10 USING SHAPES { | ||
:NameShape a sh:NodeShape ; | ||
sh:property [ | ||
sh:path :name ; | ||
sh:minCount 1 ; | ||
sh:datatype xsd:string | ||
] . | ||
} |
10 changes: 10 additions & 0 deletions
10
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/badDog/validate-shapes-graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX ex: <tag:stardog:example:> | ||
VALIDATE ALL USING SHAPES GRAPH ex:constraintGraph { | ||
:NameShape a sh:NodeShape ; | ||
sh:property [ | ||
sh:path :name ; | ||
sh:minCount 1 ; | ||
sh:datatype xsd:string | ||
] . | ||
} |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE ALL |
4 changes: 4 additions & 0 deletions
4
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX ex: <tag:stardog:example:> | ||
VALIDATE GRAPH ex:graph1 ex:graph2 |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-limit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE ALL LIMIT 10 |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-limit-combined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE ALL LIMIT 100 LIMIT PER SHAPE 1 |
3 changes: 3 additions & 0 deletions
3
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-limit-per-shape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
VALIDATE ALL LIMIT PER SHAPE 10 |
4 changes: 4 additions & 0 deletions
4
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX ex: <tag:stardog:example:> | ||
VALIDATE ex:MyNode |
4 changes: 4 additions & 0 deletions
4
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-node-from-graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX ex: <tag:stardog:example:> | ||
VALIDATE ex:MyNode GRAPH ex:graph1 |
4 changes: 4 additions & 0 deletions
4
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-shapes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX : <tag:stardog:example:> | ||
VALIDATE ALL USING SHAPES :SongShape :AlbumShape |
14 changes: 14 additions & 0 deletions
14
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-shapes-external
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
PREFIX : <tag:stardog:example:> | ||
|
||
VALIDATE ALL USING SHAPES { | ||
:NameShape a sh:NodeShape ; | ||
sh:property [ | ||
sh:path :name ; | ||
sh:minCount 1 ; | ||
sh:datatype xsd:string | ||
] . | ||
} |
4 changes: 4 additions & 0 deletions
4
src/__tests__/sparql/fixtures/stardogExtensions/ebnf/goodDog/validate-shapes-graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# taken from Stardog docs: https://docs.stardog.com/data-quality-constraints#validate-sparql-service | ||
PREFIX icv: <tag:stardog:api:icv:> | ||
PREFIX ex: <tag:stardog:example:> | ||
VALIDATE ALL USING SHAPES GRAPH ex:constraintGraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.