Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -38,6 +40,7 @@ all: \
check-supply-chain-submodules \
check-tests \
clean-dependencies \
clean-examples \
clean-ontology \
clean-shapes \
clean-tests
Expand Down Expand Up @@ -112,6 +115,11 @@ all-dependencies: \
PYTHON3=$(PYTHON3) \
--directory dependencies

all-examples: \
all-tests
$(MAKE) \
--directory examples

all-ontology: \
all-dependencies
$(MAKE) \
Expand All @@ -130,14 +138,21 @@ all-tests: \
check: \
.venv-pre-commit/var/.pre-commit-built.log \
check-mypy \
check-tests
check-examples

check-dependencies: \
all-dependencies
$(MAKE) \
--directory dependencies \
check

check-examples: \
all-examples \
check-tests
$(MAKE) \
--directory examples \
check

check-mypy: \
.venv.done.log
source venv/bin/activate \
Expand Down Expand Up @@ -234,6 +249,7 @@ check-tests: \
check

clean: \
clean-examples \
clean-tests \
clean-shapes \
clean-ontology \
Expand All @@ -246,6 +262,11 @@ clean-dependencies:
--directory dependencies \
clean

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

clean-ontology:
@$(MAKE) \
--directory ontology \
Expand Down
53 changes: 53 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions examples/sh-qc.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@prefix drafting: <http://example.org/ontology/drafting/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix sh-qc: <http://example.org/shapes/sh-qc/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/shapes/sh-qc>
a owl:Ontology ;
rdfs:comment "Shapes in this graph are scoped to quality control for illustrative example data graphs."@en ;
.