Skip to content

Commit

Permalink
Merge pull request #137 from psychoinformatics-de/ddist
Browse files Browse the repository at this point in the history
Reorganize to versioned, multiple schemas
  • Loading branch information
mih authored Mar 29, 2024
2 parents fc268dc + 97499df commit 91888d7
Show file tree
Hide file tree
Showing 102 changed files with 368 additions and 387 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ prefixes:
DCAT: http://www.w3.org/ns/dcat#
datalad-ds: https://concepts.datalad.org/ns/dataset-uuid/
dcterms: http://purl.org/dc/terms/
dlco: https://concepts.datalad.org/ontology/
# TODO homogenize with base schema
dlco1: https://concepts.datalad.org/
dlco: https://concepts.datalad.org/
dldist: https://concepts.datalad.org/s/distribution/unreleased/
dex: https://example.org/ns/ex/terms/
dpv: https://w3id.org/dpv#
foaf: http://xmlns.com/foaf/0.1/
Expand Down Expand Up @@ -50,14 +49,14 @@ default_prefix: dex
emit_prefixes:
- CiTO
- DCAT
- dlco
- dldist
- licenses
- marcrel
- obo
- prov

imports:
- dlco1:schemas/data-distribution
- dlco:s/distribution/unreleased

classes:
DExResearchContributor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"relation": [
{
"id": "exthisds:#customlicense",
"meta_type": "dlco:LicenseDocument",
"meta_type": "dldist:LicenseDocument",
"license_text": "Highly custom terms, never seen before."
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"has_property": [
{
"is_defined_by": "obo:NCIT_C95650",
"meta_type": "dlco:Property",
"meta_type": "dldist:Property",
"name": "data type",
"type": "obo:NCIT_C42645",
"value": "encapsulated image data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"has_part": [
{
"id": "exthisdsver:./dataset_description.json",
"meta_type": "dlco:Distribution",
"meta_type": "dldist:Distribution",
"media_type": "application/json"
},
{
"id": "exthisdsver:./participants.tsv",
"meta_type": "dlco:Distribution",
"meta_type": "dldist:Distribution",
"format": "http://edamontology.org/format_3475"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{
"id": "exthisdsver:./archive.zip/subdir",
"description": "A subdirectory",
"meta_type": "dlco:Distribution",
"meta_type": "dldist:Distribution",
"has_part": [
{
"id": "exthisdsver:./archive.zip/subdir/file.txt",
"description": "A file",
"meta_type": "dlco:Distribution"
"meta_type": "dldist:Distribution"
}
],
"qualified_part": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"schema_agency": "https://doi.org"
}
],
"meta_type": "dlco:Resource",
"meta_type": "dldist:Resource",
"name": "penguins",
"same_as": [
"https://doi.org/10.5281/zenodo.3960218"
Expand Down Expand Up @@ -101,7 +101,7 @@
"schema_agency": "https://ror.org/021nxhr62"
}
],
"meta_type": "dlco:Grant",
"meta_type": "dldist:Grant",
"name": "LTER: PALMER, ANTARCTICA LTER: Climate Change, Ecosystem Migration and Teleconnections in an Ice-Dominated Environment",
"sponsor": "https://ror.org/05nwjp114",
"cites_as_authority": "https://www.nsf.gov/awardsearch/showAward?AWD_ID=0217282"
Expand All @@ -114,7 +114,7 @@
"schema_agency": "https://ror.org/021nxhr62"
}
],
"meta_type": "dlco:Grant",
"meta_type": "dldist:Grant",
"name": "Palmer, Antarctica Long Term Ecological Research Project",
"sponsor": "https://ror.org/05nwjp114",
"cites_as_authority": "https://www.nsf.gov/awardsearch/showAward?AWD_ID=0823101"
Expand All @@ -127,7 +127,7 @@
"schema_agency": "https://ror.org/021nxhr62"
}
],
"meta_type": "dlco:Grant",
"meta_type": "dldist:Grant",
"name": "Collaborative Research: Possible Climate-induced Change in the Distribution of Pleuragramma Antarcticum on the Western Antarctic Peninsula Shelf",
"sponsor": "https://ror.org/05nwjp114",
"cites_as_authority": "https://www.nsf.gov/awardsearch/showAward?AWD_ID=0741351"
Expand All @@ -140,7 +140,7 @@
"schema_agency": "https://doi.org"
}
],
"meta_type": "dlco:Publication",
"meta_type": "dldist:Publication",
"qualified_attribution": [
{
"had_role": [
Expand All @@ -162,7 +162,7 @@
"schema_agency": "https://orcid.org"
}
],
"meta_type": "dlco:ResearchContributor",
"meta_type": "dldist:ResearchContributor",
"name": "Allison Horst",
"same_as": [
"https://orcid.org/0000-0002-6047-5564"
Expand All @@ -180,7 +180,7 @@
"schema_agency": "https://orcid.org"
}
],
"meta_type": "dlco:ResearchContributor",
"meta_type": "dldist:ResearchContributor",
"name": "Allison Hill",
"email": "[email protected]",
"affiliation": [
Expand All @@ -195,7 +195,7 @@
"schema_agency": "https://orcid.org"
}
],
"meta_type": "dlco:ResearchContributor",
"meta_type": "dldist:ResearchContributor",
"name": "Kirsten Gorman",
"email": "[email protected]",
"affiliation": [
Expand All @@ -204,12 +204,12 @@
},
{
"id": "exthisds:#UCSB",
"meta_type": "dlco:Organization",
"meta_type": "dldist:Organization",
"name": "UC Santa Barbara: Santa Barbara, CA, US"
},
{
"id": "exthisds:#RStudio",
"meta_type": "dlco:Organization",
"meta_type": "dldist:Organization",
"name": "RStudio: Boston, MA, US"
},
{
Expand All @@ -220,7 +220,7 @@
"schema_agency": "https://ror.org"
}
],
"meta_type": "dlco:Organization",
"meta_type": "dldist:Organization",
"name": "University of Alaska Fairbanks: Fairbanks, AK, US"
},
{
Expand All @@ -231,7 +231,7 @@
"schema_agency": "https://ror.org"
}
],
"meta_type": "dlco:Agent",
"meta_type": "dldist:Agent",
"name": "NSF Office of Polar Programs"
},
{
Expand All @@ -242,7 +242,7 @@
"schema_agency": "https://ror.org"
}
],
"meta_type": "dlco:Agent",
"meta_type": "dldist:Agent",
"name": "US National Science Foundation",
"same_as": [
"https://www.nsf.org"
Expand All @@ -252,7 +252,7 @@
"has_part": [
{
"id": "exthisdsver:./adelie.csv",
"meta_type": "dlco:Distribution",
"meta_type": "dldist:Distribution",
"byte_size": 23755,
"checksum": [
{
Expand All @@ -265,7 +265,7 @@
},
{
"id": "exthisdsver:./gentoo.csv",
"meta_type": "dlco:Distribution",
"meta_type": "dldist:Distribution",
"byte_size": 11263,
"checksum": [
{
Expand All @@ -278,7 +278,7 @@
},
{
"id": "exthisdsver:./chinstrap.csv",
"meta_type": "dlco:Distribution",
"meta_type": "dldist:Distribution",
"byte_size": 18872,
"checksum": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
{
"id": "exthisdsver:#some/path",
"description": "Some tabular data",
"meta_type": "dlco:Resource",
"meta_type": "dldist:Resource",
"is_part_of": "exthisdsver:#"
},
{
"id": "exthisdsver:#",
"description": "A version of a collection of some data",
"meta_type": "dlco:Resource",
"meta_type": "dldist:Resource",
"is_version_of": "exthisds:#"
},
{
"id": "exthisds:#",
"description": "A collection of some data",
"meta_type": "dlco:Resource"
"meta_type": "dldist:Resource"
}
],
"is_distribution_of": "exthisdsver:#some/path",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"had_role": [
"dlco:is_about"
"dldist:is_about"
],
"entity": [
"https://en.wikipedia.org/wiki/Vulcan_(Star_Trek)#Mind_melds"
Expand Down
Loading

0 comments on commit 91888d7

Please sign in to comment.