diff --git a/Makefile b/Makefile index 3d535a8..b70670b 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 @@ -112,6 +115,11 @@ all-dependencies: \ PYTHON3=$(PYTHON3) \ --directory dependencies +all-examples: \ + all-tests + $(MAKE) \ + --directory examples + all-ontology: \ all-dependencies $(MAKE) \ @@ -130,7 +138,7 @@ all-tests: \ check: \ .venv-pre-commit/var/.pre-commit-built.log \ check-mypy \ - check-tests + check-examples check-dependencies: \ all-dependencies @@ -138,6 +146,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 \ @@ -234,6 +249,7 @@ check-tests: \ check clean: \ + clean-examples \ clean-tests \ clean-shapes \ clean-ontology \ @@ -246,6 +262,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..ecc2061 --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,53 @@ +#!/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 \ + --metashacl \ + --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..5b55342 --- /dev/null +++ b/examples/sh-qc.ttl @@ -0,0 +1,13 @@ +@prefix drafting: . +@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 ; + . +