From 69c9abfb65ea0be276c866af530684e0a6487623 Mon Sep 17 00:00:00 2001 From: "Mark A. Miller" Date: Fri, 13 Sep 2024 11:13:47 -0400 Subject: [PATCH] first-any_of-range --- .../MimsSoil-collection_date-absent-report.txt | 1 + ...msSoil-collection_date-from_enum-report.txt | 1 + assets/MixsCompliantData-001-report.txt | 1 + project.Makefile | 18 ++++++++++++++++-- .../MimsSoil-collection_date-absent.yaml | 12 ++++++++++++ ..._name.yaml => Soil-sample_name-absent.yaml} | 0 .../MimsSoil-collection_date-from_enum.yaml | 13 +++++++++++++ .../schema/mixs_missing_value_sandbox.yaml | 11 +++++++++++ 8 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 assets/MimsSoil-collection_date-absent-report.txt create mode 100644 assets/MimsSoil-collection_date-from_enum-report.txt create mode 100644 assets/MixsCompliantData-001-report.txt create mode 100644 src/data/examples/invalid/MimsSoil-collection_date-absent.yaml rename src/data/examples/invalid/{Soil-missing_sample_name.yaml => Soil-sample_name-absent.yaml} (100%) create mode 100644 src/data/examples/valid/MimsSoil-collection_date-from_enum.yaml diff --git a/assets/MimsSoil-collection_date-absent-report.txt b/assets/MimsSoil-collection_date-absent-report.txt new file mode 100644 index 0000000..3397aad --- /dev/null +++ b/assets/MimsSoil-collection_date-absent-report.txt @@ -0,0 +1 @@ +[ERROR] [src/data/examples/invalid/MimsSoil-collection_date-absent.yaml/0] 'collection_date' is a required property in / diff --git a/assets/MimsSoil-collection_date-from_enum-report.txt b/assets/MimsSoil-collection_date-from_enum-report.txt new file mode 100644 index 0000000..f6f4b79 --- /dev/null +++ b/assets/MimsSoil-collection_date-from_enum-report.txt @@ -0,0 +1 @@ +No issues found diff --git a/assets/MixsCompliantData-001-report.txt b/assets/MixsCompliantData-001-report.txt new file mode 100644 index 0000000..f6f4b79 --- /dev/null +++ b/assets/MixsCompliantData-001-report.txt @@ -0,0 +1 @@ +No issues found diff --git a/project.Makefile b/project.Makefile index ca8503d..733f6b9 100644 --- a/project.Makefile +++ b/project.Makefile @@ -1,13 +1,27 @@ RUN=poetry run -src/data/valid/MixsCompliantData-001-report.txt: src/data/examples/valid \ +assets/MixsCompliantData-001-report.txt: src/data/examples/valid/MixsCompliantData-001.yaml \ src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml $(RUN) linkml-validate \ --schema $(word 2,$^) \ --target-class $(shell echo $(basename $(notdir $(word 1,$^))) | cut -d'-' -f1) \ $(word 1,$^) > $@ -src/data/valid/MixsCompliantData-001.tsv: src/data/examples/valid \ +assets/MimsSoil-collection_date-absent-report.txt: src/data/examples/invalid/MimsSoil-collection_date-absent.yaml \ +src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml + $(RUN) linkml-validate \ + --schema $(word 2,$^) \ + --target-class $(shell echo $(basename $(notdir $(word 1,$^))) | cut -d'-' -f1) \ + $(word 1,$^) > $@ + +assets/MimsSoil-collection_date-from_enum-report.txt: src/data/examples/valid/MimsSoil-collection_date-from_enum.yaml \ +src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml + $(RUN) linkml-validate \ + --schema $(word 2,$^) \ + --target-class $(shell echo $(basename $(notdir $(word 1,$^))) | cut -d'-' -f1) \ + $(word 1,$^) > $@ + +assets/MixsCompliantData-001.tsv: src/data/examples/valid/MixsCompliantData-001.yaml \ src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml $(RUN) linkml-convert --schema $(word 2,$^) \ --output $@ \ diff --git a/src/data/examples/invalid/MimsSoil-collection_date-absent.yaml b/src/data/examples/invalid/MimsSoil-collection_date-absent.yaml new file mode 100644 index 0000000..3fa8338 --- /dev/null +++ b/src/data/examples/invalid/MimsSoil-collection_date-absent.yaml @@ -0,0 +1,12 @@ +depth: "123" +elev: "123" +project_name: abc +samp_name: abc + +env_broad_scale: unicorn [example:999] +env_local_scale: unicorn [example:999] +env_medium: unicorn [example:999] +geo_loc_name: "unicorn: unicorn, unicorn" +lat_lon: 45.67 45.67 +samp_taxon_id: unicorn [NCBITaxon:999] +seq_meth: xxx diff --git a/src/data/examples/invalid/Soil-missing_sample_name.yaml b/src/data/examples/invalid/Soil-sample_name-absent.yaml similarity index 100% rename from src/data/examples/invalid/Soil-missing_sample_name.yaml rename to src/data/examples/invalid/Soil-sample_name-absent.yaml diff --git a/src/data/examples/valid/MimsSoil-collection_date-from_enum.yaml b/src/data/examples/valid/MimsSoil-collection_date-from_enum.yaml new file mode 100644 index 0000000..3d161dd --- /dev/null +++ b/src/data/examples/valid/MimsSoil-collection_date-from_enum.yaml @@ -0,0 +1,13 @@ +depth: "123" +elev: "123" +project_name: abc +samp_name: abc + +collection_date: '2013-03-25T12:42:31+01:00' +env_broad_scale: unicorn [example:999] +env_local_scale: unicorn [example:999] +env_medium: unicorn [example:999] +geo_loc_name: "unicorn: unicorn, unicorn" +lat_lon: 45.67 45.67 +samp_taxon_id: unicorn [NCBITaxon:999] +seq_meth: xxx diff --git a/src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml b/src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml index a2d925b..71616c2 100644 --- a/src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml +++ b/src/mixs_missing_value_sandbox/schema/mixs_missing_value_sandbox.yaml @@ -72,6 +72,11 @@ classes: mixins: - Mims class_uri: MIXS:0010007_0016012 + slot_usage: + collection_date: + any_of: + - range: datetime + - range: MixsMissingValueEnum Mims: description: Metagenome or Environmental title: MIMS @@ -1882,6 +1887,12 @@ slots: partial_match: true enums: + MixsMissingValueEnum: + permissible_values: + missing1: { } + missing2: { } + missing3: { } + DrainageClassEnum: permissible_values: excessively drained: