class documentation

class SchemaTransformer:

View In Hierarchy

Transforms schemas between legacy (old) and new format.

Class Method new_to_old Convert a new-format schema dict to the legacy format.
Class Method old_to_new Convert a legacy schema dict to the new format.
Static Method is_legacy_format Detect whether a schema dict uses the legacy format.
Constant DATATYPE_MAPPINGS Undocumented
Class Method _convert_class_new_to_old Undocumented
Class Method _convert_class_old_to_new Undocumented
Class Method _convert_property_new_to_old Undocumented
Class Method _convert_property_old_to_new Undocumented
@classmethod
def new_to_old(cls, schema: dict) -> dict:

Convert a new-format schema dict to the legacy format.

Parameters
schema:dictA new-format schema dictionary.
Returns
dictA legacy-format schema dictionary.
@classmethod
def old_to_new(cls, schema: dict) -> dict:

Convert a legacy schema dict to the new format.

Parameters
schema:dictA legacy-format schema dictionary.
Returns
dictA new-format schema dictionary.
@staticmethod
def is_legacy_format(schema: dict) -> bool:

Detect whether a schema dict uses the legacy format.

Parameters
schema:dictA schema dictionary.
Returns
boolTrue if schema uses the legacy (old) format.
DATATYPE_MAPPINGS: dict =

Undocumented

Value
{'text': {'id': 'urn:datagraphs:datatypes:text',
          'elasticsearchDatatype': 'text',
          'xsdDatatype': 'string'},
 'date': {'id': 'urn:datagraphs:datatypes:date',
          'elasticsearchDatatype': 'date',
          'xsdDatatype': 'date'},
 'datetime': {'id': 'urn:datagraphs:datatypes:datetime', 'elasticsearchDatatype'
...
@classmethod
def _convert_class_new_to_old(cls, class_def: dict, model_id: str, order: int) -> dict:

Undocumented

@classmethod
def _convert_class_old_to_new(cls, class_def: dict) -> dict:

Undocumented

@classmethod
def _convert_property_new_to_old(cls, prop_def: dict, model_id: str, class_name: str, order: int) -> dict:

Undocumented

@classmethod
def _convert_property_old_to_new(cls, prop_def: dict) -> dict:

Undocumented