@@ -31,7 +31,7 @@ def __init__(self, transaction):
3131 self ._transaction = transaction
3232
3333 def get_root_thing_type (self ):
34- return self .get_type ("thing" )
34+ return self ._get_thing_type ("thing" )
3535
3636 def get_root_entity_type (self ):
3737 return self .get_entity_type ("entity" )
@@ -51,7 +51,7 @@ def put_entity_type(self, label: str):
5151 return EntityType ._of (res .put_entity_type_res .entity_type )
5252
5353 def get_entity_type (self , label : str ):
54- _type = self .get_type (label )
54+ _type = self ._get_thing_type (label )
5555 return _type if _type .is_entity_type () else None
5656
5757 def put_relation_type (self , label : str ):
@@ -63,7 +63,7 @@ def put_relation_type(self, label: str):
6363 return RelationType ._of (res .put_relation_type_res .relation_type )
6464
6565 def get_relation_type (self , label : str ):
66- _type = self .get_type (label )
66+ _type = self ._get_thing_type (label )
6767 return _type if _type .is_relation_type () else None
6868
6969 def put_attribute_type (self , label : str , value_type ):
@@ -76,7 +76,7 @@ def put_attribute_type(self, label: str, value_type):
7676 return concept_proto_reader .attribute_type (res .put_attribute_type_res .attribute_type )
7777
7878 def get_attribute_type (self , label : str ):
79- _type = self .get_type (label )
79+ _type = self ._get_thing_type (label )
8080 return _type if _type .is_attribute_type () else None
8181
8282 def get_thing (self , iid : str ):
@@ -88,14 +88,14 @@ def get_thing(self, iid: str):
8888 response = self ._execute (req )
8989 return concept_proto_reader .thing (response .get_thing_res .thing ) if response .get_thing_res .WhichOneof ("res" ) == "thing" else None
9090
91- def get_type (self , label : str ):
91+ def _get_thing_type (self , label : str ):
9292 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 )
9696
9797 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
9999
100100 def _execute (self , request : concept_proto .ConceptManager .Req ):
101101 req = transaction_proto .Transaction .Req ()
0 commit comments