From 0663847539a188c5f9b79d249231d13ffd8af6dc Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 19 Sep 2023 08:22:28 -0400 Subject: [PATCH] Import prov-constraints review from case-prov testing This is part of retiring CASE-Examples review from the `case-prov` repository. A follow-on patch will regenerate Make-managed files. References: * https://github.com/casework/CASE-Implementation-PROV-O/issues/89 Signed-off-by: Alex Nelson --- .gitmodules | 4 ++++ Makefile | 5 +++++ dependencies/prov-check | 1 + tests/.gitignore | 1 + tests/postvisit.mk | 33 +++++++++++++++++++++++++++++++-- 5 files changed, 42 insertions(+), 2 deletions(-) create mode 160000 dependencies/prov-check diff --git a/.gitmodules b/.gitmodules index acf5a28..afe56a3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,3 +18,7 @@ path = dependencies/casework.github.io url = https://github.com/casework/casework.github.io.git branch = master +[submodule "dependencies/prov-check"] + path = dependencies/prov-check + url = https://github.com/ajnelson-nist/prov-check.git + branch = adjust_reporting diff --git a/Makefile b/Makefile index 3a8438d..5bfda50 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,11 @@ all: \ || (git submodule init dependencies/casework.github.io && git submodule update dependencies/casework.github.io) @test -r dependencies/casework.github.io/README.md \ || (echo "ERROR:Makefile:casework.github.io submodule README.md file not found, even though casework.gitub.io submodule initialized." >&2 ; exit 2) + # prov-check + test -r dependencies/prov-check/README.md \ + || (git submodule update --init dependencies/prov-check) + @test -r dependencies/prov-check/README.md \ + || (echo "ERROR:Makefile:prov-check submodule README.md file not found, even though prov-check submodule initialized." >&2 ; exit 2) touch $@ .venv.done.log: \ diff --git a/dependencies/prov-check b/dependencies/prov-check new file mode 160000 index 0000000..c4126ba --- /dev/null +++ b/dependencies/prov-check @@ -0,0 +1 @@ +Subproject commit c4126badf40be8af8c086123003c1a2f985a2426 diff --git a/tests/.gitignore b/tests/.gitignore index ca21aeb..c289a35 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,5 +1,6 @@ .check_README.md kb-entailment.ttl +kb-prov-time.ttl ontologies.txt ontology_relationship_literals.tsv ontology_vocabulary.txt diff --git a/tests/postvisit.mk b/tests/postvisit.mk index 2e90410..18efc95 100644 --- a/tests/postvisit.mk +++ b/tests/postvisit.mk @@ -38,14 +38,14 @@ used_concepts_dependencies := $(foreach exdir,$(exdirs),$(exdir) used_kindOfRelationships_dependencies := $(foreach exdir,$(exdirs),$(exdir)/used_kindOfRelationships.tsv) all: \ - kb.ttl \ + prov-constraints.log \ undefined_concepts.txt \ undefined_kindOfRelationships.tsv \ used_concepts.txt \ used_kindOfRelationships.tsv check: \ - kb.ttl \ + prov-constraints.log \ undefined_concepts.txt \ undefined_kindOfRelationships.tsv \ used_concepts.txt \ @@ -61,6 +61,24 @@ clean: used_concepts.txt \ used_kindOfRelationships.tsv +kb-prov-time.ttl: \ + kb.ttl + rm -f __$@ _$@ + export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \ + && source $(top_srcdir)/venv/bin/activate \ + && case_prov_rdf \ + --use-deterministic-uuids \ + __$@ \ + $< + java -jar $(rdf_toolkit_jar) \ + --inline-blank-nodes \ + --source __$@ \ + --source-format turtle \ + --target _$@ \ + --target-format turtle + rm __$@ + mv _$@ $@ + kb.ttl: \ $(top_srcdir)/dependencies/CASE-Corpora/catalog/kb-all.ttl \ $(top_srcdir)/dependencies/imports-transitive.ttl \ @@ -94,6 +112,17 @@ kb.ttl: \ rm __$@ mv _$@ $@ +prov-constraints.log: \ + $(top_srcdir)/dependencies/prov-check/provcheck/provconstraints.py \ + kb-prov-time.ttl + source $(top_srcdir)/venv/bin/activate \ + && python3 $(top_srcdir)/dependencies/prov-check/provcheck/provconstraints.py \ + --debug \ + kb-prov-time.ttl \ + > _$@ \ + 2>&1 + mv _$@ $@ + undefined_concepts.txt: \ $(undefined_concepts_dependencies) cat $^ \