@@ -312,39 +312,6 @@ def _to_expanded_json(
312312
313313 return expanded_data
314314
315- # TODO: remove this method and all other unused methods/ functions
316- def _to_expanded_json_deprecated (self , key , value ):
317- if key == "@id" :
318- ld_value = self .ld_proc .expand_iri (self .active_ctx , value , vocab = False )
319- elif key == "@type" :
320- if not isinstance (value , list ):
321- value = [value ]
322- ld_value = [self .ld_proc .expand_iri (self .active_ctx , ld_type ) for ld_type in value ]
323- else :
324- short_key = self .ld_proc .compact_iri (self .active_ctx , key )
325- if ":" in short_key :
326- prefix , short_key = short_key .split (":" , 1 )
327- ctx_value = self .ld_proc .get_context_value (self .active_ctx , prefix , "@id" )
328- active_ctx = self .ld_proc .process_context (
329- self .active_ctx , [ctx_value ], {"documentLoader" : bundled_loader }
330- )
331- else :
332- active_ctx = self .active_ctx
333- ld_type = self .ld_proc .get_context_value (active_ctx , short_key , "@type" )
334- if ld_type == "@id" :
335- ld_value = [{"@id" : value }]
336- ld_output = "expanded_json"
337- else :
338- ld_value , ld_output = self .ld_proc .apply_typemap (value , "expanded_json" , "json" , parent = self , key = key )
339- if ld_output == "json" :
340- ld_value = self .ld_proc .expand (
341- ld_value , {"expandContext" : self .full_context , "documentLoader" : bundled_loader }
342- )
343- elif ld_output != "expanded_json" :
344- raise TypeError (f"Cannot convert { type (value )} " )
345-
346- return ld_value
347-
348315 def __repr__ (self : Self ) -> str :
349316 """
350317 Returns a short string representation of this object.
0 commit comments