Skip to content

Commit aaa00c6

Browse files
authored
Merge pull request #76 from casework/add_case_validate_metashacl
Forward-port metashacl flag from pyshacl
2 parents af48b83 + 5fe6489 commit aaa00c6

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

case_utils/case_validate/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ def main() -> None:
122122
default="none",
123123
help='(As with pyshacl CLI) Choose a type of inferencing to run against the Data Graph before validating. Default is "none".',
124124
)
125+
parser.add_argument(
126+
"-m",
127+
"--metashacl",
128+
dest="metashacl",
129+
action="store_true",
130+
default=False,
131+
help="(As with pyshacl CLI) Validate the SHACL Shapes graph against the shacl-shacl Shapes Graph before validating the Data Graph.",
132+
)
125133
parser.add_argument(
126134
"-o",
127135
"--output",
@@ -170,6 +178,7 @@ def main() -> None:
170178
shacl_graph=ontology_graph,
171179
ont_graph=ontology_graph,
172180
inference=args.inference,
181+
meta_shacl=args.metashacl,
173182
abort_on_first=args.abort,
174183
allow_infos=True if args.allow_infos else False,
175184
allow_warnings=True if args.allow_warnings else False,

tests/case_utils/case_validate/cli/Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ files_to_generate := \
4141
format_unspecified_output_txt.txt \
4242
format_unspecified_output_unspecified.txt \
4343
split_data_graph_PASS.txt \
44-
split_data_graph_XFAIL.txt
44+
split_data_graph_XFAIL.txt \
45+
thing_metashacl_PASS.txt
4546

4647
all: \
4748
$(files_to_generate)
@@ -216,3 +217,17 @@ split_data_graph_XFAIL.txt: \
216217
> _$@ \
217218
; rc=$$? ; test 1 -eq $$rc
218219
mv _$@ $@
220+
221+
thing_metashacl_PASS.txt: \
222+
$(tests_srcdir)/.venv.done.log \
223+
$(top_srcdir)/.ontology.done.log \
224+
$(top_srcdir)/case_utils/case_validate/__init__.py \
225+
$(top_srcdir)/case_utils/ontology/__init__.py \
226+
thing.ttl
227+
rm -f _$@
228+
source $(tests_srcdir)/venv/bin/activate \
229+
&& case_validate \
230+
--metashacl \
231+
thing.ttl \
232+
> _$@
233+
mv _$@ $@
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
2+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5+
6+
[]
7+
a owl:Thing ;
8+
.
9+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Validation Report
2+
Conforms: True

0 commit comments

Comments
 (0)