forked from skohub-io/skohub-shapes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract constraints documented via sh:message
See skohub-io#1 for discussion.
- Loading branch information
Showing
4 changed files
with
28 additions
and
6 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
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,11 @@ | ||
prefix sh: <http://www.w3.org/ns/shacl#> | ||
|
||
SELECT DISTINCT ?type ?msg { | ||
?shape sh:message ?msg . | ||
#FILTER (lang(?msg) = 'en') | ||
|
||
OPTIONAL { ?shape sh:severity ?severity } | ||
BIND(STRAFTER(STR(COALESCE(?severity,sh:Violation)),'#') as ?type) | ||
|
||
#filter(regex(?msg,"S[0-9]+")) | ||
} ORDER BY ?type |
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,9 @@ | ||
#!/bin/bash | ||
|
||
sparql() { | ||
data=$1 | ||
query=$2 | ||
docker run --rm -v $query:/rdf/query.rq --mount type=bind,source=$data,target=/rdf/data.ttl skohub/jena:4.6.1 arq --data /rdf/data.ttl --query /rdf/query.rq --results=TSV | ||
} | ||
|
||
sparql $(pwd)/skos.shacl.ttl $(pwd)/scripts/messages.rq |
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