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/.pre-commit-config.yaml b/.pre-commit-config.yaml index 456abf6..0c82e1c 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 @@ -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 diff --git a/dependencies/CDO-Shapes-gufo b/dependencies/CDO-Shapes-gufo index 3cde0e8..b61c058 160000 --- a/dependencies/CDO-Shapes-gufo +++ b/dependencies/CDO-Shapes-gufo @@ -1 +1 @@ -Subproject commit 3cde0e8cbf1fcc682ee99b1567815d9c3c973771 +Subproject commit b61c0583d33f81fc66aa20e9c87e86b551625902 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 e6360e7..dcc2b36 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 \ _* \ diff --git a/tests/exemplars.ttl b/tests/exemplars.ttl index 2030a9f..e064329 100644 --- a/tests/exemplars.ttl +++ b/tests/exemplars.ttl @@ -24,16 +24,21 @@ kb:Action-13c91d40-9ca0-4558-81a1-4f7db888c371 a uco-action:Action ; - uco-action:endTime "2021-02-03T04:05:06Z"^^xsd:dateTime ; - uco-action:startTime "2020-01-02T03:04:05Z"^^xsd:dateTime ; gufo:hasBeginPointInXSDDateTimeStamp "2020-01-02T03:04:05Z"^^xsd:dateTimeStamp ; gufo:hasEndPointInXSDDateTimeStamp "2021-02-03T04:05:06Z"^^xsd:dateTimeStamp ; + uco-action:endTime "2021-02-03T04:05:06Z"^^xsd:dateTime ; + uco-action:startTime "2020-01-02T03:04:05Z"^^xsd:dateTime ; . kb:AnalyticResult-34fb92db-d576-45a7-9d62-dae04510968f a uco-analysis:AnalyticResult ; . +kb:Bearing-74c2bb20-1e4f-40ac-807e-bc2c528e39da + a drafting:Bearing ; + gufo:inheresIn kb:Vehicle-c7e910e8-4bed-473e-ad74-3df3eb63cbcc ; + . + kb:BluetoothAddress-53c6bc31-4f9c-4ca7-96cb-c9c61d7e4ca2 a uco-observable:BluetoothAddress ; uco-core:hasFacet @@ -42,11 +47,6 @@ kb:BluetoothAddress-53c6bc31-4f9c-4ca7-96cb-c9c61d7e4ca2 ; . -kb:Bearing-74c2bb20-1e4f-40ac-807e-bc2c528e39da - a drafting:Bearing ; - gufo:inheresIn kb:Vehicle-c7e910e8-4bed-473e-ad74-3df3eb63cbcc ; - . - kb:BluetoothAddressFacet-717b8cce-e9c2-4d59-81e4-1747d7e2d8ee a uco-observable:BluetoothAddressFacet ; . @@ -70,10 +70,10 @@ kb:DeploymentScript-6a4ce3a2-afbe-4680-9609-3b68af8965ff kb:Event-03a1a1db-0579-4427-9a51-448c32281146 a uco-core:Event ; - uco-core:endTime "2011-02-03T04:05:06Z"^^xsd:dateTime ; - uco-core:startTime "2010-01-02T03:04:05Z"^^xsd:dateTime ; gufo:hasBeginPointInXSDDateTimeStamp "2010-01-02T03:04:05Z"^^xsd:dateTimeStamp ; gufo:hasEndPointInXSDDateTimeStamp "2011-02-03T04:05:06Z"^^xsd:dateTimeStamp ; + uco-core:endTime "2011-02-03T04:05:06Z"^^xsd:dateTime ; + uco-core:startTime "2010-01-02T03:04:05Z"^^xsd:dateTime ; . kb:Hash-4c3d0623-d365-4c69-a1a1-01523c6502fa @@ -155,11 +155,6 @@ kb:SoftwareBuild-35bf4562-2539-4c7f-a4f5-95865c6f81fa a drafting:SoftwareBuild ; . -kb:Velocity-62bc6232-b570-45d7-b382-d4e0a36fceb9 - a drafting:Velocity ; - gufo:inheresIn kb:Vehicle-c7e910e8-4bed-473e-ad74-3df3eb63cbcc ; - . - kb:Vehicle-c7e910e8-4bed-473e-ad74-3df3eb63cbcc a drafting:Vehicle ; gufo:standsInQualifiedAttribution @@ -168,6 +163,11 @@ kb:Vehicle-c7e910e8-4bed-473e-ad74-3df3eb63cbcc ; . +kb:Velocity-62bc6232-b570-45d7-b382-d4e0a36fceb9 + a drafting:Velocity ; + gufo:inheresIn kb:Vehicle-c7e910e8-4bed-473e-ad74-3df3eb63cbcc ; + . + kb:WindowsTask-1148ebc4-750b-43f8-a17d-6ba239f62ae7 a uco-observable:WindowsTask ; .