diff --git a/case_utils/case_validate/__init__.py b/case_utils/case_validate/__init__.py index 1890eef..e80079f 100644 --- a/case_utils/case_validate/__init__.py +++ b/case_utils/case_validate/__init__.py @@ -122,6 +122,14 @@ def main() -> None: default="none", help='(As with pyshacl CLI) Choose a type of inferencing to run against the Data Graph before validating. Default is "none".', ) + parser.add_argument( + "-m", + "--metashacl", + dest="metashacl", + action="store_true", + default=False, + help="(As with pyshacl CLI) Validate the SHACL Shapes graph against the shacl-shacl Shapes Graph before validating the Data Graph.", + ) parser.add_argument( "-o", "--output", @@ -170,6 +178,7 @@ def main() -> None: shacl_graph=ontology_graph, ont_graph=ontology_graph, inference=args.inference, + meta_shacl=args.metashacl, abort_on_first=args.abort, allow_infos=True if args.allow_infos else False, allow_warnings=True if args.allow_warnings else False, diff --git a/tests/case_utils/case_validate/cli/Makefile b/tests/case_utils/case_validate/cli/Makefile index f61d421..22c5fe1 100644 --- a/tests/case_utils/case_validate/cli/Makefile +++ b/tests/case_utils/case_validate/cli/Makefile @@ -41,7 +41,8 @@ files_to_generate := \ format_unspecified_output_txt.txt \ format_unspecified_output_unspecified.txt \ split_data_graph_PASS.txt \ - split_data_graph_XFAIL.txt + split_data_graph_XFAIL.txt \ + thing_metashacl_PASS.txt all: \ $(files_to_generate) @@ -216,3 +217,17 @@ split_data_graph_XFAIL.txt: \ > _$@ \ ; rc=$$? ; test 1 -eq $$rc mv _$@ $@ + +thing_metashacl_PASS.txt: \ + $(tests_srcdir)/.venv.done.log \ + $(top_srcdir)/.ontology.done.log \ + $(top_srcdir)/case_utils/case_validate/__init__.py \ + $(top_srcdir)/case_utils/ontology/__init__.py \ + thing.ttl + rm -f _$@ + source $(tests_srcdir)/venv/bin/activate \ + && case_validate \ + --metashacl \ + thing.ttl \ + > _$@ + mv _$@ $@ diff --git a/tests/case_utils/case_validate/cli/thing.ttl b/tests/case_utils/case_validate/cli/thing.ttl new file mode 100644 index 0000000..d28e973 --- /dev/null +++ b/tests/case_utils/case_validate/cli/thing.ttl @@ -0,0 +1,9 @@ +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + +[] + a owl:Thing ; + . + diff --git a/tests/case_utils/case_validate/cli/thing_metashacl_PASS.txt b/tests/case_utils/case_validate/cli/thing_metashacl_PASS.txt new file mode 100644 index 0000000..0c16da6 --- /dev/null +++ b/tests/case_utils/case_validate/cli/thing_metashacl_PASS.txt @@ -0,0 +1,2 @@ +Validation Report +Conforms: True