From 7db2539359e96b4eec282ecd6ac49593c66e65ff Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 17 Jun 2024 15:47:50 -0400 Subject: [PATCH 1/4] Run pre-commit autoupdate No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 456abf6..f7977dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 - repo: https://github.com/pycqa/isort From f4f011ab71fbf3d149b933184c02fde53770e2b2 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 17 Jun 2024 17:17:43 -0400 Subject: [PATCH 2/4] Regenerate Make-managed files Signed-off-by: Alex Nelson --- shapes/catalog-v001.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shapes/catalog-v001.xml b/shapes/catalog-v001.xml index 6936bc2..2b67690 100644 --- a/shapes/catalog-v001.xml +++ b/shapes/catalog-v001.xml @@ -22,5 +22,5 @@ - + From 4ff898fc5945d570c177f309322a284f4be0c987 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 17 Jun 2024 15:54:14 -0400 Subject: [PATCH 3/4] Normalize Turtle with pre-commit hook No effects were observed on Make-managed files. Disclaimer: Participation by NIST in the creation of the documentation of mentioned software is not intended to imply a recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that any specific software is necessarily the best available for the purpose. Signed-off-by: Alex Nelson --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7977dd..0c82e1c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,3 +12,9 @@ repos: hooks: - id: isort name: isort (python) + - repo: https://github.com/casework/rdf-toolkit-action + rev: 2.0.3 + hooks: + - id: rdf-toolkit-normalizer + args: + - --autofix From 18f92be63d13448231177d30ac31c6b8482763ce Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 17 Jun 2024 15:56:54 -0400 Subject: [PATCH 4/4] Delegate Turtle normalization for ontology and shapes files to pre-commit hook No effects were observed on Make-managed files. Disclaimer: Participation by NIST in the creation of the documentation of mentioned software is not intended to imply a recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that any specific software is necessarily the best available for the purpose. Signed-off-by: Alex Nelson --- .gitignore | 1 - ontology/Makefile | 33 --------------------------------- shapes/Makefile | 33 --------------------------------- 3 files changed, 67 deletions(-) diff --git a/.gitignore b/.gitignore index 3249754..605534e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.jar *.swp .*.done.log -.check-*.ttl .venv-pre-commit __pycache__ venv diff --git a/ontology/Makefile b/ontology/Makefile index 261a613..cae85be 100644 --- a/ontology/Makefile +++ b/ontology/Makefile @@ -20,37 +20,11 @@ top_srcdir := $(shell cd .. ; pwd) uco_srcdir := $(top_srcdir)/dependencies/UCO -RDF_TOOLKIT_JAR := $(uco_srcdir)/lib/rdf-toolkit.jar - ttl_basenames := $(wildcard uco-*.ttl) -check_ttl_targets := $(foreach ttl_basename,$(ttl_basenames),check-$(ttl_basename)) - all: \ catalog-v001.xml -.PHONY: \ - check-%.ttl - -.PRECIOUS: \ - .check-%.ttl - -$(RDF_TOOLKIT_JAR): - @echo "DEBUG:ontology/Makefile:top_srcdir=$(top_srcdir)" >&2 - @echo "ERROR:ontology/Makefile:rdf-toolkit.jar not found. Did you run `make` from the top source directory?" >&2 - @test -r $@ - -.check-%.ttl: \ - %.ttl \ - $(RDF_TOOLKIT_JAR) - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source $< \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - mv _$@ $@ - catalog-v001.xml: \ $(top_srcdir)/.venv.done.log \ $(top_srcdir)/etc/domain_directories.tsv \ @@ -69,15 +43,8 @@ catalog-v001.xml: \ mv _$@ $@ check: \ - $(check_ttl_targets) \ catalog-v001.xml -check-%.ttl: \ - %.ttl \ - .check-%.ttl - diff $^ \ - || (echo "ERROR:ontology/Makefile:The local $< does not match the normalized version. If the above reported changes look fine, run 'cp .check-$< $<' while in the sub-folder ontology/ to get a file ready to commit to Git." >&2 ; exit 1) - clean: @rm -f \ _* \ diff --git a/shapes/Makefile b/shapes/Makefile index ed4546c..71e91ff 100644 --- a/shapes/Makefile +++ b/shapes/Makefile @@ -20,37 +20,11 @@ top_srcdir := $(shell cd .. ; pwd) uco_srcdir := $(top_srcdir)/dependencies/UCO -RDF_TOOLKIT_JAR := $(uco_srcdir)/lib/rdf-toolkit.jar - ttl_basenames := $(wildcard sh-*.ttl) -check_ttl_targets := $(foreach ttl_basename,$(ttl_basenames),check-$(ttl_basename)) - all: \ catalog-v001.xml -.PHONY: \ - check-%.ttl - -.PRECIOUS: \ - .check-%.ttl - -$(RDF_TOOLKIT_JAR): - @echo "DEBUG:shapes/Makefile:top_srcdir=$(top_srcdir)" >&2 - @echo "ERROR:shapes/Makefile:rdf-toolkit.jar not found. Did you run `make` from the top source directory?" >&2 - @test -r $@ - -.check-%.ttl: \ - %.ttl \ - $(RDF_TOOLKIT_JAR) - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source $< \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - mv _$@ $@ - catalog-v001.xml: \ $(top_srcdir)/.venv.done.log \ $(top_srcdir)/etc/domain_directories.tsv \ @@ -69,15 +43,8 @@ catalog-v001.xml: \ mv _$@ $@ check: \ - $(check_ttl_targets) \ catalog-v001.xml -check-%.ttl: \ - %.ttl \ - .check-%.ttl - diff $^ \ - || (echo "ERROR:shapes/Makefile:The local $< does not match the normalized version. If the above reported changes look fine, run 'cp .check-$< $<' while in the sub-folder shapes/ to get a file ready to commit to Git." >&2 ; exit 1) - clean: @rm -f \ _* \