Skip to content

Commit 4c9d714

Browse files
committed
Forward-port metashacl flag from pyshacl
A follow-on patch will regenerate Make-managed files. References: * #74 * ucoProject/UCO#504 Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent af48b83 commit 4c9d714

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-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+

0 commit comments

Comments
 (0)