Skip to content

Commit

Permalink
datasets field in metricsDatasetCollection may be empty (not required)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliomateoslangerak committed Apr 29, 2024
1 parent 5560cf4 commit 4bae7e2
Show file tree
Hide file tree
Showing 11 changed files with 2,346 additions and 2,358 deletions.
Binary file modified project/excel/microscopemetrics_schema.xlsx
Binary file not shown.
4 changes: 2 additions & 2 deletions project/graphql/microscopemetrics_schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ type HarmonizedMetricsDatasetCollection
description: String
dataReference: DataReference
linkedReferences: [DataReference]
datasets: [MetricsDataset]!
datasets: [MetricsDataset]
datasetClass: String!
}

Expand Down Expand Up @@ -453,7 +453,7 @@ type MetricsDatasetCollection
description: String
dataReference: DataReference
linkedReferences: [DataReference]
datasets: [MetricsDataset]!
datasets: [MetricsDataset]
}

interface MetricsInput
Expand Down
2 changes: 1 addition & 1 deletion project/jsonld/microscopemetrics_schema.context.jsonld
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"comments": {
"description": "Auto generated by LinkML jsonld context generator",
"generation_date": "2024-04-23T13:43:14",
"generation_date": "2024-04-29T14:52:42",
"source": "microscopemetrics_schema.yaml"
},
"@context": {
Expand Down
4 changes: 1 addition & 3 deletions project/jsonld/microscopemetrics_schema.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,6 @@
"MetricsDatasetCollection"
],
"range": "MetricsDataset",
"required": true,
"inlined": true,
"inlined_as_list": true,
"@type": "SlotDefinition"
Expand Down Expand Up @@ -5007,7 +5006,6 @@
"description": "The datasets of the collection",
"multivalued": true,
"range": "MetricsDataset",
"required": true,
"inlined": true,
"inlined_as_list": true,
"@type": "SlotDefinition"
Expand Down Expand Up @@ -6951,7 +6949,7 @@
"source_file": "microscopemetrics_schema.yaml",
"source_file_date": "2024-02-05T12:00:47",
"source_file_size": 787,
"generation_date": "2024-04-23T13:43:15",
"generation_date": "2024-04-29T14:52:43",
"@type": "SchemaDefinition",
"@context": [
"project/jsonld/microscopemetrics_schema.context.jsonld",
Expand Down
6 changes: 1 addition & 5 deletions project/jsonschema/microscopemetrics_schema.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1696,8 +1696,7 @@
}
},
"required": [
"dataset_class",
"datasets"
"dataset_class"
],
"title": "HarmonizedMetricsDatasetCollection",
"type": "object"
Expand Down Expand Up @@ -2120,9 +2119,6 @@
"type": "string"
}
},
"required": [
"datasets"
],
"title": "MetricsDatasetCollection",
"type": "object"
},
Expand Down
1,970 changes: 985 additions & 985 deletions project/owl/microscopemetrics_schema.owl.ttl

Large diffs are not rendered by default.

2,702 changes: 1,350 additions & 1,352 deletions project/shacl/microscopemetrics_schema.shacl.ttl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion project/shex/microscopemetrics_schema.shex
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ CLOSED {
&<https://w3id.org/MontpellierRessourcesImagerie/microscopemetrics-schema/core_schema/MetricsObject_tes> ;
rdf:type [ <https://w3id.org/MontpellierRessourcesImagerie/microscopemetrics-schema/core_schema/MetricsObject> ] ? ;
<https://w3id.org/MontpellierRessourcesImagerie/microscopemetrics-schema/core_schema/datasets>
@<https://w3id.org/MontpellierRessourcesImagerie/microscopemetrics-schema/core_schema/MetricsDataset> +
@<https://w3id.org/MontpellierRessourcesImagerie/microscopemetrics-schema/core_schema/MetricsDataset> *
) ;
rdf:type [ <https://w3id.org/MontpellierRessourcesImagerie/microscopemetrics-schema/core_schema/MetricsDatasetCollection>
] ?
Expand Down
4 changes: 2 additions & 2 deletions project/sqlschema/microscopemetrics_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ CREATE TABLE "HarmonizedMetricsDatasetCollection" (
description TEXT,
data_reference TEXT,
linked_references TEXT,
datasets TEXT NOT NULL,
datasets TEXT,
dataset_class TEXT NOT NULL,
PRIMARY KEY (name, description, data_reference, linked_references, datasets, dataset_class)
);
Expand Down Expand Up @@ -358,7 +358,7 @@ CREATE TABLE "MetricsDatasetCollection" (
description TEXT,
data_reference TEXT,
linked_references TEXT,
datasets TEXT NOT NULL,
datasets TEXT,
PRIMARY KEY (name, description, data_reference, linked_references, datasets)
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from microscopemetrics_schema.yaml by pythongen.py version: 0.0.1
# Generation date: 2024-04-23T13:43:21
# Generation date: 2024-04-29T14:52:50
# Schema: microscopemetrics-schema
#
# id: https://w3id.org/MontpellierRessourcesImagerie/microscopemetrics-schema
Expand Down Expand Up @@ -341,11 +341,9 @@ class MetricsDatasetCollection(MetricsObject):
class_name: ClassVar[str] = "MetricsDatasetCollection"
class_model_uri: ClassVar[URIRef] = MICROSCOPEMETRICS_SCHEMA.MetricsDatasetCollection

datasets: Union[Union[dict, "MetricsDataset"], List[Union[dict, "MetricsDataset"]]] = None
datasets: Optional[Union[Union[dict, "MetricsDataset"], List[Union[dict, "MetricsDataset"]]]] = empty_list()

def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.datasets):
self.MissingRequiredField("datasets")
if not isinstance(self.datasets, list):
self.datasets = [self.datasets] if self.datasets is not None else []
self.datasets = [v if isinstance(v, MetricsDataset) else MetricsDataset(**as_dict(v)) for v in self.datasets]
Expand All @@ -366,7 +364,6 @@ class HarmonizedMetricsDatasetCollection(MetricsDatasetCollection):
class_name: ClassVar[str] = "HarmonizedMetricsDatasetCollection"
class_model_uri: ClassVar[URIRef] = MICROSCOPEMETRICS_SCHEMA.HarmonizedMetricsDatasetCollection

datasets: Union[Union[dict, "MetricsDataset"], List[Union[dict, "MetricsDataset"]]] = None
dataset_class: str = None

def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
Expand Down Expand Up @@ -3006,7 +3003,7 @@ class slots:
model_uri=MICROSCOPEMETRICS_SCHEMA.comment__text, domain=None, range=str)

slots.metricsDatasetCollection__datasets = Slot(uri=MICROSCOPEMETRICS_SCHEMA['core_schema/datasets'], name="metricsDatasetCollection__datasets", curie=MICROSCOPEMETRICS_SCHEMA.curie('core_schema/datasets'),
model_uri=MICROSCOPEMETRICS_SCHEMA.metricsDatasetCollection__datasets, domain=None, range=Union[Union[dict, MetricsDataset], List[Union[dict, MetricsDataset]]])
model_uri=MICROSCOPEMETRICS_SCHEMA.metricsDatasetCollection__datasets, domain=None, range=Optional[Union[Union[dict, MetricsDataset], List[Union[dict, MetricsDataset]]]])

slots.harmonizedMetricsDatasetCollection__dataset_class = Slot(uri=MICROSCOPEMETRICS_SCHEMA['core_schema/dataset_class'], name="harmonizedMetricsDatasetCollection__dataset_class", curie=MICROSCOPEMETRICS_SCHEMA.curie('core_schema/dataset_class'),
model_uri=MICROSCOPEMETRICS_SCHEMA.harmonizedMetricsDatasetCollection__dataset_class, domain=None, range=str)
Expand Down
1 change: 0 additions & 1 deletion src/microscopemetrics_schema/schema/core_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ classes:
datasets:
range: MetricsDataset
description: The datasets of the collection
required: true
multivalued: true
inlined: true
inlined_as_list: true
Expand Down

0 comments on commit 4bae7e2

Please sign in to comment.