@@ -131,7 +131,7 @@ def _load_types(self,force=False):
131
131
if sx :
132
132
shapes_to_load = rdfxml .xml_find_elements (sx , './/oslc:resourceShape' )
133
133
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" )
135
135
136
136
for el in shapes_to_load :
137
137
self ._load_type_from_resource_shape (el )
@@ -142,6 +142,7 @@ def _load_types(self,force=False):
142
142
raise Exception ( "services xml not found!" )
143
143
144
144
self .typesystem_loaded = True
145
+ burp
145
146
return None
146
147
147
148
# pick all the attributes from a resource shape definition
@@ -476,11 +477,9 @@ def _load_types(self,force=False):
476
477
if not found :
477
478
raise Exception ( "No empty service provider found!" )
478
479
sx = self .execute_get_rdf_xml ( spurl , intent = "Retrieve project/component service provider XML" )
479
-
480
480
if sx :
481
481
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" )
484
483
485
484
for el in shapes_to_load :
486
485
self ._load_type_from_resource_shape (el )
@@ -490,7 +489,6 @@ def _load_types(self,force=False):
490
489
491
490
else :
492
491
raise Exception ( "services xml not found!" )
493
-
494
492
return None
495
493
496
494
# pick all the attributes from a resource shape definition
@@ -613,7 +611,6 @@ def _generic_load_type_from_resource_shape(self, el, supershape=None):
613
611
if self .is_known_property_uri ( pd_u ,shape_uri = uri ,raiseifnotfound = False ):
614
612
logger .debug ( f"ALREADY KNOWN2" )
615
613
continue
616
-
617
614
logger .info ( f"Defining property { title } .{ property_title } { altname = } { pd_u = } +++++++++++++++++++++++++++++++++++++++" )
618
615
self .register_property (property_title ,pd_u , shape_uri = uri , altname = altname )
619
616
# check for any allowed value
@@ -699,3 +696,11 @@ def resolve_uri_to_name(self, uri, prefer_same_as=True, dontpreferhttprdfrui=Tru
699
696
result = self .get_uri_name (uri )
700
697
logger .info ( f"Result { result = } " )
701
698
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