CosmoTech_Acceleration_Library.Modelops.core.utils.model_util¶
ModelUtil
¶
Utility class for Redis management
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
convert_datetime_to_str(date)
staticmethod
¶
Convert a datetime to a str :param date: the datetime :return: the string representing the datetime
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
132 133 134 135 136 137 138 139 |
|
convert_str_to_datetime(date_str)
staticmethod
¶
Convert a datetime to a str :param date_str: the str representing a date :return: the datetime corresponding to date_str
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
141 142 143 144 145 146 147 148 149 |
|
create_index_query(entity_name, entity_property_name)
staticmethod
¶
Create an index query :param entity_name: the entity name on which you want to define an index :param entity_property_name: the entity property name on which you want to define an index :return: the create index query
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
51 52 53 54 55 56 57 58 59 |
|
create_relationship_query(relationship_type, properties)
staticmethod
¶
Create a relationship query :param relationship_type: the future relationship name :param properties: the properties of the relationship (should contain 'src' and 'dest' properties) :return: the create relationship query
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
create_twin_query(twin_type, properties)
staticmethod
¶
Create a twin query :param twin_type:the future twin name :param properties: the properties of the twin :return: the create twin query
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
61 62 63 64 65 66 67 68 69 70 71 72 |
|
dict_to_cypher_parameters(parameters)
staticmethod
¶
Convert a dict to usable Cypher parameters object :param parameters: parameters dict :return: string representing parameters as Cyper Parameters
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
dict_to_json(obj)
staticmethod
¶
Transform a dict to a json string :param obj: the dict :return: the json string corresponding
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
92 93 94 95 96 97 98 99 |
|
print_query_result(query_result)
staticmethod
¶
Pretty print a QueryResult :param query_result: the QueryResult to print
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
122 123 124 125 126 127 128 129 130 |
|
result_set_to_json(query_result)
staticmethod
¶
Transform a QueryResult object to a json string list :param query_result: the QueryResult object :return: the json string list
Source code in CosmoTech_Acceleration_Library/Modelops/core/utils/model_util.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|