Skip to content

Commit

Permalink
Add and exercise SHACL constraints to review OWL 2 DL conformance
Browse files Browse the repository at this point in the history
A follow-on patch will refresh Make-managed files.

References:
* #406

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed Jul 23, 2022
1 parent e77020d commit 58f1fc6
Show file tree
Hide file tree
Showing 13 changed files with 670 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,67 @@ top_srcdir := $(shell cd .. ; pwd)

all: \
all-co \
all-owl \
all-uco

.PHONY: \
all-co \
all-owl \
all-uco \
check-co \
check-owl \
check-uco \
clean-co \
clean-owl \
clean-uco

all-co:
$(MAKE) \
--directory co

all-owl:
$(MAKE) \
--directory owl

all-uco:
$(MAKE) \
--directory uco

check: \
check-co \
check-owl \
check-uco

check-co:
$(MAKE) \
--directory co \
check

check-owl:
$(MAKE) \
--directory owl \
check

check-uco:
$(MAKE) \
--directory uco \
check

clean: \
clean-co \
clean-owl \
clean-uco

clean-co:
@$(MAKE) \
--directory co \
clean

clean-owl:
@$(MAKE) \
--directory owl \
clean

clean-uco:
@$(MAKE) \
--directory uco \
Expand Down
59 changes: 59 additions & 0 deletions ontology/owl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/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.

# This Makefile is adapted from /src/review.mk. It is expected to be
# short-lived, because at the time of this writing, there is a separate
# proposal revising the CI process to no longer use Make for Turtle
# normalization.
# TODO https://github.com/ucoProject/UCO/issues/373

SHELL := /bin/bash

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:ontology/owl/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/owl/ to get a file ready to commit to Git." >&2 ; exit 1)

clean:
@rm -f $(check_reference_basenames)

Loading

0 comments on commit 58f1fc6

Please sign in to comment.