Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions case_utils/case_validate/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -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",
Expand DownExpand Up@@ -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,
Expand Down
17 changes: 16 additions & 1 deletion tests/case_utils/case_validate/cli/Makefile
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)
Expand DownExpand Up@@ -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 _$@ $@
9 changes: 9 additions & 0 deletions tests/case_utils/case_validate/cli/thing.ttl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[]
a owl:Thing ;
.

2 changes: 2 additions & 0 deletions tests/case_utils/case_validate/cli/thing_metashacl_PASS.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
Validation Report
Conforms: True