@@ -131,7 +131,7 @@ def _load_types(self,force=False):
131131 if sx :
132132 shapes_to_load = rdfxml .xml_find_elements (sx , './/oslc:resourceShape' )
133133
134- pbar = tqdm .tqdm (initial = 0 , total = len (shapes_to_load ),smoothing = 1 ,unit = " results" ,desc = "Loading ETM shapes" )
134+ pbar = tqdm .tqdm (initial = 0 , total = len (shapes_to_load ),smoothing = 1 ,unit = " results" ,desc = "Loading GCM project shapes" )
135135
136136 for el in shapes_to_load :
137137 self ._load_type_from_resource_shape (el )
@@ -142,6 +142,7 @@ def _load_types(self,force=False):
142142 raise Exception ( "services xml not found!" )
143143
144144 self .typesystem_loaded = True
145+ burp
145146 return None
146147
147148# pick all the attributes from a resource shape definition
@@ -476,11 +477,9 @@ def _load_types(self,force=False):
476477 if not found :
477478 raise Exception ( "No empty service provider found!" )
478479 sx = self .execute_get_rdf_xml ( spurl , intent = "Retrieve project/component service provider XML" )
479-
480480 if sx :
481481 shapes_to_load = rdfxml .xml_find_elements (sx , './/oslc:resourceShape' )
482-
483- pbar = tqdm .tqdm (initial = 0 , total = len (shapes_to_load ),smoothing = 1 ,unit = " results" ,desc = "Loading GCM shapes" )
482+ pbar = tqdm .tqdm (initial = 0 , total = len (shapes_to_load ),smoothing = 1 ,unit = " results" ,desc = "Loading GCM app shapes" )
484483
485484 for el in shapes_to_load :
486485 self ._load_type_from_resource_shape (el )
@@ -490,7 +489,6 @@ def _load_types(self,force=False):
490489
491490 else :
492491 raise Exception ( "services xml not found!" )
493-
494492 return None
495493
496494 # pick all the attributes from a resource shape definition
@@ -613,7 +611,6 @@ def _generic_load_type_from_resource_shape(self, el, supershape=None):
613611 if self .is_known_property_uri ( pd_u ,shape_uri = uri ,raiseifnotfound = False ):
614612 logger .debug ( f"ALREADY KNOWN2" )
615613 continue
616-
617614 logger .info ( f"Defining property { title } .{ property_title } { altname = } { pd_u = } +++++++++++++++++++++++++++++++++++++++" )
618615 self .register_property (property_title ,pd_u , shape_uri = uri , altname = altname )
619616 # check for any allowed value
@@ -699,3 +696,11 @@ def resolve_uri_to_name(self, uri, prefer_same_as=True, dontpreferhttprdfrui=Tru
699696 result = self .get_uri_name (uri )
700697 logger .info ( f"Result { result = } " )
701698 return result
699+
700+ # for OSLC query, given an attribute (property) name return its type URI
701+ # the context is the shape definition - can be None, needed to be specified ultimately by the user when property names aren't unique
702+ def resolve_property_name_to_uri (self , name , shapeuri = None , exception_if_not_found = True ):
703+ logger .info ( f"resolve_property_name_to_uri { name = } { shapeuri = } " )
704+ result = self .get_property_uri (name ,shape_uri = shapeuri )
705+ logger .info ( f"resolve_property_name_to_uri { name = } { shapeuri = } { result = } " )
706+ return result
0 commit comments