4747
4848class ld_container :
4949 """
50- Base class for Linked Data containers.
51-
50+ Base class for Linked Data containers.\n
5251 A linked data container impelements a view on the expanded form of an JSON-LD document.
5352 It allows to easily interacts them by hinding all the nesting and automatically mapping
5453 between different forms.
@@ -178,15 +177,13 @@ def _to_expanded_json(
178177 self : Self , value : JSON_LD_VALUE
179178 ) -> Union [EXPANDED_JSON_LD_VALUE , dict [str , EXPANDED_JSON_LD_VALUE ]]:
180179 """
181- Returns an expanded version of the given value.
182-
180+ Returns an expanded version of the given value.\n
183181 The item_list/ data_dict of self will be substituted with value.
184182 Value can be an ld_container or contain zero or more.
185183 Then the _data of the inner most ld_dict that contains or is self will be expanded
186184 using the JSON_LD-Processor.
187185 If self and none of self's parents is an ld_dict, use the key from outer most ld_list
188- to generate a minimal dict.
189-
186+ to generate a minimal dict.\n
190187 The result of this function is what value has turned into.
191188
192189 Args:
@@ -199,7 +196,7 @@ def _to_expanded_json(
199196 value will be expanded as if it was the data_dict/ the item_list of self.
200197
201198 Returns:
202- EXPANDED_JSON_LD_VALUE | dict[str, EXPANDED_JSON_LD_VALUE]:
199+ EXPANDED_JSON_LD_VALUE | dict[str, EXPANDED_JSON_LD_VALUE]:
203200 The expanded version of value i.e. the data_dict/ item_list of self if it had been value.
204201 The return type is based on the type of self:
205202
@@ -349,7 +346,7 @@ def merge_to_list(cls: type[Self], *args: tuple[Any]) -> list[Any]:
349346 @classmethod
350347 def is_ld_node (cls : type [Self ], ld_value : Any ) -> bool :
351348 """
352- Returns wheter the given value is considered to be possible of representing an expanded JSON-LD node.
349+ Returns wheter the given value is considered to be possible of representing an expanded JSON-LD node.\n
353350 I.e. if ld_value is of the form [{a: b, ..., y: z}].
354351
355352 Args:
@@ -364,7 +361,7 @@ def is_ld_node(cls: type[Self], ld_value: Any) -> bool:
364361 def is_ld_id (cls : type [Self ], ld_value : Any ) -> bool :
365362 """
366363 Returns wheter the given value is considered to be possible of representing an expanded JSON-LD node
367- containing only an @id value.
364+ containing only an @id value.\n
368365 I.e. if ld_value is of the form [{"@id": ...}].
369366
370367 Args:
@@ -378,7 +375,7 @@ def is_ld_id(cls: type[Self], ld_value: Any) -> bool:
378375 @classmethod
379376 def is_ld_value (cls : type [Self ], ld_value : Any ) -> bool :
380377 """
381- Returns wheter the given value is considered to be possible of representing an expanded JSON-LD value.
378+ Returns wheter the given value is considered to be possible of representing an expanded JSON-LD value.\n
382379 I.e. if ld_value is of the form [{"@value": a, ..., x: z}].
383380
384381 Args:
@@ -393,7 +390,7 @@ def is_ld_value(cls: type[Self], ld_value: Any) -> bool:
393390 def is_typed_ld_value (cls : type [Self ], ld_value : Any ) -> bool :
394391 """
395392 Returns wheter the given value is considered to be possible of representing an expanded JSON-LD value
396- containing a value type.
393+ containing a value type.\n
397394 I.e. if ld_value is of the form [{"@value": a, "@type": b, ..., x: z}].
398395
399396 Args:
@@ -408,7 +405,7 @@ def is_typed_ld_value(cls: type[Self], ld_value: Any) -> bool:
408405 def is_json_id (cls : type [Self ], ld_value : Any ) -> bool :
409406 """
410407 Returns wheter the given value is considered to be possible of representing a non-expanded JSON-LD node
411- containing only an @id value.
408+ containing only an @id value.\n
412409 I.e. if ld_value is of the form {"@id": ...}.
413410
414411 Args:
@@ -422,7 +419,7 @@ def is_json_id(cls: type[Self], ld_value: Any) -> bool:
422419 @classmethod
423420 def is_json_value (cls : type [Self ], ld_value : Any ) -> bool :
424421 """
425- Returns wheter the given value is considered to be possible of representing a non-expanded JSON-LD value.
422+ Returns wheter the given value is considered to be possible of representing a non-expanded JSON-LD value.\n
426423 I.e. if ld_value is of the form {"@value": b, ..., x: z}.
427424
428425 Args:
@@ -437,7 +434,7 @@ def is_json_value(cls: type[Self], ld_value: Any) -> bool:
437434 def is_typed_json_value (cls : type [Self ], ld_value : Any ) -> bool :
438435 """
439436 Returns wheter the given value is considered to be possible of representing a non-expanded JSON-LD value
440- containing a value type.
437+ containing a value type.\n
441438 I.e. if ld_value is of the form {"@value": a, "@type": b, ..., x: z}.
442439
443440 Args:
@@ -472,8 +469,7 @@ def are_values_equal(
472469 ) -> bool :
473470 """
474471 Returns whether or not the given expanded JSON-LD values are considered equal.
475- The comparison compares the "@id" values first and returns the result if it is conclusive.
476-
472+ The comparison compares the "@id" values first and returns the result if it is conclusive.\n
477473 If the comparison is inconclusive i.e. exactly one or zero of both values have an "@id" value:
478474 Return whether or not all other keys exist in both values and all values of the keys are the same.
479475
0 commit comments