@@ -237,7 +237,7 @@ def _to_expanded_json(
237237 # while searching build a path such that it leads from the found ld_dicts ld_value to selfs data_dict/ item_list
238238 parent = self
239239 path = []
240- while parent . __class__ . __name__ not in ( "ld_dict" , "SoftwareMetadata" , "ld_merge_dict" ) :
240+ while not "ld_dict" in [ sub_cls . __name__ for sub_cls in type ( parent ). mro ()] :
241241 if parent .container_type == "@list" :
242242 path .extend (["@list" , 0 ])
243243 elif parent .container_type == "@graph" :
@@ -250,7 +250,7 @@ def _to_expanded_json(
250250 # if neither self nor any of its parents is a ld_dict:
251251 # create a dict with the key of the outer most parent of self and this parents ld_value as a value
252252 # this dict is stored in an ld_container and simulates the most minimal JSON-LD object possible
253- if parent . __class__ . __name__ not in ( "ld_dict" , "SoftwareMetadata" , "ld_merge_dict" ) :
253+ if not "ld_dict" in [ sub_cls . __name__ for sub_cls in type ( parent ). mro ()] :
254254 key = self .ld_proc .expand_iri (parent .active_ctx , parent .key )
255255 parent = ld_container ([{key : parent ._data }])
256256 path .append (0 )
@@ -277,7 +277,7 @@ def _to_expanded_json(
277277 [(new_key , temp ) for new_key in temp .keys () if isinstance (temp [new_key ], special_types )]
278278 )
279279 elif isinstance (temp , ld_container ):
280- if temp . __class__ . __name__ in ( "ld_list" , "ld_merge_list" ) and temp .container_type == "@set" :
280+ if "ld_list" in [ sub_cls . __name__ for sub_cls in type ( temp ). mro ()] and temp .container_type == "@set" :
281281 ref [key ] = temp ._data
282282 else :
283283 ref [key ] = temp ._data [0 ]
0 commit comments