Skip to content

Commit

Permalink
add dep stub
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Jan 27, 2024
1 parent f443469 commit 9d8041a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/linkml_transformer/datamodel/transformer_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ classes:
range: string
stringification:
range: StringificationConfiguration
deprecated:
range: boolean
description: >-
If a slot is deprecated, it will not be included in the target schema yaml file, and all references
in the source schema to that slot will be removed. However, the deprecated slot will be added to an
"obsolete" yaml file that will be generated along with the target schema yaml file.
EnumDerivation:
is_a: ElementDerivation
Expand Down
13 changes: 11 additions & 2 deletions src/linkml_transformer/transformer/object_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ def index(self, source_obj: Any, target: str = None):
else:
self.object_index = ObjectIndex(source_obj, schemaview=self.source_schemaview)

def deprecate(self, source_obj: Any, target: str = None):
"""
Deprecate an object.
:param source_obj: source data structure to be deprecated
:param target: class to convert source object into
"""

def transform(
self,
source_obj: OBJECT_TYPE,
Expand All @@ -65,8 +73,9 @@ def transform(
Transform a source object into a target object.
:param source_obj: source data structure
:param source_type: source_obj instantiates this (may be class, type, or enum)
:param target_type: target_obj instantiates this (may be class, type, or enum)
:param source_type: source_obj instantiates this (source_type value may be class, type, or enum)
:param target_type: target_obj instantiates this (target_type value may be class, type, or enum)
:return: transformed data, either as type target_type or a dictionary
"""
sv = self.source_schemaview
Expand Down

0 comments on commit 9d8041a

Please sign in to comment.