|
21 | 21 |
|
22 | 22 | import graknprotocol.protobuf.concept_pb2 as concept_proto |
23 | 23 |
|
24 | | -from grakn.concept.proto import concept_proto_builder |
| 24 | +from grakn.concept.proto import concept_proto_builder, concept_proto_reader |
25 | 25 | from grakn.concept.thing.thing import Thing, RemoteThing |
26 | 26 |
|
27 | 27 |
|
@@ -83,7 +83,7 @@ def __init__(self, iid: str, value: bool): |
83 | 83 |
|
84 | 84 | @staticmethod |
85 | 85 | def _of(thing_proto: concept_proto.Thing): |
86 | | - return BooleanAttribute(thing_proto.iid.hex(), thing_proto.value.boolean) |
| 86 | + return BooleanAttribute(concept_proto_reader.iid(thing_proto.iid), thing_proto.value.boolean) |
87 | 87 |
|
88 | 88 | def get_value(self): |
89 | 89 | return self._value |
@@ -119,7 +119,7 @@ def __init__(self, iid: str, value: int): |
119 | 119 |
|
120 | 120 | @staticmethod |
121 | 121 | def _of(thing_proto: concept_proto.Thing): |
122 | | - return LongAttribute(thing_proto.iid.hex(), thing_proto.value.long) |
| 122 | + return LongAttribute(concept_proto_reader.iid(thing_proto.iid), thing_proto.value.long) |
123 | 123 |
|
124 | 124 | def get_value(self): |
125 | 125 | return self._value |
@@ -155,7 +155,7 @@ def __init__(self, iid: str, value: float): |
155 | 155 |
|
156 | 156 | @staticmethod |
157 | 157 | def _of(thing_proto: concept_proto.Thing): |
158 | | - return DoubleAttribute(thing_proto.iid.hex(), thing_proto.value.double) |
| 158 | + return DoubleAttribute(concept_proto_reader.iid(thing_proto.iid), thing_proto.value.double) |
159 | 159 |
|
160 | 160 | def get_value(self): |
161 | 161 | return self._value |
@@ -191,7 +191,7 @@ def __init__(self, iid: str, value: str): |
191 | 191 |
|
192 | 192 | @staticmethod |
193 | 193 | def _of(thing_proto: concept_proto.Thing): |
194 | | - return StringAttribute(thing_proto.iid.hex(), thing_proto.value.string) |
| 194 | + return StringAttribute(concept_proto_reader.iid(thing_proto.iid), thing_proto.value.string) |
195 | 195 |
|
196 | 196 | def get_value(self): |
197 | 197 | return self._value |
@@ -227,7 +227,7 @@ def __init__(self, iid: str, value: datetime): |
227 | 227 |
|
228 | 228 | @staticmethod |
229 | 229 | def _of(thing_proto: concept_proto.Thing): |
230 | | - return DateTimeAttribute(thing_proto.iid.hex(), datetime.fromtimestamp(float(thing_proto.value.date_time) / 1000.0)) |
| 230 | + return DateTimeAttribute(concept_proto_reader.iid(thing_proto.iid), datetime.fromtimestamp(float(thing_proto.value.date_time) / 1000.0)) |
231 | 231 |
|
232 | 232 | def get_value(self): |
233 | 233 | return self._value |
|
0 commit comments