Skip to content

Slot: string_serialization

Used on a slot that stores the string serialization of the containing object. The syntax follows python formatted strings, with slot names enclosed in {}s. These are expanded using the values of those slots.

We call the slot with the serialization the s-slot, the slots used in the {}s are v-slots. If both s-slots and v-slots are populated on an object then the value of the s-slot should correspond to the expansion.

Implementations of frameworks may choose to use this property to either (a) PARSE: implement automated normalizations by parsing denormalized strings into complex objects (b) GENERATE: implement automated to_string labeling of complex objects

For example, a Measurement class may have 3 fields: unit, value, and string_value. The string_value slot may have a string_serialization of {value}{unit} such that if unit=cm and value=2, the value of string_value shouldd be 2cm

URI: [linkml:string_serialization](https://w3id.org/linkml/string_serialization) ## Applicable Classes | Name | Description | Modifies Slot | | --- | --- | --- | | [Definition](Definition.md) | abstract base class for core metaclasses | no | | [TypeMapping](TypeMapping.md) | Represents how a slot or type can be serialized to a format | no | | [EnumDefinition](EnumDefinition.md) | an element whose instances must be drawn from a specified set of permissible ... | no | | [SlotDefinition](SlotDefinition.md) | an element that describes how instances are related to other instances | no | | [ClassDefinition](ClassDefinition.md) | an element whose instances are complex objects that may have slot-value assig... | no | ## Properties ### Type and Range | Property | Value | | --- | --- | | Range | [String](String.md) | | Domain | [Definition](Definition.md) | | Domain Of | [Definition](Definition.md), [TypeMapping](TypeMapping.md) | ### Cardinality and Requirements | Property | Value | | --- | --- | ## In Subsets * [SpecificationSubset](SpecificationSubset.md) ## See Also * [https://github.com/linkml/issues/128](https://github.com/linkml/issues/128) ## Identifier and Mapping Information ### Schema Source * from schema: https://w3id.org/linkml/meta ## Mappings | Mapping Type | Mapped Value | | --- | --- | | self | linkml:string_serialization | | native | linkml:string_serialization | ## LinkML Source
name: string_serialization
description: 'Used on a slot that stores the string serialization of the containing
  object. The syntax follows python formatted strings, with slot names enclosed in
  {}s. These are expanded using the values of those slots.

  We call the slot with the serialization the s-slot, the slots used in the {}s are
  v-slots. If both s-slots and v-slots are populated on an object then the value of
  the s-slot should correspond to the expansion.

  Implementations of frameworks may choose to use this property to either (a) PARSE:
  implement automated normalizations by parsing denormalized strings into complex
  objects (b) GENERATE: implement automated to_string labeling of complex objects

  For example, a Measurement class may have 3 fields: unit, value, and string_value.
  The string_value slot may have a string_serialization of {value}{unit} such that
  if unit=cm and value=2, the value of string_value shouldd be 2cm'
in_subset:
- SpecificationSubset
from_schema: https://w3id.org/linkml/meta
see_also:
- https://github.com/linkml/issues/128
rank: 1000
domain: definition
inherited: false
domain_of:
- definition
- type_mapping
range: string