Skip to content

Commit

Permalink
Reorganize to versioned, multiple schemas
Browse files Browse the repository at this point in the history
Closes #42
  • Loading branch information
mih committed Mar 29, 2024
1 parent eb9ab69 commit 97499df
Show file tree
Hide file tree
Showing 102 changed files with 78 additions and 96 deletions.
64 changes: 23 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,23 @@ endif
try:
${FAILIF_STDERR} bash -c 'exit 12'

all: mkdocs-site build/context.jsonld

build/context.jsonld: src/linkml/schemas/ontology.yaml
mkdir -p build
gen-jsonld-context \
--prefixes \
--model \
--mergeimports \
$< > $@
all: build/mkdocs-site

build/linkml-docs: \
build/linkml-docs/data-distribution \
build/linkml-docs/derived-example \
build/linkml-docs/dataset-version \
build/linkml-docs/ontology
build/linkml-docs/%: src/linkml/schemas/%.yaml src/extra-docs/%-schema
export OUTDIR=$$([ "$*" = "ontology" ] && echo $@ || echo build/linkml-docs/schemas/$*) && \
build/linkml-docs/s/distribution/unreleased
# build/linkml-docs/derived-example/unreleased
build/linkml-docs/s/%: src/%.yaml src/%/extra-docs
gen-doc \
--hierarchical-class-view \
--include-top-level-diagram \
--diagram-type er_diagram \
--metadata \
--format markdown \
--example-directory src/examples/$* \
-d $$OUTDIR \
--example-directory src/$*/examples/ \
-d $@ \
$< \
&& (cp -r src/extra-docs/$*-schema/*.md $$OUTDIR || true) \
&& cp $< $${OUTDIR}.yaml
&& (cp -r src/$*/extra-docs/*.md $@ || true) \
&& cp $< $@.yaml
# try to inject any extra-docs (if any exist)

build/mkdocs-site: build/linkml-docs src/extra-docs/*.md
Expand All @@ -50,11 +39,9 @@ check: check-models check-validation

# add additional schemas to lint here
check-models: \
check-model-data-distribution \
check-model-derived-example \
check-model-dataset-version \
check-model-ontology
check-model-%: src/linkml/schemas/%.yaml
checkmodel/distribution/unreleased
# check-model-derived-example-unreleased
checkmodel/%: src/%.yaml
@echo [Check $<]
@echo "Run linter"
@linkml-lint \
Expand All @@ -80,32 +67,27 @@ check-model-%: src/linkml/schemas/%.yaml
# respective validation targets, because some tests rely on these
# converted formats
check-validation: \
convert-examples-data-distribution \
check-validation-data-distribution \
convert-examples-derived-example \
check-validation-derived-example \
convert-examples-dataset-version \
check-validation-dataset-version \
convert-examples-ontology
check-validation-%:
$(MAKE) check-valid-validation-$* check-invalid-validation-$*
check-valid-validation-%: tests/%-schema/validation src/linkml/schemas/%.yaml
convertexamples/distribution/unreleased \
checkvalidation/distribution/unreleased
# convert-examples-derived-example-unreleased \
# check-validation-derived-example-unreleased
checkvalidation/%:
$(MAKE) checkvalid/$* checkinvalid/$*
checkvalid/%: src/%/validation src/%.yaml
@for ex in $</*.valid.cfg.yaml; do \
echo "Validate $$ex" ; \
linkml-validate --config "$$ex" || exit 5 ; \
done
check-invalid-validation-%: tests/%-schema/validation src/linkml/schemas/%.yaml
checkinvalid/%: src/%/validation src/%.yaml
@for ex in $</*.invalid.cfg.yaml; do \
echo "(In)validate $$ex" ; \
linkml-validate --config "$$ex" && exit 5 || true; \
done

convert-examples: \
convert-examples-data-distribution \
convert-examples-derived-example \
convert-examples-dataset-version \
convert-examples-ontology
convert-examples-%: src/linkml/schemas/%.yaml src/examples/%
convertexamples/distribution/unreleased
# convert-examples-derived-example-unreleased
convertexamples/%: src/%.yaml src/%/examples
# loop over all examples, skip the schema file itself
for ex in $^/*.yaml; do \
[ "$$ex" = "$<" ] && continue; \
Expand Down Expand Up @@ -133,4 +115,4 @@ clean:
rm -rf build
rm -f *-stamp

.PHONY: clean check check-models check-examples convert-examples
.PHONY: clean check check-models check-validation convert-examples
File renamed without changes.
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema: src/linkml/schemas/data-distribution.yaml
schema: src/distribution/unreleased.yaml
target_class: AgentInfluence
data_sources:
- src/examples/data-distribution/AgentInfluence-std.yaml
- src/distribution/unreleased/examples/AgentInfluence-std.yaml
plugins:
JsonschemaValidationPlugin:
closed: true
Expand Down
18 changes: 18 additions & 0 deletions src/distribution/unreleased/validation/Distribution.valid.cfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
schema: src/distribution/unreleased.yaml
target_class: Distribution
data_sources:
- src/distribution/unreleased/examples/Distribution-basic.yaml
- src/distribution/unreleased/examples/Distribution-customlicense.yaml
- src/distribution/unreleased/examples/Distribution-resource.yaml
- src/distribution/unreleased/examples/Distribution-parts.yaml
- src/distribution/unreleased/examples/Distribution-formats.yaml
- src/distribution/unreleased/examples/Distribution-datatypes.yaml
- src/distribution/unreleased/examples/Distribution-annexkey.yaml
- src/distribution/unreleased/examples/Distribution-gitblob.yaml
- src/distribution/unreleased/examples/Distribution-gittree.yaml
- src/distribution/unreleased/examples/Distribution-penguins.yaml
plugins:
JsonschemaValidationPlugin:
closed: true
include_range_class_descendants: false
RecommendedSlotsPlugin:
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema: src/linkml/schemas/data-distribution.yaml
schema: src/distribution/unreleased.yaml
target_class: EntityInfluence
data_sources:
- src/examples/data-distribution/EntityInfluence-std.yaml
- src/distribution/unreleased/examples/EntityInfluence-std.yaml
plugins:
JsonschemaValidationPlugin:
closed: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema: src/linkml/schemas/data-distribution.yaml
schema: src/distribution/unreleased.yaml
target_class: Publication
data_sources:
- src/examples/data-distribution/Publication-std.yaml
- src/distribution/unreleased/examples/Publication-std.yaml
plugins:
JsonschemaValidationPlugin:
closed: true
Expand Down
13 changes: 13 additions & 0 deletions src/distribution/unreleased/validation/Resource.valid.cfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
schema: src/distribution/unreleased.yaml
target_class: Resource
data_sources:
- src/distribution/unreleased/examples/Resource-customproperty.yaml
- src/distribution/unreleased/examples/Resource-funding.yaml
- src/distribution/unreleased/examples/Resource-study.yaml
- src/distribution/unreleased/examples/Resource-gitcommit.yaml
- src/distribution/unreleased/examples/Resource-dataladdataset.yaml
plugins:
JsonschemaValidationPlugin:
closed: true
include_range_class_descendants: false
RecommendedSlotsPlugin:
1 change: 0 additions & 1 deletion src/examples/derived-example/AgentInfluence-std.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-annexkey.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-basic.yaml

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-formats.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-gitblob.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-gittree.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-parts.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-penguins.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/DExDistribution-resource.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/EntityInfluence-std.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/Publication-std.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/Resource-customproperty.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/Resource-dataladdataset.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/Resource-funding.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/Resource-gitcommit.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/examples/derived-example/Resource-study.yaml

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions tests/data-distribution-schema/validation/Resource.valid.cfg.yaml

This file was deleted.

0 comments on commit 97499df

Please sign in to comment.