From 5bd46d2b6ceef78ea962197dce78bcfbc3ca0bb6 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 23 May 2022 12:48:18 -0400 Subject: [PATCH 1/9] Move Turtle normalization logic to pre-commit The repository version noted in this commit does not currently catch subdirectories' Turtle files, so a follow-on patch will update the repository pointer. References: * https://github.com/ucoProject/UCO/issues/373 --- .gitignore | 2 +- .pre-commit-config.yaml | 7 +++++ Makefile | 35 +++++++++++++++++++----- lib/Makefile | 46 ------------------------------- lib/rdf-toolkit.jar.sha512 | 1 - ontology/Makefile | 55 -------------------------------------- src/review.mk | 54 ------------------------------------- tests/Makefile | 14 +++------- tests/examples/Makefile | 9 +------ 9 files changed, 40 insertions(+), 183 deletions(-) create mode 100644 .pre-commit-config.yaml delete mode 100644 lib/Makefile delete mode 100644 lib/rdf-toolkit.jar.sha512 delete mode 100644 ontology/Makefile delete mode 100644 src/review.mk diff --git a/.gitignore b/.gitignore index d8d84865..1f83378e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.jar .*.ttl .git_submodule_init.done.log -.lib.done.log +.venv-pre-commit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..9a2128c3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +repos: +- repo: https://github.com/kchason/rdf-toolkit-action + rev: v0.1.0 + hooks: + - id: rdf-toolkit-normalizer + args: + - --autofix diff --git a/Makefile b/Makefile index d101ee70..16498e85 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,10 @@ SHELL := /bin/bash +PYTHON3 ?= python3 + all: \ - .lib.done.log - $(MAKE) \ - --directory ontology + .venv-pre-commit/var/.pre-commit-built.log # This recipe guarantees that 'git submodule init' and 'git submodule update' have run at least once. # The recipe avoids running 'git submodule update' more than once, in case a user is testing with the submodule at a different commit than what UCO tracks. @@ -34,13 +34,34 @@ all: \ --directory lib touch $@ +# This virtual environment is meant to be built once and then persist, even through 'make clean'. +# If a recipe is written to remove this flag file, it should first run `pre-commit uninstall`. +.venv-pre-commit/var/.pre-commit-built.log: + rm -rf .venv-pre-commit + test -r .pre-commit-config.yaml \ + || (echo "ERROR:Makefile:pre-commit is expected to install for this repository, but .pre-commit-config.yaml does not seem to exist." >&2 ; exit 1) + $(PYTHON3) -m venv \ + .venv-pre-commit + source .venv-pre-commit/bin/activate \ + && pip install \ + --upgrade \ + pip \ + setuptools \ + wheel + source .venv-pre-commit/bin/activate \ + && pip install \ + pre-commit + source .venv-pre-commit/bin/activate \ + && pre-commit install + mkdir -p \ + .venv-pre-commit/var + touch $@ + check: \ .git_submodule_init.done.log \ - .lib.done.log - $(MAKE) \ - --directory ontology \ - check + .venv-pre-commit/var/.pre-commit-built.log $(MAKE) \ + PYTHON3=$(PYTHON3) \ --directory tests \ check diff --git a/lib/Makefile b/lib/Makefile deleted file mode 100644 index b65d1ff7..00000000 --- a/lib/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/make -f - -# This software was developed at the National Institute of Standards -# and Technology by employees of the Federal Government in the course -# of their official duties. Pursuant to title 17 Section 105 of the -# United States Code this software is not subject to copyright -# protection and is in the public domain. NIST assumes no -# responsibility whatsoever for its use by other parties, and makes -# no guarantees, expressed or implied, about its quality, -# reliability, or any other characteristic. -# -# We would appreciate acknowledgement if the software is used. - -SHELL := /bin/bash - -all: \ - rdf-toolkit.jar - -# Downloading rdf-toolkit was previously done following the directions -# at: -# https://github.com/edmcouncil/rdf-toolkit -# However, on the file becoming temporarily unavailable, CASE has placed -# a verified copy at a custom location, as a fallback for an alternative -# retrieval from an EDM Council member's repository. -# The checksum of the original file from EDM Council's build server is -# confirmed before moving file into position. (This practice will -# probably require frequent updates, unless a signed checksum for the -# jar can be retrieved somehow.) -# In case there are concerns on potentially multiple writes to the same -# file, the documentation for wget's "--output-document file" flag notes -# that "... file will be truncated immediately, and all downloaded -# content will be written there." -rdf-toolkit.jar: - test -r rdf-toolkit.jar.sha512 - # Try retrieval from Github, then from files.caseontology.org. - wget \ - --output-document $@_ \ - https://github.com/trypuz/openfibo/blob/1f9ab415e8ebd131eadcc9b0fc46241adeeb0384/etc/serialization/rdf-toolkit.jar?raw=true \ - || wget \ - --output-document $@_ \ - http://files.caseontology.org/rdf-toolkit.jar - test \ - "x$$(openssl dgst -sha512 $@_ | awk '{print($$NF)}')" \ - == \ - "x$$(head -n1 rdf-toolkit.jar.sha512)" - mv $@_ $@ diff --git a/lib/rdf-toolkit.jar.sha512 b/lib/rdf-toolkit.jar.sha512 deleted file mode 100644 index 4c4f5e0d..00000000 --- a/lib/rdf-toolkit.jar.sha512 +++ /dev/null @@ -1 +0,0 @@ -24890b4aa484a46803841fbe5938daf60bf2d0889c0e231102c033d71cb84a2bfa8b44419df3ad896d833609afddd4b3910d2ce28660b3350cca22bea0770dad diff --git a/ontology/Makefile b/ontology/Makefile deleted file mode 100644 index 313b1de4..00000000 --- a/ontology/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/make -f - -# This software was developed at the National Institute of Standards -# and Technology by employees of the Federal Government in the course -# of their official duties. Pursuant to title 17 Section 105 of the -# United States Code this software is not subject to copyright -# protection and is in the public domain. NIST assumes no -# responsibility whatsoever for its use by other parties, and makes -# no guarantees, expressed or implied, about its quality, -# reliability, or any other characteristic. -# -# We would appreciate acknowledgement if the software is used. - -SHELL := /bin/bash - -top_srcdir := $(shell cd .. ; pwd) - -turtle_directories := $(shell find * -type d -maxdepth 0 | sort) - -all_directories := $(foreach turtle_directory,$(turtle_directories),all-$(turtle_directory)) - -check_directories := $(foreach turtle_directory,$(turtle_directories),check-$(turtle_directory)) - -clean_directories := $(foreach turtle_directory,$(turtle_directories),clean-$(turtle_directory)) - -all: \ - $(all_directories) - -all-%: \ - % \ - $(top_srcdir)/.lib.done.log - $(MAKE) \ - --directory $< \ - --file $(top_srcdir)/src/review.mk - -check: \ - $(check_directories) - -check-%: \ - % \ - $(top_srcdir)/.lib.done.log - $(MAKE) \ - --directory $< \ - --file $(top_srcdir)/src/review.mk \ - check - -clean: \ - $(clean_directories) - -clean-%: \ - % - @$(MAKE) \ - --directory $< \ - --file $(top_srcdir)/src/review.mk \ - clean diff --git a/src/review.mk b/src/review.mk deleted file mode 100644 index 0b5c94c6..00000000 --- a/src/review.mk +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/make -f - -# This software was developed at the National Institute of Standards -# and Technology by employees of the Federal Government in the course -# of their official duties. Pursuant to title 17 Section 105 of the -# United States Code this software is not subject to copyright -# protection and is in the public domain. NIST assumes no -# responsibility whatsoever for its use by other parties, and makes -# no guarantees, expressed or implied, about its quality, -# reliability, or any other characteristic. -# -# We would appreciate acknowledgement if the software is used. - -SHELL := /bin/bash - -# This Makefile is assumed to execute in a repository directory ontology/*. - -top_srcdir := $(shell cd ../.. ; pwd) - -ttl_basenames := $(shell find *.ttl -type f | sort) - -# These are reference files, named with a leading dot. -check_reference_basenames := $(foreach ttl_basename,$(ttl_basenames),.check-$(ttl_basename)) - -# These are recipe targets, not intended to be created files. -check_targets := $(foreach ttl_basename,$(ttl_basenames),check-$(ttl_basename)) - -all: \ - $(check_reference_basenames) - -.check-%.ttl: \ - %.ttl \ - $(top_srcdir)/.lib.done.log - java -jar $(top_srcdir)/lib/rdf-toolkit.jar \ - --inline-blank-nodes \ - --source $< \ - --source-format turtle \ - --target $@_ \ - --target-format turtle - mv $@_ $@ - -check: \ - $(check_targets) - -# Reminder: diff exits non-0 on finding any differences. -# Reminder: The $^ automatic Make variable is the name of all recipe prerequisites. -check-%.ttl: \ - %.ttl \ - .check-%.ttl - diff $^ \ - || (echo "ERROR:src/review.mk:The local $< does not match the normalized version. If the above reported changes look fine, run 'cp .check-$< $<' while in the sub-folder ontology/$$(basename $< .ttl)/ to get a file ready to commit to Git." >&2 ; exit 1) - -clean: - @rm -f $(check_reference_basenames) diff --git a/tests/Makefile b/tests/Makefile index 1dd12782..0783027b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -15,7 +15,7 @@ SHELL := /bin/bash top_srcdir := $(shell cd .. ; pwd) -PYTHON3 ?= $(shell which python3.9 2>/dev/null || which python3.8 2>/dev/null || which python3.7 2>/dev/null || which python3.6 2>/dev/null || which python3) +PYTHON3 ?= python3 uco_turtle_files := $(shell /bin/ls $(top_srcdir)/ontology/*/*.ttl) @@ -78,19 +78,11 @@ inheritance_review.ttl: \ mv _$@ $@ uco_monolithic.ttl: \ - $(top_srcdir)/.lib.done.log \ $(uco_turtle_files) \ .venv.done.log \ src/glom_graph.py source venv/bin/activate \ - && python3 src/glom_graph.py \ - __$@ \ + && $(PYTHON3) src/glom_graph.py \ + _$@ \ $(uco_turtle_files) - java -jar $(top_srcdir)/lib/rdf-toolkit.jar \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ mv _$@ $@ diff --git a/tests/examples/Makefile b/tests/examples/Makefile index fd0a86df..ccbe1119 100644 --- a/tests/examples/Makefile +++ b/tests/examples/Makefile @@ -54,16 +54,9 @@ all: \ --ont-graph $(tests_srcdir)/uco_monolithic.ttl \ --shacl $(tests_srcdir)/uco_monolithic.ttl \ --shacl-file-format turtle \ - --output __$@ \ + --output _$@ \ $< \ ; rc=$$? ; test 0 -eq $$rc -o 1 -eq $$rc - java -jar $(top_srcdir)/lib/rdf-toolkit.jar \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ mv _$@ $@ check: \ From 4263959a04baec471854649b63735f3e521269ab Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 20:50:40 -0400 Subject: [PATCH 2/9] Bump rdf-toolkit-action version --- .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 9a2128c3..713f34c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/kchason/rdf-toolkit-action - rev: v0.1.0 + rev: 0.1.1 hooks: - id: rdf-toolkit-normalizer args: From dcd40aa5c51253b88b66ae737b9d80868aa557fe Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 20:55:54 -0400 Subject: [PATCH 3/9] Add pre-commit to UCO CI References: * https://github.com/casework/CASE-Utilities-Python/pull/37 * https://github.com/ucoProject/UCO/issues/373 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 379d3575..b701a1d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Pre-commit Checks + run: | + pip -q install pre-commit + pre-commit run --all-files - name: Start from clean state run: make clean - name: Run tests From e2dddab0c776f5353a49091864af6d49e7e8cee4 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 21:45:42 -0400 Subject: [PATCH 4/9] Bump rdf-toolkit-action pointer for base IRI flag fix --- .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 713f34c1..7a3aa248 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/kchason/rdf-toolkit-action - rev: 0.1.1 + rev: 0.1.2 hooks: - id: rdf-toolkit-normalizer args: From 2be4d52232fb0bbd7049bd340aff9b4fb021ba2a Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 21:52:11 -0400 Subject: [PATCH 5/9] Remove obviated Makefile recipe Signed-off-by: Alex Nelson --- Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 16498e85..76c2c3cb 100644 --- a/Makefile +++ b/Makefile @@ -66,17 +66,11 @@ check: \ check clean: \ - clean-tests \ - clean-ontology + clean-tests @rm -f \ .git_submodule_init.done.log \ .lib.done.log -clean-ontology: - @$(MAKE) \ - --directory ontology \ - clean - clean-tests: @$(MAKE) \ --directory tests \ From 2b15709ff1713f64d3487d0c34078e4b63504f9b Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 22:03:57 -0400 Subject: [PATCH 6/9] Update to setup-java version 3; transition from 'adopt' to 'temurin' The landing page for the setup-java action states the following: > NOTE: Adopt OpenJDK got moved to Eclipse Temurin and won't be updated > anymore. It is highly recommended to migrate workflows from adopt to > temurin to keep receiving software and security updates. See more > details in the Good-bye AdoptOpenJDK post. References: * https://github.com/actions/setup-java/#supported-distributions * https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/ Signed-off-by: Alex Nelson --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b701a1d9..b1b4556d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: - distribution: 'adopt' + distribution: 'temurin' java-version: '8' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 From 282468fc828995f2109d27d5e03d78f371779c1e Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 22:06:06 -0400 Subject: [PATCH 7/9] Transition from Java 8 to 11 With the current version of `rdf-toolkit-action`, this is expected to cause a CI failure due to an `rdf-toolkit.jar` incompatibility. A release coming soon for `rdf-toolkit-action` will update the `.jar` file used. Signed-off-by: Alex Nelson --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1b4556d..ea47ec49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: '8' + java-version: '11' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: From 4efc2a03d83f25ee3a4e94f2e7ccc5aaa7f494ff Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Sat, 28 May 2022 11:46:00 -0400 Subject: [PATCH 8/9] Bump rdf-toolkit-action to use newer jar 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 7a3aa248..080d0272 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/kchason/rdf-toolkit-action - rev: 0.1.2 + rev: 0.2.0 hooks: - id: rdf-toolkit-normalizer args: From ab0aff871f772814131a59398e8a081204f7d666 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Sat, 28 May 2022 11:57:53 -0400 Subject: [PATCH 9/9] Normalize RDF lists in observable.ttl The version of rdf-toolkit run by the pre-commit hook now handles an RDF list differently than the prior version of rdf-toolkit. This commit is a mechanically-produced result. References: * https://github.com/ucoProject/UCO/issues/373 Signed-off-by: Alex Nelson --- ontology/observable/observable.ttl | 374 +++++++---------------------- 1 file changed, 86 insertions(+), 288 deletions(-) diff --git a/ontology/observable/observable.ttl b/ontology/observable/observable.ttl index 9d141ecd..53bdde3b 100644 --- a/ontology/observable/observable.ttl +++ b/ontology/observable/observable.ttl @@ -4473,39 +4473,16 @@ observable:NetworkSocketAddressFamily a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "af_appletalk" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_bth" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_inet" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_inet6" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_ipx" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_irda" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_netbios" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_unspec" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "af_appletalk" + "af_bth" + "af_inet" + "af_inet6" + "af_ipx" + "af_irda" + "af_netbios" + "af_unspec" + ) ; ] ; . @@ -4513,107 +4490,33 @@ observable:NetworkSocketProtocolFamily a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "pf_appletalk" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_ash" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_atmpvc" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_atmsvc" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_ax25" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_bluetooth" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_bridge" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_decnet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_econet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_inet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_inet6" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_ipx" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_irda" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_key" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_netbeui" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_netlink" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_netrom" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_packet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_pppox" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_rose" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_route" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_security" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_sna" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_wanpipe" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_x25" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "pf_appletalk" + "pf_ash" + "pf_atmpvc" + "pf_atmsvc" + "pf_ax25" + "pf_bluetooth" + "pf_bridge" + "pf_decnet" + "pf_econet" + "pf_inet" + "pf_inet6" + "pf_ipx" + "pf_irda" + "pf_key" + "pf_netbeui" + "pf_netlink" + "pf_netrom" + "pf_packet" + "pf_pppox" + "pf_rose" + "pf_route" + "pf_security" + "pf_sna" + "pf_wanpipe" + "pf_x25" + ) ; ] ; . @@ -4621,27 +4524,13 @@ observable:NetworkSocketType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "sock_dgram" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_raw" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_rdm" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_seqpacket" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_stream" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "sock_dgram" + "sock_raw" + "sock_rdm" + "sock_seqpacket" + "sock_stream" + ) ; ] ; . @@ -5364,59 +5253,21 @@ observable:RegistryDatatype a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "reg_binary" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_dword" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_dword_big_endian" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_expand_sz" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_full_resource_descriptor" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_invalid_type" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_link" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_multi_sz" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_none" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_qword" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_resource_list" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_resource_requirements_list" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_sz" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "reg_binary" + "reg_dword" + "reg_dword_big_endian" + "reg_expand_sz" + "reg_full_resource_descriptor" + "reg_invalid_type" + "reg_link" + "reg_multi_sz" + "reg_none" + "reg_qword" + "reg_resource_list" + "reg_resource_requirements_list" + "reg_sz" + ) ; ] ; . @@ -7377,19 +7228,11 @@ observable:WindowsPEBinaryType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "dll" ; - rdf:rest [ - a rdf:List ; - rdf:first "exe" ; - rdf:rest [ - a rdf:List ; - rdf:first "sys" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; + owl:oneOf ( + "dll" + "exe" + "sys" + ) ; ] ; . @@ -7921,27 +7764,13 @@ observable:WindowsServiceStartType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "service_auto_start" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_boot_start" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_demand_start" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_disabled" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_system_alert" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "service_auto_start" + "service_boot_start" + "service_demand_start" + "service_disabled" + "service_system_alert" + ) ; ] ; . @@ -7949,35 +7778,15 @@ observable:WindowsServiceStatus a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "service_continue_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_pause_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_paused" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_running" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_start_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_stop_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_stopped" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "service_continue_pending" + "service_pause_pending" + "service_paused" + "service_running" + "service_start_pending" + "service_stop_pending" + "service_stopped" + ) ; ] ; . @@ -7985,23 +7794,12 @@ observable:WindowsServiceType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "service_file_system_driver" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_kernel_driver" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_win32_own_process" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_win32_share_process" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "service_file_system_driver" + "service_kernel_driver" + "service_win32_own_process" + "service_win32_share_process" + ) ; ] ; .