diff --git a/.gitignore b/.gitignore index 553aac46..8418dd5e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ catalog-v001.xml .*.swp # Workflow files +*.jar .*.done.log .venv-pre-commit venv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 339017a6..6aee99af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,3 +9,9 @@ repos: - --indent=4 - --no-ensure-ascii - --no-sort-keys +- repo: https://github.com/kchason/rdf-toolkit-action + rev: 0.1.2 + hooks: + - id: rdf-toolkit-normalizer + args: + - --autofix diff --git a/Makefile b/Makefile index e2c8838a..949e8625 100644 --- a/Makefile +++ b/Makefile @@ -32,11 +32,6 @@ all: \ # for someone developing with different submodule pointers. .git_submodule_init.done.log: \ .gitmodules - # CASE-Utilities-Python - test -r dependencies/CASE-Utilities-Python/README.md \ - || (git submodule init dependencies/CASE-Utilities-Python && git submodule update dependencies/CASE-Utilities-Python) - test -r dependencies/CASE-Utilities-Python/README.md \ - || (echo "ERROR:Makefile:CASE-Utilities-Python submodule README.md file not found, even though CASE-Utilities-Python submodule initialized." >&2 ; exit 2) # CASE-develop test -r dependencies/CASE-develop/README.md \ || (git submodule init dependencies/CASE-develop && git submodule update dependencies/CASE-develop) @@ -57,12 +52,6 @@ all: \ || (git submodule init dependencies/UCO-unstable && git submodule update dependencies/UCO-unstable) test -r dependencies/UCO-unstable/README.md \ || (echo "ERROR:Makefile:UCO-unstable submodule README.md file not found, even though UCO-unstable submodule initialized." >&2 ; exit 2) - # Retrieve rdf-toolkit.jar. - cd dependencies/CASE-Utilities-Python \ - && git submodule update --init dependencies/CASE - $(MAKE) \ - --directory dependencies/CASE-Utilities-Python/dependencies/CASE \ - .lib.done.log touch $@ # This virtual environment is meant to be built once and then persist, even through 'make clean'. @@ -102,10 +91,7 @@ all: \ wheel source venv/bin/activate \ && pip install \ - dependencies/CASE-Utilities-Python - source venv/bin/activate \ - && pip install \ - --requirement requirements.txt + --requirement requirements.txt touch $@ check: \ diff --git a/dependencies/CASE-Utilities-Python b/dependencies/CASE-Utilities-Python index 1521663a..33d95650 160000 --- a/dependencies/CASE-Utilities-Python +++ b/dependencies/CASE-Utilities-Python @@ -1 +1 @@ -Subproject commit 1521663a7019ccc97e2039899815337052e3b6f5 +Subproject commit 33d9565047549e7da2e359526164ee87410feb53 diff --git a/examples/illustrations/src/illustration-nosrc.mk b/examples/illustrations/src/illustration-nosrc.mk index 29130829..6000d4e1 100644 --- a/examples/illustrations/src/illustration-nosrc.mk +++ b/examples/illustrations/src/illustration-nosrc.mk @@ -23,8 +23,6 @@ SHELL := /bin/bash # The expected execution context is in any sibling directory of this Makefile's directory. top_srcdir := $(shell cd ../../.. ; pwd) -RDF_TOOLKIT_JAR := $(top_srcdir)/dependencies/CASE-Utilities-Python/dependencies/CASE/lib/rdf-toolkit.jar - example_name := $(shell basename $$PWD) # Use a drafting.ttl file in the validation and dependency list, if it is present. @@ -42,78 +40,54 @@ all: \ $(example_name)_validation.ttl: \ $(example_name).json \ - $(RDF_TOOLKIT_JAR) \ $(drafting_ttl) \ $(top_srcdir)/.venv.done.log - rm -f __$@ + rm -f _$@ source $(top_srcdir)/venv/bin/activate \ && case_validate \ --format turtle \ $(drafting_validation_flag) \ - --output __$@ \ + --output _$@ \ $< \ $(drafting_ttl) \ ; rc=$$? ; test 0 -eq $$rc -o 1 -eq $$rc - test -s __$@ - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ + test -s _$@ mv _$@ $@ $(example_name)_validation-develop.ttl: \ $(example_name).json \ - $(RDF_TOOLKIT_JAR) \ $(drafting_ttl) \ $(top_srcdir)/.venv.done.log \ $(top_srcdir)/dependencies/CASE-develop.ttl - rm -f __$@ + rm -f _$@ source $(top_srcdir)/venv/bin/activate \ && case_validate \ --built-version none \ --format turtle \ $(drafting_validation_flag) \ --ontology-graph $(top_srcdir)/dependencies/CASE-develop.ttl \ - --output __$@ \ + --output _$@ \ $< \ ; rc=$$? ; test 0 -eq $$rc -o 1 -eq $$rc - test -s __$@ - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ + test -s _$@ mv _$@ $@ $(example_name)_validation-unstable.ttl: \ $(example_name).json \ - $(RDF_TOOLKIT_JAR) \ $(drafting_ttl) \ $(top_srcdir)/.venv.done.log \ $(top_srcdir)/dependencies/CASE-unstable.ttl - rm -f __$@ + rm -f _$@ source $(top_srcdir)/venv/bin/activate \ && case_validate \ --built-version none \ --format turtle \ $(drafting_validation_flag) \ --ontology-graph $(top_srcdir)/dependencies/CASE-unstable.ttl \ - --output __$@ \ + --output _$@ \ $< \ ; rc=$$? ; test 0 -eq $$rc -o 1 -eq $$rc - test -s __$@ - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ + test -s _$@ mv _$@ $@ check: \ diff --git a/requirements.txt b/requirements.txt index e079f8a6..0706ce5c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ +case_utils >= 0.4.0, < 0.6.0 pytest