@@ -31,7 +31,7 @@ def __init__(self, transaction):
31
31
self ._transaction = transaction
32
32
33
33
def get_root_thing_type (self ):
34
- return self .get_type ("thing" )
34
+ return self ._get_thing_type ("thing" )
35
35
36
36
def get_root_entity_type (self ):
37
37
return self .get_entity_type ("entity" )
@@ -51,7 +51,7 @@ def put_entity_type(self, label: str):
51
51
return EntityType ._of (res .put_entity_type_res .entity_type )
52
52
53
53
def get_entity_type (self , label : str ):
54
- _type = self .get_type (label )
54
+ _type = self ._get_thing_type (label )
55
55
return _type if _type .is_entity_type () else None
56
56
57
57
def put_relation_type (self , label : str ):
@@ -63,7 +63,7 @@ def put_relation_type(self, label: str):
63
63
return RelationType ._of (res .put_relation_type_res .relation_type )
64
64
65
65
def get_relation_type (self , label : str ):
66
- _type = self .get_type (label )
66
+ _type = self ._get_thing_type (label )
67
67
return _type if _type .is_relation_type () else None
68
68
69
69
def put_attribute_type (self , label : str , value_type ):
@@ -76,7 +76,7 @@ def put_attribute_type(self, label: str, value_type):
76
76
return concept_proto_reader .attribute_type (res .put_attribute_type_res .attribute_type )
77
77
78
78
def get_attribute_type (self , label : str ):
79
- _type = self .get_type (label )
79
+ _type = self ._get_thing_type (label )
80
80
return _type if _type .is_attribute_type () else None
81
81
82
82
def get_thing (self , iid : str ):
@@ -88,14 +88,14 @@ def get_thing(self, iid: str):
88
88
response = self ._execute (req )
89
89
return concept_proto_reader .thing (response .get_thing_res .thing ) if response .get_thing_res .WhichOneof ("res" ) == "thing" else None
90
90
91
- def get_type (self , label : str ):
91
+ def _get_thing_type (self , label : str ):
92
92
req = concept_proto .ConceptManager .Req ()
93
- get_type_req = concept_proto .ConceptManager .GetType .Req ()
94
- get_type_req .label = label
95
- req .get_type_req .CopyFrom (get_type_req )
93
+ get_thing_type_req = concept_proto .ConceptManager .GetThingType .Req ()
94
+ get_thing_type_req .label = label
95
+ req .get_thing_type_req .CopyFrom (get_thing_type_req )
96
96
97
97
response = self ._execute (req )
98
- return concept_proto_reader .type_ (response .get_type_res . type ) if response .get_type_res .WhichOneof ("res" ) == "type " else None
98
+ return concept_proto_reader .thing_type (response .get_thing_type_res . thing_type ) if response .get_thing_type_res .WhichOneof ("res" ) == "thing_type " else None
99
99
100
100
def _execute (self , request : concept_proto .ConceptManager .Req ):
101
101
req = transaction_proto .Transaction .Req ()
0 commit comments