From 2158a2ce84ee86c71e06c9abc140dbc336f150c7 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Thu, 14 Aug 2025 17:42:12 +0300 Subject: [PATCH 1/5] Add first version of enhanced mapping metadata --- .../datamodel/transformer_model.yaml | 33 +++++++++++++++++++ .../personinfo-to-agent.transform.yaml | 20 ++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/linkml_map/datamodel/transformer_model.yaml b/src/linkml_map/datamodel/transformer_model.yaml index 3622805..cadb502 100644 --- a/src/linkml_map/datamodel/transformer_model.yaml +++ b/src/linkml_map/datamodel/transformer_model.yaml @@ -23,6 +23,7 @@ prefixes: rdfs: http://www.w3.org/2000/01/rdf-schema# sh: http://www.w3.org/ns/shacl# STATO: http://purl.obolibrary.org/obo/STATO_ + sssom: https://w3id.org/sssom/ default_prefix: linkmlmap imports: @@ -75,6 +76,23 @@ classes: title: description: human readable title for this transformation specification slot_uri: dcterms:title + description: + description: >- + A description of the transformation specification, including its purpose, + how it should be used, and any other relevant information. + slot_uri: dcterms:description + publication_date: + description: date of publication of this transformation specification + range: date + slot_uri: dcterms:issued + license: + description: license under which this transformation specification is published + range: uriorcurie + slot_uri: dcterms:license + version: + description: version of this transformation specification + range: string + slot_uri: dcterms:version prefixes: description: maps prefixes to URL expansions range: KeyVal @@ -89,6 +107,21 @@ classes: description: name of the schema that describes the source (input) objects target_schema: description: name of the schema that describes the target (output) objects + creator_id: + description: A list of creators of this transformation specification + range: uriorcurie + multivalued: true + slot_uri: sssom:creator_id + author_id: + description: A list of authors of this transformation specification + range: uriorcurie + multivalued: true + slot_uri: sssom:author_id + mapping_method: + description: The method used to create this mapping, e.g. manual curation, automated + mapping, etc. + range: uriorcurie + slot_uri: sssom:mapping_justification class_derivations: description: >- Instructions on how to derive a set of classes in the target schema diff --git a/tests/input/examples/personinfo_basic/transform/personinfo-to-agent.transform.yaml b/tests/input/examples/personinfo_basic/transform/personinfo-to-agent.transform.yaml index d16593b..52afe93 100644 --- a/tests/input/examples/personinfo_basic/transform/personinfo-to-agent.transform.yaml +++ b/tests/input/examples/personinfo_basic/transform/personinfo-to-agent.transform.yaml @@ -1,9 +1,21 @@ -id: my-mappings -title: my mappings +id: https://w3id.org/linkml/map/example/personinfo-to-agent.transform.yaml +title: PersonInfo to Agent example transformation +version: 0.1 prefixes: foo: foo -source_schema: s1 -target_schema: s2 + semapv: https://w3id.org/semapv/vocab/ +description: | + This mapping set demonstrates how to transform a person information schema + into a different format using LinkML. +license: https://creativecommons.org/licenses/by/4.0/ +creator_id: + - https://orcid.org/0000-0002-7356-1779 +author_id: + - https://orcid.org/0000-0002-7356-1779 +publication_date: 2025-08-14 +source_schema: https://w3id.org/linkml/map/example/personinfo.yaml +target_schema: https://w3id.org/linkml/map/example/agent.yaml +mapping_method: semapv:ManualMappingCuration class_derivations: Container: populated_from: Container From 701601aaa34c42db702a3d05ba5efd3b8a9cb465 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Thu, 14 Aug 2025 17:59:01 +0300 Subject: [PATCH 2/5] This should probably not be merged into master --- src/linkml_map/datamodel/transformer_model.py | 1917 ++++------------- 1 file changed, 455 insertions(+), 1462 deletions(-) diff --git a/src/linkml_map/datamodel/transformer_model.py b/src/linkml_map/datamodel/transformer_model.py index fbcfbf8..47d5151 100644 --- a/src/linkml_map/datamodel/transformer_model.py +++ b/src/linkml_map/datamodel/transformer_model.py @@ -1,18 +1,32 @@ -from __future__ import annotations +from __future__ import annotations import re import sys -from datetime import date, datetime -from decimal import Decimal -from enum import Enum -from typing import Any, ClassVar, Dict, List, Literal, Optional, Union +from datetime import ( + date, + datetime, + time +) +from decimal import Decimal +from enum import Enum +from typing import ( + Any, + ClassVar, + Dict, + List, + Literal, + Optional, + Union +) -from pydantic.version import VERSION as PYDANTIC_VERSION +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator +) -if int(PYDANTIC_VERSION[0]) >= 2: - from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -else: - from pydantic import BaseModel, Field, validator metamodel_version = "None" version = "None" @@ -20,56 +34,84 @@ class ConfiguredBaseModel(BaseModel): model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, + validate_assignment = True, + validate_default = True, + extra = "forbid", + arbitrary_types_allowed = True, + use_enum_values = True, + strict = False, ) pass + + class LinkMLMeta(RootModel): root: Dict[str, Any] = {} model_config = ConfigDict(frozen=True) - def __getattr__(self, key: str): + def __getattr__(self, key:str): return getattr(self.root, key) - def __getitem__(self, key: str): + def __getitem__(self, key:str): return self.root[key] - def __setitem__(self, key: str, value): + def __setitem__(self, key:str, value): self.root[key] = value - -linkml_meta = LinkMLMeta( - { - "default_prefix": "https://w3id.org/linkml/transformer/", - "description": "Datamodel for LinkML schema mappings and transformations.\n" - "\n" - "A mapper generates instances of a *target* data model from\n" - "instances of a *source* data model. This transformation " - "process\n" - "is guided by a *TransformationSpecification*.\n" - "\n" - "The specification is independent of any one method for " - "transforming\n" - "data. It allows different approaches, including:\n" - "\n" - "- direct implementation, transforming python or json objects\n" - "- translation of the specification into SQL commands, to " - "operate on relations\n" - "- translation of the specification into SPARQL CONSTRUCTs, to " - "operate on triples\n" - "- translation into another specification language, such as " - "R2RML", - "id": "https://w3id.org/linkml/transformer", - "name": "linkml-map", - } -) - + def __contains__(self, key:str) -> bool: + return key in self.root + + +linkml_meta = LinkMLMeta({'default_prefix': 'linkmlmap', + 'description': 'Datamodel for LinkML schema mappings and transformations.\n' + '\n' + 'A mapper generates instances of a *target* data model from\n' + 'instances of a *source* data model. This transformation ' + 'process\n' + 'is guided by a *TransformationSpecification*.\n' + '\n' + 'The specification is independent of any one method for ' + 'transforming\n' + 'data. It allows different approaches, including:\n' + '\n' + '- direct implementation, transforming python or json objects\n' + '- translation of the specification into SQL commands, to ' + 'operate on relations\n' + '- translation of the specification into SPARQL CONSTRUCTs, to ' + 'operate on triples\n' + '- translation into another specification language, such as ' + 'R2RML', + 'id': 'https://w3id.org/linkml/transformer', + 'imports': ['linkml:types'], + 'name': 'linkml-map', + 'prefixes': {'STATO': {'prefix_prefix': 'STATO', + 'prefix_reference': 'http://purl.obolibrary.org/obo/STATO_'}, + 'dcterms': {'prefix_prefix': 'dcterms', + 'prefix_reference': 'http://purl.org/dc/terms/'}, + 'linkml': {'prefix_prefix': 'linkml', + 'prefix_reference': 'https://w3id.org/linkml/'}, + 'linkmlmap': {'prefix_prefix': 'linkmlmap', + 'prefix_reference': 'https://w3id.org/linkml/transformer/'}, + 'rdfs': {'prefix_prefix': 'rdfs', + 'prefix_reference': 'http://www.w3.org/2000/01/rdf-schema#'}, + 'schema': {'prefix_prefix': 'schema', + 'prefix_reference': 'http://schema.org/'}, + 'sh': {'prefix_prefix': 'sh', + 'prefix_reference': 'http://www.w3.org/ns/shacl#'}, + 'sssom': {'prefix_prefix': 'sssom', + 'prefix_reference': 'https://w3id.org/sssom/'}}, + 'source_file': 'src/linkml_map/datamodel/transformer_model.yaml', + 'title': 'LinkML Map Data Model', + 'types': {'ClassReference': {'from_schema': 'https://w3id.org/linkml/transformer', + 'name': 'ClassReference', + 'typeof': 'string'}, + 'EnumReference': {'from_schema': 'https://w3id.org/linkml/transformer', + 'name': 'EnumReference', + 'typeof': 'string'}, + 'SlotReference': {'from_schema': 'https://w3id.org/linkml/transformer', + 'name': 'SlotReference', + 'typeof': 'string'}}} ) class CollectionType(str, Enum): SingleValued = "SingleValued" @@ -111,1511 +153,461 @@ class PivotDirectionType(str, Enum): UNMELT = "UNMELT" + class SpecificationComponent(ConfiguredBaseModel): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"abstract": True, "from_schema": "https://w3id.org/linkml/transformer"} - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'abstract': True, 'from_schema': 'https://w3id.org/linkml/transformer'}) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) + description: Optional[str] = Field(default=None, description="""description of the specification component""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) class TransformationSpecification(SpecificationComponent): """ A collection of mappings between source and target classes """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer", "tree_root": True} - ) - - id: Optional[str] = Field( - None, - description="""Unique identifier for this transformation specification""", - json_schema_extra={ - "linkml_meta": { - "alias": "id", - "domain_of": ["TransformationSpecification"], - "slot_uri": "schema:identifier", - } - }, - ) - title: Optional[str] = Field( - None, - description="""human readable title for this transformation specification""", - json_schema_extra={ - "linkml_meta": { - "alias": "title", - "domain_of": ["TransformationSpecification"], - "slot_uri": "dcterms:title", - } - }, - ) - prefixes: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""maps prefixes to URL expansions""", - json_schema_extra={ - "linkml_meta": { - "alias": "prefixes", - "domain_of": ["TransformationSpecification"], - "slot_uri": "sh:declare", - } - }, - ) - source_schema: Optional[str] = Field( - None, - description="""name of the schema that describes the source (input) objects""", - json_schema_extra={ - "linkml_meta": {"alias": "source_schema", "domain_of": ["TransformationSpecification"]} - }, - ) - target_schema: Optional[str] = Field( - None, - description="""name of the schema that describes the target (output) objects""", - json_schema_extra={ - "linkml_meta": {"alias": "target_schema", "domain_of": ["TransformationSpecification"]} - }, - ) - class_derivations: Optional[Dict[str, ClassDerivation]] = Field( - default_factory=dict, - description="""Instructions on how to derive a set of classes in the target schema from classes in the source schema.""", - json_schema_extra={ - "linkml_meta": { - "alias": "class_derivations", - "domain_of": ["TransformationSpecification"], - } - }, - ) - enum_derivations: Optional[Dict[str, EnumDerivation]] = Field( - default_factory=dict, - description="""Instructions on how to derive a set of enums in the target schema""", - json_schema_extra={ - "linkml_meta": { - "alias": "enum_derivations", - "domain_of": ["TransformationSpecification"], - } - }, - ) - slot_derivations: Optional[Dict[str, SlotDerivation]] = Field( - default_factory=dict, - description="""Instructions on how to derive a set of top level slots in the target schema""", - json_schema_extra={ - "linkml_meta": { - "alias": "slot_derivations", - "domain_of": ["TransformationSpecification", "ClassDerivation"], - } - }, - ) - copy_directives: Optional[Dict[str, CopyDirective]] = Field(default_factory=dict) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer', 'tree_root': True}) + + id: Optional[str] = Field(default=None, description="""Unique identifier for this transformation specification""", json_schema_extra = { "linkml_meta": {'alias': 'id', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'schema:identifier'} }) + title: Optional[str] = Field(default=None, description="""human readable title for this transformation specification""", json_schema_extra = { "linkml_meta": {'alias': 'title', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'dcterms:title'} }) + description: Optional[str] = Field(default=None, description="""A description of the transformation specification, including its purpose, how it should be used, and any other relevant information.""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + publication_date: Optional[date] = Field(default=None, description="""date of publication of this transformation specification""", json_schema_extra = { "linkml_meta": {'alias': 'publication_date', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'dcterms:issued'} }) + license: Optional[str] = Field(default=None, description="""license under which this transformation specification is published""", json_schema_extra = { "linkml_meta": {'alias': 'license', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'dcterms:license'} }) + version: Optional[str] = Field(default=None, description="""version of this transformation specification""", json_schema_extra = { "linkml_meta": {'alias': 'version', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'dcterms:version'} }) + prefixes: Optional[Dict[str, KeyVal]] = Field(default=None, description="""maps prefixes to URL expansions""", json_schema_extra = { "linkml_meta": {'alias': 'prefixes', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'sh:declare'} }) + copy_directives: Optional[Dict[str, CopyDirective]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'copy_directives', + 'domain_of': ['TransformationSpecification', 'ElementDerivation']} }) + source_schema: Optional[str] = Field(default=None, description="""name of the schema that describes the source (input) objects""", json_schema_extra = { "linkml_meta": {'alias': 'source_schema', 'domain_of': ['TransformationSpecification']} }) + target_schema: Optional[str] = Field(default=None, description="""name of the schema that describes the target (output) objects""", json_schema_extra = { "linkml_meta": {'alias': 'target_schema', 'domain_of': ['TransformationSpecification']} }) + creator_id: Optional[List[str]] = Field(default=None, description="""A list of creators of this transformation specification""", json_schema_extra = { "linkml_meta": {'alias': 'creator_id', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'sssom:creator_id'} }) + author_id: Optional[List[str]] = Field(default=None, description="""A list of authors of this transformation specification""", json_schema_extra = { "linkml_meta": {'alias': 'author_id', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'sssom:author_id'} }) + mapping_method: Optional[str] = Field(default=None, description="""The method used to create this mapping, e.g. manual curation, automated mapping, etc.""", json_schema_extra = { "linkml_meta": {'alias': 'mapping_method', + 'domain_of': ['TransformationSpecification'], + 'slot_uri': 'sssom:mapping_justification'} }) + class_derivations: Optional[Dict[str, ClassDerivation]] = Field(default=None, description="""Instructions on how to derive a set of classes in the target schema from classes in the source schema.""", json_schema_extra = { "linkml_meta": {'alias': 'class_derivations', 'domain_of': ['TransformationSpecification']} }) + enum_derivations: Optional[Dict[str, EnumDerivation]] = Field(default=None, description="""Instructions on how to derive a set of enums in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'enum_derivations', 'domain_of': ['TransformationSpecification']} }) + slot_derivations: Optional[Dict[str, SlotDerivation]] = Field(default=None, description="""Instructions on how to derive a set of top level slots in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'slot_derivations', + 'domain_of': ['TransformationSpecification', 'ClassDerivation']} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) class ElementDerivation(SpecificationComponent): """ An abstract grouping for classes that provide a specification of how to derive a target element from a source element. """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"abstract": True, "from_schema": "https://w3id.org/linkml/transformer"} - ) - - name: str = Field( - ..., - description="""Name of the element in the target schema""", - json_schema_extra={ - "linkml_meta": { - "alias": "name", - "domain_of": [ - "ElementDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - copy_directives: Optional[Dict[str, CopyDirective]] = Field( - default_factory=dict, - json_schema_extra={ - "linkml_meta": {"alias": "copy_directives", "domain_of": ["ElementDerivation"]} - }, - ) - overrides: Optional[Any] = Field( - None, - description="""overrides source schema slots""", - json_schema_extra={ - "linkml_meta": {"alias": "overrides", "domain_of": ["ElementDerivation"]} - }, - ) - is_a: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "is_a", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:is_a", - } - }, - ) - mixins: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "mixins", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:mixins", - } - }, - ) - value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table that is applied directly to mappings, in order of precedence""", - json_schema_extra={ - "linkml_meta": {"alias": "value_mappings", "domain_of": ["ElementDerivation"]} - }, - ) - expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_value_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys and values are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_expression_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - mirror_source: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "mirror_source", "domain_of": ["ElementDerivation"]} - }, - ) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'abstract': True, 'from_schema': 'https://w3id.org/linkml/transformer'}) + + name: str = Field(default=..., description="""Name of the element in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['ElementDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + copy_directives: Optional[Dict[str, CopyDirective]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'copy_directives', + 'domain_of': ['TransformationSpecification', 'ElementDerivation']} }) + overrides: Optional[Any] = Field(default=None, description="""overrides source schema slots""", json_schema_extra = { "linkml_meta": {'alias': 'overrides', 'domain_of': ['ElementDerivation']} }) + is_a: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'is_a', 'domain_of': ['ElementDerivation'], 'slot_uri': 'linkml:is_a'} }) + mixins: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mixins', + 'domain_of': ['ElementDerivation'], + 'slot_uri': 'linkml:mixins'} }) + value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table that is applied directly to mappings, in order of precedence""", json_schema_extra = { "linkml_meta": {'alias': 'value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys and values are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_expression_mappings', + 'domain_of': ['ElementDerivation']} }) + mirror_source: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mirror_source', 'domain_of': ['ElementDerivation']} }) + description: Optional[str] = Field(default=None, description="""description of the specification component""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) class ClassDerivation(ElementDerivation): """ A specification of how to derive a target class from a source class. """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) + + populated_from: Optional[str] = Field(default=None, description="""Name of the class in the source schema""", json_schema_extra = { "linkml_meta": {'alias': 'populated_from', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + sources: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'sources', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + joins: Optional[Dict[str, AliasedClass]] = Field(default=None, description="""Additional classes to be joined to derive instances of the target class""", json_schema_extra = { "linkml_meta": {'alias': 'joins', + 'comments': ['not yet implemented'], + 'domain_of': ['ClassDerivation']} }) + slot_derivations: Optional[Dict[str, SlotDerivation]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'slot_derivations', + 'domain_of': ['TransformationSpecification', 'ClassDerivation']} }) + target_definition: Optional[Any] = Field(default=None, description="""LinkML class definition object for this slot.""", json_schema_extra = { "linkml_meta": {'alias': 'target_definition', + 'comments': ['currently defined as Any to avoid coupling with metamodel'], + 'domain_of': ['ClassDerivation', 'SlotDerivation']} }) + name: str = Field(default=..., description="""Name of the element in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['ElementDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + copy_directives: Optional[Dict[str, CopyDirective]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'copy_directives', + 'domain_of': ['TransformationSpecification', 'ElementDerivation']} }) + overrides: Optional[Any] = Field(default=None, description="""overrides source schema slots""", json_schema_extra = { "linkml_meta": {'alias': 'overrides', 'domain_of': ['ElementDerivation']} }) + is_a: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'is_a', 'domain_of': ['ElementDerivation'], 'slot_uri': 'linkml:is_a'} }) + mixins: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mixins', + 'domain_of': ['ElementDerivation'], + 'slot_uri': 'linkml:mixins'} }) + value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table that is applied directly to mappings, in order of precedence""", json_schema_extra = { "linkml_meta": {'alias': 'value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys and values are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_expression_mappings', + 'domain_of': ['ElementDerivation']} }) + mirror_source: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mirror_source', 'domain_of': ['ElementDerivation']} }) + description: Optional[str] = Field(default=None, description="""description of the specification component""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) - - populated_from: Optional[str] = Field( - None, - description="""Name of the class in the source schema""", - json_schema_extra={ - "linkml_meta": { - "alias": "populated_from", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - sources: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "sources", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - joins: Optional[Dict[str, AliasedClass]] = Field( - default_factory=dict, - description="""Additional classes to be joined to derive instances of the target class""", - json_schema_extra={ - "linkml_meta": { - "alias": "joins", - "comments": ["not yet implemented"], - "domain_of": ["ClassDerivation"], - } - }, - ) - slot_derivations: Optional[Dict[str, SlotDerivation]] = Field( - default_factory=dict, - json_schema_extra={ - "linkml_meta": { - "alias": "slot_derivations", - "domain_of": ["TransformationSpecification", "ClassDerivation"], - } - }, - ) - target_definition: Optional[Any] = Field( - None, - description="""LinkML class definition object for this slot.""", - json_schema_extra={ - "linkml_meta": { - "alias": "target_definition", - "comments": ["currently defined as Any to avoid coupling with metamodel"], - "domain_of": ["ClassDerivation", "SlotDerivation"], - } - }, - ) - name: str = Field( - ..., - description="""Name of the element in the target schema""", - json_schema_extra={ - "linkml_meta": { - "alias": "name", - "domain_of": [ - "ElementDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - copy_directives: Optional[Dict[str, CopyDirective]] = Field( - default_factory=dict, - json_schema_extra={ - "linkml_meta": {"alias": "copy_directives", "domain_of": ["ElementDerivation"]} - }, - ) - overrides: Optional[Any] = Field( - None, - description="""overrides source schema slots""", - json_schema_extra={ - "linkml_meta": {"alias": "overrides", "domain_of": ["ElementDerivation"]} - }, - ) - is_a: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "is_a", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:is_a", - } - }, - ) - mixins: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "mixins", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:mixins", - } - }, - ) - value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table that is applied directly to mappings, in order of precedence""", - json_schema_extra={ - "linkml_meta": {"alias": "value_mappings", "domain_of": ["ElementDerivation"]} - }, - ) - expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_value_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys and values are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_expression_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - mirror_source: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "mirror_source", "domain_of": ["ElementDerivation"]} - }, - ) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) - -class ObjectDerivation(BaseModel): - class_derivations: Dict[str, ClassDerivation] class AliasedClass(ConfiguredBaseModel): """ alias-class key value pairs for classes """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) - - alias: str = Field( - ..., - description="""name of the class to be aliased""", - json_schema_extra={"linkml_meta": {"alias": "alias", "domain_of": ["AliasedClass"]}}, - ) - class_named: Optional[str] = Field( - None, - description="""local alias for the class""", - json_schema_extra={"linkml_meta": {"alias": "class_named", "domain_of": ["AliasedClass"]}}, - ) + alias: str = Field(default=..., description="""name of the class to be aliased""", json_schema_extra = { "linkml_meta": {'alias': 'alias', 'domain_of': ['AliasedClass']} }) + class_named: Optional[str] = Field(default=None, description="""local alias for the class""", json_schema_extra = { "linkml_meta": {'alias': 'class_named', 'domain_of': ['AliasedClass']} }) class SlotDerivation(ElementDerivation): """ A specification of how to derive the value of a target slot from a source slot """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) - - name: str = Field( - ..., - description="""Target slot name""", - json_schema_extra={ - "linkml_meta": { - "alias": "name", - "domain_of": [ - "ElementDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - populated_from: Optional[str] = Field( - None, - description="""Source slot name""", - json_schema_extra={ - "linkml_meta": { - "alias": "populated_from", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - sources: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "sources", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - object_derivations: Optional[List[ObjectDerivation]] = None - derived_from: Optional[List[str]] = Field( - default_factory=list, - description="""Source slots that are used to derive this slot. This can be computed from the expr, if the expr is declarative.""", - json_schema_extra={ - "linkml_meta": {"alias": "derived_from", "domain_of": ["SlotDerivation"]} - }, - ) - expr: Optional[str] = Field( - None, - description="""An expression to be evaluated on the source object to derive the target slot. Should be specified using the LinkML expression language.""", - json_schema_extra={ - "linkml_meta": { - "alias": "expr", - "domain_of": ["SlotDerivation", "EnumDerivation", "PermissibleValueDerivation"], - } - }, - ) - value: Optional[Any] = Field( - None, - description="""A constant value to assign to this slot, overriding all other derivations""", - json_schema_extra={ - "linkml_meta": { - "alias": "value", - "domain_of": ["SlotDerivation"] - } - }, - ) - range: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "range", - "domain_of": ["SlotDerivation"], - "slot_uri": "linkml:range", - } - }, - ) - unit_conversion: Optional[UnitConversionConfiguration] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "unit_conversion", "domain_of": ["SlotDerivation"]} - }, - ) - inverse_of: Optional[Inverse] = Field( - None, - description="""Used to specify a class-slot tuple that is the inverse of the derived/target slot. This is used primarily for mapping to relational databases or formalisms that do not allow multiple values. The class representing the repeated element has a foreign key slot inserted in that 'back references' the original multivalued slot.""", - json_schema_extra={"linkml_meta": {"alias": "inverse_of", "domain_of": ["SlotDerivation"]}}, - ) - hide: Optional[bool] = Field( - None, - description="""True if this is suppressed""", - json_schema_extra={ - "linkml_meta": { - "alias": "hide", - "domain_of": ["SlotDerivation", "EnumDerivation", "PermissibleValueDerivation"], - } - }, - ) - type_designator: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "type_designator", "domain_of": ["SlotDerivation"]} - }, - ) - target_definition: Optional[Any] = Field( - None, - description="""LinkML definition object for this slot.""", - json_schema_extra={ - "linkml_meta": { - "alias": "target_definition", - "comments": ["currently defined as Any to avoid coupling with metamodel"], - "domain_of": ["ClassDerivation", "SlotDerivation"], - } - }, - ) - cast_collection_as: Optional[CollectionType] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "cast_collection_as", "domain_of": ["SlotDerivation"]} - }, - ) - dictionary_key: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "dictionary_key", "domain_of": ["SlotDerivation"]} - }, - ) - stringification: Optional[StringificationConfiguration] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "stringification", "domain_of": ["SlotDerivation"]} - }, - ) - aggregation_operation: Optional[AggregationOperation] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "aggregation_operation", "domain_of": ["SlotDerivation"]} - }, - ) - copy_directives: Optional[Dict[str, CopyDirective]] = Field( - default_factory=dict, - json_schema_extra={ - "linkml_meta": {"alias": "copy_directives", "domain_of": ["ElementDerivation"]} - }, - ) - overrides: Optional[Any] = Field( - None, - description="""overrides source schema slots""", - json_schema_extra={ - "linkml_meta": {"alias": "overrides", "domain_of": ["ElementDerivation"]} - }, - ) - is_a: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "is_a", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:is_a", - } - }, - ) - mixins: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "mixins", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:mixins", - } - }, - ) - value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table that is applied directly to mappings, in order of precedence""", - json_schema_extra={ - "linkml_meta": {"alias": "value_mappings", "domain_of": ["ElementDerivation"]} - }, - ) - expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_value_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys and values are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_expression_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - mirror_source: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "mirror_source", "domain_of": ["ElementDerivation"]} - }, - ) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) + + name: str = Field(default=..., description="""Target slot name""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['ElementDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + populated_from: Optional[str] = Field(default=None, description="""Source slot name""", json_schema_extra = { "linkml_meta": {'alias': 'populated_from', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + sources: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'sources', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + object_derivations: Optional[List[str]] = Field(default=None, description="""One or more object derivations used to construct the slot value(s), which must be instances of a class.""", json_schema_extra = { "linkml_meta": {'alias': 'object_derivations', 'domain_of': ['SlotDerivation']} }) + derived_from: Optional[List[str]] = Field(default=None, description="""Source slots that are used to derive this slot. This can be computed from the expr, if the expr is declarative.""", json_schema_extra = { "linkml_meta": {'alias': 'derived_from', 'domain_of': ['SlotDerivation']} }) + expr: Optional[str] = Field(default=None, description="""An expression to be evaluated on the source object to derive the target slot. Should be specified using the LinkML expression language.""", json_schema_extra = { "linkml_meta": {'alias': 'expr', + 'domain_of': ['SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + range: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'range', 'domain_of': ['SlotDerivation'], 'slot_uri': 'linkml:range'} }) + unit_conversion: Optional[UnitConversionConfiguration] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'unit_conversion', 'domain_of': ['SlotDerivation']} }) + inverse_of: Optional[Inverse] = Field(default=None, description="""Used to specify a class-slot tuple that is the inverse of the derived/target slot. This is used primarily for mapping to relational databases or formalisms that do not allow multiple values. The class representing the repeated element has a foreign key slot inserted in that 'back references' the original multivalued slot.""", json_schema_extra = { "linkml_meta": {'alias': 'inverse_of', 'domain_of': ['SlotDerivation']} }) + hide: Optional[bool] = Field(default=None, description="""True if this is suppressed""", json_schema_extra = { "linkml_meta": {'alias': 'hide', + 'domain_of': ['SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + type_designator: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'type_designator', 'domain_of': ['SlotDerivation']} }) + target_definition: Optional[Any] = Field(default=None, description="""LinkML definition object for this slot.""", json_schema_extra = { "linkml_meta": {'alias': 'target_definition', + 'comments': ['currently defined as Any to avoid coupling with metamodel'], + 'domain_of': ['ClassDerivation', 'SlotDerivation']} }) + cast_collection_as: Optional[CollectionType] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'cast_collection_as', 'domain_of': ['SlotDerivation']} }) + dictionary_key: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'dictionary_key', 'domain_of': ['SlotDerivation']} }) + stringification: Optional[StringificationConfiguration] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'stringification', 'domain_of': ['SlotDerivation']} }) + aggregation_operation: Optional[AggregationOperation] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'aggregation_operation', 'domain_of': ['SlotDerivation']} }) + copy_directives: Optional[Dict[str, CopyDirective]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'copy_directives', + 'domain_of': ['TransformationSpecification', 'ElementDerivation']} }) + overrides: Optional[Any] = Field(default=None, description="""overrides source schema slots""", json_schema_extra = { "linkml_meta": {'alias': 'overrides', 'domain_of': ['ElementDerivation']} }) + is_a: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'is_a', 'domain_of': ['ElementDerivation'], 'slot_uri': 'linkml:is_a'} }) + mixins: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mixins', + 'domain_of': ['ElementDerivation'], + 'slot_uri': 'linkml:mixins'} }) + value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table that is applied directly to mappings, in order of precedence""", json_schema_extra = { "linkml_meta": {'alias': 'value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys and values are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_expression_mappings', + 'domain_of': ['ElementDerivation']} }) + mirror_source: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mirror_source', 'domain_of': ['ElementDerivation']} }) + description: Optional[str] = Field(default=None, description="""description of the specification component""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) class EnumDerivation(ElementDerivation): """ A specification of how to derive the value of a target enum from a source enum """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) - - name: str = Field( - ..., - description="""Target enum name""", - json_schema_extra={ - "linkml_meta": { - "alias": "name", - "domain_of": [ - "ElementDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - populated_from: Optional[str] = Field( - None, - description="""Source enum name""", - json_schema_extra={ - "linkml_meta": { - "alias": "populated_from", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - sources: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "sources", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - expr: Optional[str] = Field( - None, - description="""An expression to be evaluated on the source object to derive the target slot. Should be specified using the LinkML expression language.""", - json_schema_extra={ - "linkml_meta": { - "alias": "expr", - "domain_of": ["SlotDerivation", "EnumDerivation", "PermissibleValueDerivation"], - } - }, - ) - hide: Optional[bool] = Field( - None, - description="""True if this is suppressed""", - json_schema_extra={ - "linkml_meta": { - "alias": "hide", - "domain_of": ["SlotDerivation", "EnumDerivation", "PermissibleValueDerivation"], - } - }, - ) - permissible_value_derivations: Optional[Dict[str, PermissibleValueDerivation]] = Field( - default_factory=dict, - description="""Instructions on how to derive a set of PVs in the target schema""", - json_schema_extra={ - "linkml_meta": { - "alias": "permissible_value_derivations", - "domain_of": ["EnumDerivation"], - } - }, - ) - copy_directives: Optional[Dict[str, CopyDirective]] = Field( - default_factory=dict, - json_schema_extra={ - "linkml_meta": {"alias": "copy_directives", "domain_of": ["ElementDerivation"]} - }, - ) - overrides: Optional[Any] = Field( - None, - description="""overrides source schema slots""", - json_schema_extra={ - "linkml_meta": {"alias": "overrides", "domain_of": ["ElementDerivation"]} - }, - ) - is_a: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "is_a", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:is_a", - } - }, - ) - mixins: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "mixins", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:mixins", - } - }, - ) - value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table that is applied directly to mappings, in order of precedence""", - json_schema_extra={ - "linkml_meta": {"alias": "value_mappings", "domain_of": ["ElementDerivation"]} - }, - ) - expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_value_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys and values are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_expression_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - mirror_source: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "mirror_source", "domain_of": ["ElementDerivation"]} - }, - ) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) + + name: str = Field(default=..., description="""Target enum name""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['ElementDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + populated_from: Optional[str] = Field(default=None, description="""Source enum name""", json_schema_extra = { "linkml_meta": {'alias': 'populated_from', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + sources: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'sources', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + expr: Optional[str] = Field(default=None, description="""An expression to be evaluated on the source object to derive the target slot. Should be specified using the LinkML expression language.""", json_schema_extra = { "linkml_meta": {'alias': 'expr', + 'domain_of': ['SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + hide: Optional[bool] = Field(default=None, description="""True if this is suppressed""", json_schema_extra = { "linkml_meta": {'alias': 'hide', + 'domain_of': ['SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + permissible_value_derivations: Optional[Dict[str, PermissibleValueDerivation]] = Field(default=None, description="""Instructions on how to derive a set of PVs in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'permissible_value_derivations', 'domain_of': ['EnumDerivation']} }) + copy_directives: Optional[Dict[str, CopyDirective]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'copy_directives', + 'domain_of': ['TransformationSpecification', 'ElementDerivation']} }) + overrides: Optional[Any] = Field(default=None, description="""overrides source schema slots""", json_schema_extra = { "linkml_meta": {'alias': 'overrides', 'domain_of': ['ElementDerivation']} }) + is_a: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'is_a', 'domain_of': ['ElementDerivation'], 'slot_uri': 'linkml:is_a'} }) + mixins: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mixins', + 'domain_of': ['ElementDerivation'], + 'slot_uri': 'linkml:mixins'} }) + value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table that is applied directly to mappings, in order of precedence""", json_schema_extra = { "linkml_meta": {'alias': 'value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys and values are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_expression_mappings', + 'domain_of': ['ElementDerivation']} }) + mirror_source: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mirror_source', 'domain_of': ['ElementDerivation']} }) + description: Optional[str] = Field(default=None, description="""description of the specification component""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) class PermissibleValueDerivation(ElementDerivation): """ A specification of how to derive the value of a PV from a source enum """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - { - "from_schema": "https://w3id.org/linkml/transformer", - "todos": [ - "this is currently under-specified. We will need boolean " - "combinators to express if-then-else" - ], - } - ) - - name: str = Field( - ..., - description="""Target permissible value text""", - json_schema_extra={ - "linkml_meta": { - "alias": "name", - "domain_of": [ - "ElementDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - expr: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "expr", - "domain_of": ["SlotDerivation", "EnumDerivation", "PermissibleValueDerivation"], - } - }, - ) - populated_from: Optional[str] = Field( - None, - description="""Source permissible value""", - json_schema_extra={ - "linkml_meta": { - "alias": "populated_from", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - sources: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "sources", - "domain_of": [ - "ClassDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - hide: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "hide", - "domain_of": ["SlotDerivation", "EnumDerivation", "PermissibleValueDerivation"], - } - }, - ) - copy_directives: Optional[Dict[str, CopyDirective]] = Field( - default_factory=dict, - json_schema_extra={ - "linkml_meta": {"alias": "copy_directives", "domain_of": ["ElementDerivation"]} - }, - ) - overrides: Optional[Any] = Field( - None, - description="""overrides source schema slots""", - json_schema_extra={ - "linkml_meta": {"alias": "overrides", "domain_of": ["ElementDerivation"]} - }, - ) - is_a: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "is_a", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:is_a", - } - }, - ) - mixins: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "mixins", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:mixins", - } - }, - ) - value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table that is applied directly to mappings, in order of precedence""", - json_schema_extra={ - "linkml_meta": {"alias": "value_mappings", "domain_of": ["ElementDerivation"]} - }, - ) - expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_value_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys and values are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_expression_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - mirror_source: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "mirror_source", "domain_of": ["ElementDerivation"]} - }, - ) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer', + 'todos': ['this is currently under-specified. We will need boolean ' + 'combinators to express if-then-else']}) + + name: str = Field(default=..., description="""Target permissible value text""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['ElementDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + expr: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'expr', + 'domain_of': ['SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + populated_from: Optional[str] = Field(default=None, description="""Source permissible value""", json_schema_extra = { "linkml_meta": {'alias': 'populated_from', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + sources: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'sources', + 'domain_of': ['ClassDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + hide: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'hide', + 'domain_of': ['SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + copy_directives: Optional[Dict[str, CopyDirective]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'copy_directives', + 'domain_of': ['TransformationSpecification', 'ElementDerivation']} }) + overrides: Optional[Any] = Field(default=None, description="""overrides source schema slots""", json_schema_extra = { "linkml_meta": {'alias': 'overrides', 'domain_of': ['ElementDerivation']} }) + is_a: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'is_a', 'domain_of': ['ElementDerivation'], 'slot_uri': 'linkml:is_a'} }) + mixins: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mixins', + 'domain_of': ['ElementDerivation'], + 'slot_uri': 'linkml:mixins'} }) + value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table that is applied directly to mappings, in order of precedence""", json_schema_extra = { "linkml_meta": {'alias': 'value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys and values are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_expression_mappings', + 'domain_of': ['ElementDerivation']} }) + mirror_source: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mirror_source', 'domain_of': ['ElementDerivation']} }) + description: Optional[str] = Field(default=None, description="""description of the specification component""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) class PrefixDerivation(ElementDerivation): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) - - name: str = Field( - ..., - description="""Name of the element in the target schema""", - json_schema_extra={ - "linkml_meta": { - "alias": "name", - "domain_of": [ - "ElementDerivation", - "SlotDerivation", - "EnumDerivation", - "PermissibleValueDerivation", - ], - } - }, - ) - copy_directives: Optional[Dict[str, CopyDirective]] = Field( - default_factory=dict, - json_schema_extra={ - "linkml_meta": {"alias": "copy_directives", "domain_of": ["ElementDerivation"]} - }, - ) - overrides: Optional[Any] = Field( - None, - description="""overrides source schema slots""", - json_schema_extra={ - "linkml_meta": {"alias": "overrides", "domain_of": ["ElementDerivation"]} - }, - ) - is_a: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "is_a", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:is_a", - } - }, - ) - mixins: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": { - "alias": "mixins", - "domain_of": ["ElementDerivation"], - "slot_uri": "linkml:mixins", - } - }, - ) - value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table that is applied directly to mappings, in order of precedence""", - json_schema_extra={ - "linkml_meta": {"alias": "value_mappings", "domain_of": ["ElementDerivation"]} - }, - ) - expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_value_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field( - default_factory=dict, - description="""A mapping table in which the keys and values are expressions""", - json_schema_extra={ - "linkml_meta": { - "alias": "expression_to_expression_mappings", - "domain_of": ["ElementDerivation"], - } - }, - ) - mirror_source: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "mirror_source", "domain_of": ["ElementDerivation"]} - }, - ) - description: Optional[str] = Field( - None, - description="""description of the specification component""", - json_schema_extra={ - "linkml_meta": { - "alias": "description", - "domain_of": ["SpecificationComponent"], - "slot_uri": "dcterms:description", - } - }, - ) - implements: Optional[List[str]] = Field( - default_factory=list, - description="""A reference to a specification that this component implements.""", - json_schema_extra={ - "linkml_meta": {"alias": "implements", "domain_of": ["SpecificationComponent"]} - }, - ) - comments: Optional[List[str]] = Field( - default_factory=list, - description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", - json_schema_extra={ - "linkml_meta": { - "alias": "comments", - "domain_of": ["SpecificationComponent"], - "slot_uri": "rdfs:comment", - } - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) + + name: str = Field(default=..., description="""Name of the element in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['ElementDerivation', + 'SlotDerivation', + 'EnumDerivation', + 'PermissibleValueDerivation']} }) + copy_directives: Optional[Dict[str, CopyDirective]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'copy_directives', + 'domain_of': ['TransformationSpecification', 'ElementDerivation']} }) + overrides: Optional[Any] = Field(default=None, description="""overrides source schema slots""", json_schema_extra = { "linkml_meta": {'alias': 'overrides', 'domain_of': ['ElementDerivation']} }) + is_a: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'is_a', 'domain_of': ['ElementDerivation'], 'slot_uri': 'linkml:is_a'} }) + mixins: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mixins', + 'domain_of': ['ElementDerivation'], + 'slot_uri': 'linkml:mixins'} }) + value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table that is applied directly to mappings, in order of precedence""", json_schema_extra = { "linkml_meta": {'alias': 'value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_value_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_value_mappings', 'domain_of': ['ElementDerivation']} }) + expression_to_expression_mappings: Optional[Dict[str, KeyVal]] = Field(default=None, description="""A mapping table in which the keys and values are expressions""", json_schema_extra = { "linkml_meta": {'alias': 'expression_to_expression_mappings', + 'domain_of': ['ElementDerivation']} }) + mirror_source: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'mirror_source', 'domain_of': ['ElementDerivation']} }) + description: Optional[str] = Field(default=None, description="""description of the specification component""", json_schema_extra = { "linkml_meta": {'alias': 'description', + 'domain_of': ['SpecificationComponent', 'TransformationSpecification'], + 'slot_uri': 'dcterms:description'} }) + implements: Optional[List[str]] = Field(default=None, description="""A reference to a specification that this component implements.""", json_schema_extra = { "linkml_meta": {'alias': 'implements', 'domain_of': ['SpecificationComponent']} }) + comments: Optional[List[str]] = Field(default=None, description="""A list of comments about this component. Comments are free text, and may be used to provide additional information about the component, including instructions for its use.""", json_schema_extra = { "linkml_meta": {'alias': 'comments', + 'domain_of': ['SpecificationComponent'], + 'slot_uri': 'rdfs:comment'} }) class UnitConversionConfiguration(ConfiguredBaseModel): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) - - target_unit: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "target_unit", "domain_of": ["UnitConversionConfiguration"]} - }, - ) - target_unit_scheme: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "target_unit_scheme", - "domain_of": ["UnitConversionConfiguration"], - "examples": [{"value": "ucum"}], - } - }, - ) - source_unit: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "source_unit", "domain_of": ["UnitConversionConfiguration"]} - }, - ) - source_unit_scheme: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "source_unit_scheme", - "domain_of": ["UnitConversionConfiguration"], - "examples": [{"value": "ucum"}], - } - }, - ) - source_unit_slot: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "source_unit_slot", - "domain_of": ["UnitConversionConfiguration"], - } - }, - ) - source_magnitude_slot: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "source_magnitude_slot", - "domain_of": ["UnitConversionConfiguration"], - } - }, - ) - target_unit_slot: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "target_unit_slot", - "domain_of": ["UnitConversionConfiguration"], - } - }, - ) - target_magnitude_slot: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "target_magnitude_slot", - "domain_of": ["UnitConversionConfiguration"], - } - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) + + target_unit: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'target_unit', 'domain_of': ['UnitConversionConfiguration']} }) + target_unit_scheme: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'target_unit_scheme', + 'domain_of': ['UnitConversionConfiguration'], + 'examples': [{'value': 'ucum'}]} }) + source_unit: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'source_unit', 'domain_of': ['UnitConversionConfiguration']} }) + source_unit_scheme: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'source_unit_scheme', + 'domain_of': ['UnitConversionConfiguration'], + 'examples': [{'value': 'ucum'}]} }) + source_unit_slot: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'source_unit_slot', 'domain_of': ['UnitConversionConfiguration']} }) + source_magnitude_slot: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'source_magnitude_slot', 'domain_of': ['UnitConversionConfiguration']} }) + target_unit_slot: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'target_unit_slot', 'domain_of': ['UnitConversionConfiguration']} }) + target_magnitude_slot: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'target_magnitude_slot', 'domain_of': ['UnitConversionConfiguration']} }) class StringificationConfiguration(ConfiguredBaseModel): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) - delimiter: Optional[str] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "delimiter", - "domain_of": ["StringificationConfiguration"], - "examples": [{"value": ","}, {"value": "|"}, {"value": ";"}], - } - }, - ) - reversed: Optional[bool] = Field( - None, - json_schema_extra={ - "linkml_meta": {"alias": "reversed", "domain_of": ["StringificationConfiguration"]} - }, - ) - over_slots: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": {"alias": "over_slots", "domain_of": ["StringificationConfiguration"]} - }, - ) - syntax: Optional[SerializationSyntaxType] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "syntax", - "domain_of": ["StringificationConfiguration"], - "examples": [{"value": "json"}, {"value": "yaml"}], - } - }, - ) + delimiter: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'delimiter', + 'domain_of': ['StringificationConfiguration'], + 'examples': [{'value': ','}, {'value': '|'}, {'value': ';'}]} }) + reversed: Optional[bool] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'reversed', 'domain_of': ['StringificationConfiguration']} }) + over_slots: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'over_slots', 'domain_of': ['StringificationConfiguration']} }) + syntax: Optional[SerializationSyntaxType] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'syntax', + 'domain_of': ['StringificationConfiguration'], + 'examples': [{'value': 'json'}, {'value': 'yaml'}]} }) class Inverse(ConfiguredBaseModel): """ Used for back references in mapping to relational model """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['backref', 'back_references'], + 'from_schema': 'https://w3id.org/linkml/transformer'}) - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - { - "aliases": ["backref", "back_references"], - "from_schema": "https://w3id.org/linkml/transformer", - } - ) - - slot_name: Optional[str] = Field( - None, json_schema_extra={"linkml_meta": {"alias": "slot_name", "domain_of": ["Inverse"]}} - ) - class_name: Optional[str] = Field( - None, json_schema_extra={"linkml_meta": {"alias": "class_name", "domain_of": ["Inverse"]}} - ) + slot_name: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'slot_name', 'domain_of': ['Inverse']} }) + class_name: Optional[str] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'class_name', 'domain_of': ['Inverse']} }) class TransformationOperation(ConfiguredBaseModel): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"abstract": True, "from_schema": "https://w3id.org/linkml/transformer"} - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'abstract': True, 'from_schema': 'https://w3id.org/linkml/transformer'}) pass class AggregationOperation(TransformationOperation): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) - operator: AggregationType = Field( - ..., - json_schema_extra={ - "linkml_meta": {"alias": "operator", "domain_of": ["AggregationOperation"]} - }, - ) - null_handling: Optional[InvalidValueHandlingStrategy] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "null_handling", - "domain_of": ["AggregationOperation", "GroupingOperation"], - } - }, - ) - invalid_value_handling: Optional[InvalidValueHandlingStrategy] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "invalid_value_handling", - "domain_of": ["AggregationOperation"], - } - }, - ) + operator: AggregationType = Field(default=..., json_schema_extra = { "linkml_meta": {'alias': 'operator', 'domain_of': ['AggregationOperation']} }) + null_handling: Optional[InvalidValueHandlingStrategy] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'null_handling', + 'domain_of': ['AggregationOperation', 'GroupingOperation']} }) + invalid_value_handling: Optional[InvalidValueHandlingStrategy] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'invalid_value_handling', 'domain_of': ['AggregationOperation']} }) class GroupingOperation(TransformationOperation): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) - null_handling: Optional[InvalidValueHandlingStrategy] = Field( - None, - json_schema_extra={ - "linkml_meta": { - "alias": "null_handling", - "domain_of": ["AggregationOperation", "GroupingOperation"], - } - }, - ) + null_handling: Optional[InvalidValueHandlingStrategy] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'null_handling', + 'domain_of': ['AggregationOperation', 'GroupingOperation']} }) class PivotOperation(TransformationOperation): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - { - "aliases": ["melt/unmelt", "reification/dereification"], - "from_schema": "https://w3id.org/linkml/transformer", - } - ) - - direction: PivotDirectionType = Field( - ..., - json_schema_extra={"linkml_meta": {"alias": "direction", "domain_of": ["PivotOperation"]}}, - ) - variable_slot: Optional[str] = Field( - "variable", - description="""Slot to use for the variable column in the melted/long representation. In EAV this is the name of the 'A' variable""", - json_schema_extra={ - "linkml_meta": { - "alias": "variable_slot", - "aliases": ["var_name"], - "domain_of": ["PivotOperation"], - "ifabsent": "string(variable)", - } - }, - ) - value_slot: Optional[str] = Field( - "value", - description="""Slot to use for the value column in the melted/long representation. In EAV this is the name of the 'V' variable""", - json_schema_extra={ - "linkml_meta": { - "alias": "value_slot", - "aliases": ["value_name"], - "domain_of": ["PivotOperation"], - "ifabsent": "string(value)", - } - }, - ) - unmelt_to_class: Optional[str] = Field( - None, - description="""In an unmelt operation, attributes (which are values in the long/melted/EAV representation) must conform to valid attributes in this class""", - json_schema_extra={ - "linkml_meta": {"alias": "unmelt_to_class", "domain_of": ["PivotOperation"]} - }, - ) - unmelt_to_slots: Optional[List[str]] = Field( - default_factory=list, - json_schema_extra={ - "linkml_meta": {"alias": "unmelt_to_slots", "domain_of": ["PivotOperation"]} - }, - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['melt/unmelt', 'reification/dereification'], + 'from_schema': 'https://w3id.org/linkml/transformer'}) + + direction: PivotDirectionType = Field(default=..., json_schema_extra = { "linkml_meta": {'alias': 'direction', 'domain_of': ['PivotOperation']} }) + variable_slot: Optional[str] = Field(default="variable", description="""Slot to use for the variable column in the melted/long representation. In EAV this is the name of the 'A' variable""", json_schema_extra = { "linkml_meta": {'alias': 'variable_slot', + 'aliases': ['var_name'], + 'domain_of': ['PivotOperation'], + 'ifabsent': 'string(variable)'} }) + value_slot: Optional[str] = Field(default="value", description="""Slot to use for the value column in the melted/long representation. In EAV this is the name of the 'V' variable""", json_schema_extra = { "linkml_meta": {'alias': 'value_slot', + 'aliases': ['value_name'], + 'domain_of': ['PivotOperation'], + 'ifabsent': 'string(value)'} }) + unmelt_to_class: Optional[str] = Field(default=None, description="""In an unmelt operation, attributes (which are values in the long/melted/EAV representation) must conform to valid attributes in this class""", json_schema_extra = { "linkml_meta": {'alias': 'unmelt_to_class', 'domain_of': ['PivotOperation']} }) + unmelt_to_slots: Optional[List[str]] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'unmelt_to_slots', 'domain_of': ['PivotOperation']} }) class KeyVal(ConfiguredBaseModel): - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer"} - ) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) - key: str = Field( - ..., json_schema_extra={"linkml_meta": {"alias": "key", "domain_of": ["KeyVal"]}} - ) - value: Optional[Any] = Field( - None, json_schema_extra={"linkml_meta": {"alias": "value", "domain_of": ["KeyVal"]}} - ) + key: str = Field(default=..., json_schema_extra = { "linkml_meta": {'alias': 'key', 'domain_of': ['KeyVal']} }) + value: Optional[Any] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'value', 'domain_of': ['KeyVal']} }) class CopyDirective(ConfiguredBaseModel): """ Instructs a Schema Mapper in how to map to a target schema. Not used for data transformation. - This is the process to process a directive: - 1. If `copy_all`, add all sub-elements to the list of sub-elements to be copied. - 2. If `exclude`, remove the specified sub-elements from the above list. - 3. If `exclude_all`, clean-up the above list. Effectively making previous steps useless. - 4. If `include`, add the specified sub-elements from the list result of previous steps. - Implementations might decide to somehow report (error, warning,...) meaningless combinations - (like specifying `copy_all` and `exclude_all`). - Validation on the correctness of the resulting derived schema might be done optionally by the implementation. - For example, removing a slot but keeping a class that requires it would invalidate the derived-schema. - It is always possible to validate the schema with the LinkML linter after derivation. - What are the considered sub-elements depends on the calls of Element to be transformed. - For example, for a class they are `slots` and `attributes`. + This is the process to process a directive: 1. If `copy_all`, add all sub-elements to the list of sub-elements to be copied. 2. If `exclude`, remove the specified sub-elements from the above list. 3. If `exclude_all`, clean-up the above list. Effectively making previous steps useless. 4. If `include`, add the specified sub-elements from the list result of previous steps. + Implementations might decide to somehow report (error, warning,...) meaningless combinations (like specifying `copy_all` and `exclude_all`). + Validation on the correctness of the resulting derived schema might be done optionally by the implementation. For example, removing a slot but keeping a class that requires it would invalidate the derived-schema. It is always possible to validate the schema with the LinkML linter after derivation. + What are the considered sub-elements depends on the calls of Element to be transformed. For example, for a class they are `slots` and `attributes`. """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer', 'status': 'testing'}) - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "https://w3id.org/linkml/transformer", "status": "testing"} - ) - - element_name: str = Field( - ..., - json_schema_extra={ - "linkml_meta": {"alias": "element_name", "domain_of": ["CopyDirective"]} - }, - ) - copy_all: Optional[bool] = Field( - None, - description="""Copy all sub-elements of the Element being derived.""", - json_schema_extra={"linkml_meta": {"alias": "copy_all", "domain_of": ["CopyDirective"]}}, - ) - exclude_all: Optional[bool] = Field( - None, - description="""Do not copy any of the sub-elements of the Element being derived.""", - json_schema_extra={"linkml_meta": {"alias": "exclude_all", "domain_of": ["CopyDirective"]}}, - ) - exclude: Optional[Any] = Field( - None, - description="""Remove certain sub-elements from the list of sub-elements to be copied. -As of now there it is under-specified, how to specify the sub-elements to exclude. One possible implementation would be a list where all element types can be mixed, since there might not be name conflicts across element types.""", - json_schema_extra={"linkml_meta": {"alias": "exclude", "domain_of": ["CopyDirective"]}}, - ) - include: Optional[Any] = Field( - None, - description="""Add certain sub-elements to the list of sub-elements to be copied. -As of now there it is under-specified, how to specify the sub-elements to include. One possible implementation would be a list where all element types can be mixed, since there might not be name conflicts across element types.""", - json_schema_extra={"linkml_meta": {"alias": "include", "domain_of": ["CopyDirective"]}}, - ) - add: Optional[Any] = Field( - None, json_schema_extra={"linkml_meta": {"alias": "add", "domain_of": ["CopyDirective"]}} - ) + element_name: str = Field(default=..., json_schema_extra = { "linkml_meta": {'alias': 'element_name', 'domain_of': ['CopyDirective']} }) + copy_all: Optional[bool] = Field(default=None, description="""Copy all sub-elements of the Element being derived.""", json_schema_extra = { "linkml_meta": {'alias': 'copy_all', 'domain_of': ['CopyDirective']} }) + exclude_all: Optional[bool] = Field(default=None, description="""Do not copy any of the sub-elements of the Element being derived.""", json_schema_extra = { "linkml_meta": {'alias': 'exclude_all', 'domain_of': ['CopyDirective']} }) + exclude: Optional[Any] = Field(default=None, description="""Remove certain sub-elements from the list of sub-elements to be copied. +As of now there it is under-specified, how to specify the sub-elements to exclude. One possible implementation would be a list where all element types can be mixed, since there might not be name conflicts across element types.""", json_schema_extra = { "linkml_meta": {'alias': 'exclude', 'domain_of': ['CopyDirective']} }) + include: Optional[Any] = Field(default=None, description="""Add certain sub-elements to the list of sub-elements to be copied. +As of now there it is under-specified, how to specify the sub-elements to include. One possible implementation would be a list where all element types can be mixed, since there might not be name conflicts across element types.""", json_schema_extra = { "linkml_meta": {'alias': 'include', 'domain_of': ['CopyDirective']} }) + add: Optional[Any] = Field(default=None, json_schema_extra = { "linkml_meta": {'alias': 'add', 'domain_of': ['CopyDirective']} }) # Model rebuild @@ -1638,3 +630,4 @@ class CopyDirective(ConfiguredBaseModel): PivotOperation.model_rebuild() KeyVal.model_rebuild() CopyDirective.model_rebuild() + From fa3d33e9d43d0e3e7cdba6b4aa0d0f4a9388b018 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Thu, 14 Aug 2025 18:06:14 +0300 Subject: [PATCH 3/5] Update transformer_model.py --- src/linkml_map/datamodel/transformer_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkml_map/datamodel/transformer_model.py b/src/linkml_map/datamodel/transformer_model.py index 47d5151..056ee3a 100644 --- a/src/linkml_map/datamodel/transformer_model.py +++ b/src/linkml_map/datamodel/transformer_model.py @@ -329,7 +329,7 @@ class SlotDerivation(ElementDerivation): 'SlotDerivation', 'EnumDerivation', 'PermissibleValueDerivation']} }) - object_derivations: Optional[List[str]] = Field(default=None, description="""One or more object derivations used to construct the slot value(s), which must be instances of a class.""", json_schema_extra = { "linkml_meta": {'alias': 'object_derivations', 'domain_of': ['SlotDerivation']} }) + object_derivations: Optional[Dict[str, ElementDerivation]] = Field(default=None, description="""One or more object derivations used to construct the slot value(s), which must be instances of a class.""", json_schema_extra = { "linkml_meta": {'alias': 'object_derivations', 'domain_of': ['SlotDerivation']} }) derived_from: Optional[List[str]] = Field(default=None, description="""Source slots that are used to derive this slot. This can be computed from the expr, if the expr is declarative.""", json_schema_extra = { "linkml_meta": {'alias': 'derived_from', 'domain_of': ['SlotDerivation']} }) expr: Optional[str] = Field(default=None, description="""An expression to be evaluated on the source object to derive the target slot. Should be specified using the LinkML expression language.""", json_schema_extra = { "linkml_meta": {'alias': 'expr', 'domain_of': ['SlotDerivation', From 708b94a41002b9e73125cc29bda3fa0df9e300a7 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Thu, 14 Aug 2025 18:19:36 +0300 Subject: [PATCH 4/5] Add objectderivation class to model Without this the pydantic generation is failing --- src/linkml_map/datamodel/transformer_model.py | 13 +++++++++++-- src/linkml_map/datamodel/transformer_model.yaml | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/linkml_map/datamodel/transformer_model.py b/src/linkml_map/datamodel/transformer_model.py index 056ee3a..9a538b7 100644 --- a/src/linkml_map/datamodel/transformer_model.py +++ b/src/linkml_map/datamodel/transformer_model.py @@ -206,7 +206,8 @@ class TransformationSpecification(SpecificationComponent): mapping_method: Optional[str] = Field(default=None, description="""The method used to create this mapping, e.g. manual curation, automated mapping, etc.""", json_schema_extra = { "linkml_meta": {'alias': 'mapping_method', 'domain_of': ['TransformationSpecification'], 'slot_uri': 'sssom:mapping_justification'} }) - class_derivations: Optional[Dict[str, ClassDerivation]] = Field(default=None, description="""Instructions on how to derive a set of classes in the target schema from classes in the source schema.""", json_schema_extra = { "linkml_meta": {'alias': 'class_derivations', 'domain_of': ['TransformationSpecification']} }) + class_derivations: Optional[Dict[str, ClassDerivation]] = Field(default=None, description="""Instructions on how to derive a set of classes in the target schema from classes in the source schema.""", json_schema_extra = { "linkml_meta": {'alias': 'class_derivations', + 'domain_of': ['TransformationSpecification', 'ObjectDerivation']} }) enum_derivations: Optional[Dict[str, EnumDerivation]] = Field(default=None, description="""Instructions on how to derive a set of enums in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'enum_derivations', 'domain_of': ['TransformationSpecification']} }) slot_derivations: Optional[Dict[str, SlotDerivation]] = Field(default=None, description="""Instructions on how to derive a set of top level slots in the target schema""", json_schema_extra = { "linkml_meta": {'alias': 'slot_derivations', 'domain_of': ['TransformationSpecification', 'ClassDerivation']} }) @@ -308,6 +309,13 @@ class AliasedClass(ConfiguredBaseModel): class_named: Optional[str] = Field(default=None, description="""local alias for the class""", json_schema_extra = { "linkml_meta": {'alias': 'class_named', 'domain_of': ['AliasedClass']} }) +class ObjectDerivation(ConfiguredBaseModel): + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://w3id.org/linkml/transformer'}) + + class_derivations: Optional[Dict[str, ClassDerivation]] = Field(default=None, description="""One or more class derivations.""", json_schema_extra = { "linkml_meta": {'alias': 'class_derivations', + 'domain_of': ['TransformationSpecification', 'ObjectDerivation']} }) + + class SlotDerivation(ElementDerivation): """ A specification of how to derive the value of a target slot from a source slot @@ -329,7 +337,7 @@ class SlotDerivation(ElementDerivation): 'SlotDerivation', 'EnumDerivation', 'PermissibleValueDerivation']} }) - object_derivations: Optional[Dict[str, ElementDerivation]] = Field(default=None, description="""One or more object derivations used to construct the slot value(s), which must be instances of a class.""", json_schema_extra = { "linkml_meta": {'alias': 'object_derivations', 'domain_of': ['SlotDerivation']} }) + object_derivations: Optional[List[ObjectDerivation]] = Field(default=None, description="""One or more object derivations used to construct the slot value(s), which must be instances of a class.""", json_schema_extra = { "linkml_meta": {'alias': 'object_derivations', 'domain_of': ['SlotDerivation']} }) derived_from: Optional[List[str]] = Field(default=None, description="""Source slots that are used to derive this slot. This can be computed from the expr, if the expr is declarative.""", json_schema_extra = { "linkml_meta": {'alias': 'derived_from', 'domain_of': ['SlotDerivation']} }) expr: Optional[str] = Field(default=None, description="""An expression to be evaluated on the source object to derive the target slot. Should be specified using the LinkML expression language.""", json_schema_extra = { "linkml_meta": {'alias': 'expr', 'domain_of': ['SlotDerivation', @@ -617,6 +625,7 @@ class CopyDirective(ConfiguredBaseModel): ElementDerivation.model_rebuild() ClassDerivation.model_rebuild() AliasedClass.model_rebuild() +ObjectDerivation.model_rebuild() SlotDerivation.model_rebuild() EnumDerivation.model_rebuild() PermissibleValueDerivation.model_rebuild() diff --git a/src/linkml_map/datamodel/transformer_model.yaml b/src/linkml_map/datamodel/transformer_model.yaml index cadb502..cb6f65e 100644 --- a/src/linkml_map/datamodel/transformer_model.yaml +++ b/src/linkml_map/datamodel/transformer_model.yaml @@ -232,6 +232,15 @@ classes: class_named: description: local alias for the class + ObjectDerivation: + attributes: + class_derivations: + description: >- + One or more class derivations. + range: ClassDerivation + multivalued: true + inlined: true + SlotDerivation: is_a: ElementDerivation description: A specification of how to derive the value of a target slot from a source slot From ecebc3c21c92439360326c8d748864c48e37228d Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Sat, 4 Oct 2025 08:37:06 +0300 Subject: [PATCH 5/5] Remove ObjectDerivation class from transformer model Deleted the ObjectDerivation class and its attributes from transformer_model.yaml, likely as part of a model simplification or refactor. --- src/linkml_map/datamodel/transformer_model.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/linkml_map/datamodel/transformer_model.yaml b/src/linkml_map/datamodel/transformer_model.yaml index bbd03d3..7751dd9 100644 --- a/src/linkml_map/datamodel/transformer_model.yaml +++ b/src/linkml_map/datamodel/transformer_model.yaml @@ -244,15 +244,6 @@ classes: class_named: description: local alias for the class - ObjectDerivation: - attributes: - class_derivations: - description: >- - One or more class derivations. - range: ClassDerivation - multivalued: true - inlined: true - SlotDerivation: is_a: ElementDerivation description: A specification of how to derive the value of a target slot from a source slot