diff --git a/linkml_model/model/schema/meta.yaml b/linkml_model/model/schema/meta.yaml index a4ca7060..98567e86 100644 --- a/linkml_model/model/schema/meta.yaml +++ b/linkml_model/model/schema/meta.yaml @@ -464,6 +464,14 @@ slots: description: >- The relationship between an element and its alias. + alias_contexts: + alias: contexts + domain: structured_alias + range: uri + multivalued: true + description: >- + The context in which an alias should be applied + in_language: slot_uri: schema:inLanguage range: string @@ -2131,6 +2139,27 @@ slots: in_subset: - SpecificationSubset + type_mappings: + range: type_mapping + description: >- + A collection of type mappings that specify how a slot's range should be mapped or + serialized in different frameworks + multivalued: true + + framework_key: + range: string + alias: framework + key: true + description: >- + The name of a format that can be used to serialize LinkML data. + The string value should be a code from the LinkML frameworks vocabulary, + but this is not strictly enforced + + mapped_type: + range: type_definition + alias: type + description: >- + type to coerce to # ----------------------------------- # Slots for type definition @@ -2763,6 +2792,7 @@ classes: - literal_form - alias_predicate - categories + - alias_contexts slot_usage: categories: description: >- @@ -2919,6 +2949,7 @@ classes: - disjoint_with - children_are_mutually_disjoint - union_of + - type_mappings slot_usage: is_a: range: slot_definition @@ -3181,6 +3212,20 @@ classes: - BasicSubset - RelationalModelProfile + type_mapping: + rank: 21 + description: Represents how a slot or type can be serialized to a format. + mixins: + - extensible + - annotatable + - common_metadata + slots: + - framework_key + - mapped_type + - string_serialization + in_subset: + - SpecificationSubset + # ================================== # Enumerations # # ================================== diff --git a/tests/input/examples/schema_definition-type_mappings-1.yaml b/tests/input/examples/schema_definition-type_mappings-1.yaml new file mode 100644 index 00000000..6a5aa305 --- /dev/null +++ b/tests/input/examples/schema_definition-type_mappings-1.yaml @@ -0,0 +1,43 @@ +id: https://example.org/serializations +name: serializations_example +title: Serializaations Example +description: |- + Example LinkML schema to demonstrate serialization exceptions. + + +prefixes: + linkml: https://w3id.org/linkml/ + example: https://example.org/ + +default_prefix: example + +imports: + - linkml:types + +classes: + + A: + attributes: + my_big_integer: + range: integer + type_mappings: + JSON: + type: string + description: we serialize this as a string because some json implementations may implement as doubles + PROTOBUF: + type: int64 + my_date: + range: date + type_mappings: + PYTHON: + type: string + examples: + - object: + my_big_integer: 12345678901234567890 + my_date: 2021-01-01 + + + + + +