Skip to content

Commit 0999f44

Browse files
committed
Delete deprecated function
1 parent 504a345 commit 0999f44

2 files changed

Lines changed: 1 addition & 34 deletions

File tree

src/hermes/model/types/ld_container.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

src/hermes/model/types/ld_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __setitem__(
137137
if not isinstance(index, slice):
138138
# expand the value
139139
value = self._to_expanded_json([value])
140-
# the returned value is always a list but my contain more then one item
140+
# the returned value is always a list but may contain more then one item
141141
# therefor a slice on the item_list is used to add the expanded value(s)
142142
if index != -1:
143143
self.item_list[index:index+1] = value

0 commit comments

Comments
 (0)