From c85782f7d8e57e34df3bcf775a775f95b02bfaa4 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Thu, 10 Sep 2026 15:36:16 -0400 Subject: [PATCH 1/2] Add examples directory Signed-off-by: Alex Nelson --- Makefile | 25 ++++++++++++++++++++-- examples/Makefile | 52 ++++++++++++++++++++++++++++++++++++++++++++++ examples/sh-qc.ttl | 14 +++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 examples/Makefile create mode 100644 examples/sh-qc.ttl diff --git a/Makefile b/Makefile index c7b5363..5f2cc7b 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,16 @@ PYTHON3 ?= python3 all: \ .venv-pre-commit/var/.pre-commit-built.log \ all-shapes \ - all-tests + all-examples .PHONY: \ all-dependencies \ + all-examples \ all-ontology \ all-shapes \ all-tests \ check-dependencies \ + check-examples \ check-mypy \ check-ontology \ check-shapes \ @@ -38,6 +40,7 @@ all: \ check-supply-chain-submodules \ check-tests \ clean-dependencies \ + clean-examples \ clean-ontology \ clean-shapes \ clean-tests @@ -106,6 +109,11 @@ all-dependencies: \ PYTHON3=$(PYTHON3) \ --directory dependencies +all-examples: \ + all-tests + $(MAKE) \ + --directory examples + all-ontology: \ all-dependencies $(MAKE) \ @@ -124,7 +132,7 @@ all-tests: \ check: \ .venv-pre-commit/var/.pre-commit-built.log \ check-mypy \ - check-tests + check-examples check-dependencies: \ all-dependencies @@ -132,6 +140,13 @@ check-dependencies: \ --directory dependencies \ check +check-examples: \ + all-examples \ + check-tests + $(MAKE) \ + --directory examples \ + check + check-mypy: \ .venv.done.log source venv/bin/activate \ @@ -228,6 +243,7 @@ check-tests: \ check clean: \ + clean-examples \ clean-tests \ clean-shapes \ clean-ontology \ @@ -240,6 +256,11 @@ clean-dependencies: --directory dependencies \ clean +clean-examples: + @$(MAKE) \ + --directory examples \ + clean + clean-ontology: @$(MAKE) \ --directory ontology \ diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..68057da --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,52 @@ +#!/usr/bin/make -f + +# Portions of this file contributed by NIST are governed by the +# following statement: +# +# 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 within the United States. 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) + +example_ttls := $(wildcard example-*.ttl) + +validation_done_logs := $(foreach example_ttl,$(example_ttls),.$(example_ttl).validation.done.log) + +all: + +.example-%.validation.done.log: \ + example-% \ + $(top_srcdir)/.venv.done.log \ + $(top_srcdir)/ontology/generated-ontology.ttl \ + $(top_srcdir)/shapes/generated-shapes.ttl \ + sh-qc.ttl + source $(top_srcdir)/venv/bin/activate \ + && pyshacl \ + --inference none \ + --ont-graph $(top_srcdir)/ontology/generated-ontology.ttl \ + --shacl sh-qc.ttl \ + $< + source $(top_srcdir)/venv/bin/activate \ + && pyshacl \ + --inference none \ + --ont-graph $(top_srcdir)/ontology/generated-ontology.ttl \ + --shacl $(top_srcdir)/shapes/generated-shapes.ttl \ + $< + touch $@ + +check: \ + $(validation_done_logs) + +clean: + @rm -f \ + .*.done.log diff --git a/examples/sh-qc.ttl b/examples/sh-qc.ttl new file mode 100644 index 0000000..68d5a80 --- /dev/null +++ b/examples/sh-qc.ttl @@ -0,0 +1,14 @@ +@prefix drafting: . +@prefix obo: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sh-qc: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:comment "Shapes in this graph are scoped to quality control for illustrative example data graphs."@en ; + . + From f600e0997f991bb2ae7a4c46c1403c9a67246e89 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 11 Sep 2026 09:55:20 -0400 Subject: [PATCH 2/2] Check QC shapes Signed-off-by: Alex Nelson --- examples/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Makefile b/examples/Makefile index 68057da..ecc2061 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -33,6 +33,7 @@ all: source $(top_srcdir)/venv/bin/activate \ && pyshacl \ --inference none \ + --metashacl \ --ont-graph $(top_srcdir)/ontology/generated-ontology.ttl \ --shacl sh-qc.ttl \ $<