Skip to content

Commit d074595

Browse files
committed
make project.description required
1 parent 74a97dd commit d074595

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

project/jsonschema/oae_data_protocol.schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,6 +3184,7 @@
31843184
},
31853185
"required": [
31863186
"project_id",
3187+
"description",
31873188
"temporal_coverage",
31883189
"spatial_coverage",
31893190
"mcdr_pathway"

src/oae_data_protocol/datamodel/oae_data_protocol.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from oae_data_protocol.yaml by pythongen.py version: 0.0.1
2-
# Generation date: 2026-01-27T20:07:46
2+
# Generation date: 2026-01-27T20:56:41
33
# Schema: OAEDataManagementProtocol
44
#
55
# id: OAEDataManagementProtocol
@@ -312,10 +312,10 @@ class Project(YAMLRoot):
312312
class_model_uri: ClassVar[URIRef] = OAE.Project
313313

314314
project_id: str = None
315+
description: str = None
315316
temporal_coverage: str = None
316317
spatial_coverage: Union[dict, SpatialCoverage] = None
317318
mcdr_pathway: Union[str, "MCDRPathway"] = None
318-
description: Optional[str] = None
319319
experiments: Optional[Union[Union[dict, "Experiment"], List[Union[dict, "Experiment"]]]] = empty_list()
320320
sea_names: Optional[Union[Union[str, "SeaNames"], List[Union[str, "SeaNames"]]]] = empty_list()
321321
physical_site_description: Optional[str] = None
@@ -334,6 +334,11 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
334334
if not isinstance(self.project_id, str):
335335
self.project_id = str(self.project_id)
336336

337+
if self._is_empty(self.description):
338+
self.MissingRequiredField("description")
339+
if not isinstance(self.description, str):
340+
self.description = str(self.description)
341+
337342
if self._is_empty(self.temporal_coverage):
338343
self.MissingRequiredField("temporal_coverage")
339344
if not isinstance(self.temporal_coverage, str):
@@ -349,9 +354,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
349354
if not isinstance(self.mcdr_pathway, MCDRPathway):
350355
self.mcdr_pathway = MCDRPathway(self.mcdr_pathway)
351356

352-
if self.description is not None and not isinstance(self.description, str):
353-
self.description = str(self.description)
354-
355357
self._normalize_inlined_as_dict(slot_name="experiments", slot_type=Experiment, key_name="description", keyed=False)
356358

357359
if not isinstance(self.sea_names, list):
@@ -4085,7 +4087,7 @@ class slots:
40854087
model_uri=OAE.Project_project_id, domain=Project, range=str)
40864088

40874089
slots.Project_description = Slot(uri=SCHEMA.description, name="Project_description", curie=SCHEMA.curie('description'),
4088-
model_uri=OAE.Project_description, domain=Project, range=Optional[str])
4090+
model_uri=OAE.Project_description, domain=Project, range=str)
40894091

40904092
slots.MonetaryGrant_name = Slot(uri=SCHEMA.name, name="MonetaryGrant_name", curie=SCHEMA.curie('name'),
40914093
model_uri=OAE.MonetaryGrant_name, domain=MonetaryGrant, range=Optional[str])

src/oae_data_protocol/schema/oae_project.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classes:
2929
A narrative description of the project. For example, what were the goals of the project? What were the research questions? What were the processes to achieve these goals and answer these questions? Who were the key stakeholders, organizers, project leaders? Was this building off a previous or ongoing project, or is this a new region/experiment/mechanistic study?
3030
3131
If there are relevant regulatory parameters and/or limits to dosing trials at this location, these may be described here.
32+
required: true
3233
attributes:
3334
experiments:
3435
title: Related Experiments

0 commit comments

Comments
 (0)