Skip to content

Commit

Permalink
Merge pull request #2044 from microbiomedata/metagnome-input-id
Browse files Browse the repository at this point in the history
add metagnome input id pattern constraint
  • Loading branch information
turbomam authored Jun 5, 2024
2 parents b2dc818 + fbeb467 commit 46750c0
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
13 changes: 11 additions & 2 deletions nmdc_schema/nmdc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from nmdc.yaml by pythongen.py version: 0.0.1
# Generation date: 2024-06-04T21:02:10
# Generation date: 2024-06-05T15:38:19
# Schema: NMDC
#
# id: https://w3id.org/nmdc/nmdc
Expand Down Expand Up @@ -5707,17 +5707,23 @@ class MetagenomeSequencingActivity(WorkflowExecutionActivity):
id: Union[str, MetagenomeSequencingActivityId] = None
execution_resource: str = None
git_url: str = None
has_input: Union[Union[str, NamedThingId], List[Union[str, NamedThingId]]] = None
type: str = None
started_at_time: str = None
ended_at_time: str = None
has_input: Union[Union[str, NamedThingId], List[Union[str, NamedThingId]]] = None

def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.id):
self.MissingRequiredField("id")
if not isinstance(self.id, MetagenomeSequencingActivityId):
self.id = MetagenomeSequencingActivityId(self.id)

if self._is_empty(self.has_input):
self.MissingRequiredField("has_input")
if not isinstance(self.has_input, list):
self.has_input = [self.has_input] if self.has_input is not None else []
self.has_input = [v if isinstance(v, NamedThingId) else NamedThingId(v) for v in self.has_input]

super().__post_init__(**kwargs)


Expand Down Expand Up @@ -11737,6 +11743,9 @@ class slots:
model_uri=NMDC.MetagenomeSequencingActivity_id, domain=MetagenomeSequencingActivity, range=Union[str, MetagenomeSequencingActivityId],
pattern=re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_\.]+:[a-zA-Z0-9_][a-zA-Z0-9_\-\/\.,]*$'))

slots.MetagenomeSequencingActivity_has_input = Slot(uri=NMDC.has_input, name="MetagenomeSequencingActivity_has_input", curie=NMDC.curie('has_input'),
model_uri=NMDC.MetagenomeSequencingActivity_has_input, domain=MetagenomeSequencingActivity, range=Union[Union[str, NamedThingId], List[Union[str, NamedThingId]]])

slots.ReadQcAnalysisActivity_id = Slot(uri=NMDC.id, name="ReadQcAnalysisActivity_id", curie=NMDC.curie('id'),
model_uri=NMDC.ReadQcAnalysisActivity_id, domain=ReadQcAnalysisActivity, range=Union[str, ReadQcAnalysisActivityId],
pattern=re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_\.]+:[a-zA-Z0-9_][a-zA-Z0-9_\-\/\.,]*$'))
Expand Down
2 changes: 1 addition & 1 deletion nmdc_schema/nmdc_materialized_patterns.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6033,7 +6033,7 @@
"has_input": {
"description": "An input to a process.",
"items": {
"pattern": "^(nmdc):dobj-([0-9][a-z]{0,6}[0-9])-([A-Za-z0-9]{1,})$",
"pattern": "^(nmdc):(bsm|procsm)-([0-9][a-z]{0,6}[0-9])-([A-Za-z0-9]{1,})$",
"type": "string"
},
"type": "array"
Expand Down
6 changes: 6 additions & 0 deletions nmdc_schema/nmdc_materialized_patterns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20809,6 +20809,12 @@ classes:
structured_pattern:
syntax: '{id_nmdc_prefix}:wfmsa-{id_shoulder}-{id_blade}{id_version}$'
interpolated: true
has_input:
name: has_input
pattern: ^(nmdc):(bsm|procsm)-([0-9][a-z]{0,6}[0-9])-([A-Za-z0-9]{1,})$
structured_pattern:
syntax: '{id_nmdc_prefix}:(bsm|procsm)-{id_shoulder}-{id_blade}$'
interpolated: true
ReadQcAnalysisActivity:
name: ReadQcAnalysisActivity
description: A workflow execution activity that performs quality control on raw
Expand Down
5 changes: 5 additions & 0 deletions nmdc_schema/nmdc_schema_merged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20755,6 +20755,11 @@ classes:
structured_pattern:
syntax: '{id_nmdc_prefix}:wfmsa-{id_shoulder}-{id_blade}{id_version}$'
interpolated: true
has_input:
name: has_input
structured_pattern:
syntax: '{id_nmdc_prefix}:(bsm|procsm)-{id_shoulder}-{id_blade}$'
interpolated: true
ReadQcAnalysisActivity:
name: ReadQcAnalysisActivity
description: A workflow execution activity that performs quality control on raw
Expand Down
2 changes: 2 additions & 0 deletions project.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ local/mongo_as_unvalidated_nmdc_database.yaml:
--selected-collections metagenome_annotation_activity_set \
--selected-collections metagenome_annotation_set \
--selected-collections metagenome_assembly_set \
--selected-collections metagenome_sequencing_activity_set \
--selected-collections metagenome_sequencing_set \
--selected-collections metap_gene_function_aggregation \
--selected-collections metatranscriptome_activity_set \
--selected-collections metatranscriptome_analysis_set \
Expand Down
8 changes: 4 additions & 4 deletions src/schema/workflow_execution_activity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ classes:
structured_pattern:
syntax: "{id_nmdc_prefix}:wfmsa-{id_shoulder}-{id_blade}{id_version}$"
interpolated: true
# has_input:
# structured_pattern:
# syntax: ".*" # todo this accounts for an extreme edge case and should nto be repeated anywhere
# interpolated: true
has_input:
structured_pattern:
syntax: "{id_nmdc_prefix}:(bsm|procsm)-{id_shoulder}-{id_blade}$"
interpolated: true


ReadQcAnalysisActivity:
Expand Down

0 comments on commit 46750c0

Please sign in to comment.