Skip to content

Commit

Permalink
Add case-prov illustrations of beginnings of chain of custody
Browse files Browse the repository at this point in the history
This patch also adds graphviz to the CI testing environment, though
curiously this has not been needed in other projects using `dot`.

This is part of retiring CASE-Examples review from the `case-prov`
repository.

A follow-on patch will regenerate Make-managed files.

References:
* casework/CASE-Implementation-PROV-O#89

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
  • Loading branch information
ajnelson-nist committed Sep 19, 2023
1 parent 79ce84b commit dab41d7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Install Graphviz
run: sudo apt-get install --yes graphviz
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.dot
.check_README.md
kb-entailment.ttl
kb-prov-time.ttl
Expand Down
45 changes: 44 additions & 1 deletion tests/CASE-Examples/examples/illustrations/src/review.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,60 @@ rdf_toolkit_jar := $(top_srcdir)/dependencies/CASE-Examples/dependencies/CASE-de
subjectdir_basename := $(shell basename $$PWD)

all: \
$(subjectdir_basename).json \
$(subjectdir_basename)-prov-originals.svg \
undefined_concepts.txt \
undefined_kindOfRelationships.tsv

.PHONY: \
normalize

%.svg: \
%.dot
dot \
-o _$@ \
-T svg \
$<
mv _$@ $@

$(rdf_toolkit_jar):
@echo "ERROR:Makefile:rdf-toolkit.jar not downloaded; please run 'make download' from the top-level directory ($(top_srcdir))." >&2
@exit 2

$(subjectdir_basename)-prov-originals.dot: \
$(subjectdir_basename)-prov.ttl
rm -f _$@
source $(top_srcdir)/venv/bin/activate \
&& case_prov_dot \
--dash-unqualified \
--debug \
--from-empty-set \
--use-deterministic-uuids \
_$@ \
$<
mv _$@ $@

$(subjectdir_basename)-prov.ttl: \
$(subjectdir_basename).json \
$(top_srcdir)/.venv.done.log
rm -f __$@ _$@
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/venv/bin/activate \
&& case_prov_rdf \
--allow-empty-results \
--debug \
--use-deterministic-uuids \
__$@ \
$<
java -jar $(rdf_toolkit_jar) \
--inline-blank-nodes \
--source __$@ \
--source-format turtle \
--target _$@ \
--target-format turtle
rm __$@
mv _$@ $@


$(subjectdir_basename).json: \
$(top_srcdir)/dependencies/CASE-Examples/examples/illustrations/$(subjectdir_basename)/$(subjectdir_basename).json
source $(top_srcdir)/venv/bin/activate \
Expand Down

0 comments on commit dab41d7

Please sign in to comment.