4040 dict [str , Union ["JSON_LD_VALUE" , BASIC_TYPE , TIME_TYPE , "ld_dict" , "ld_list" ]],
4141]
4242""" Type description of valid JSON_LD objects that are partially represented by ld_containers """
43- PYTHONIZED_LD_CONTAINER : TypeAlias = Union [
44- list [Union ["PYTHONIZED_LD_CONTAINER " , BASIC_TYPE , TIME_TYPE ]],
45- dict [str , Union ["PYTHONIZED_LD_CONTAINER " , BASIC_TYPE , TIME_TYPE ]],
43+ NATIVE_LD_CONTAINER : TypeAlias = Union [
44+ list [Union ["NATIVE_LD_CONTAINER " , BASIC_TYPE , TIME_TYPE ]],
45+ dict [str , Union ["NATIVE_LD_CONTAINER " , BASIC_TYPE , TIME_TYPE ]],
4646]
47- """ Type description of the pythonized from of ld_containers (i.e. if the ld_container(s) is/ are replaced). """
47+ """ Type description of the native python version of ld_containers (i.e. if the ld_container(s) is/ are replaced). """
4848
4949
5050class ld_container :
@@ -147,21 +147,22 @@ def ld_value(self: Self) -> EXPANDED_JSON_LD_VALUE:
147147 """
148148 return self ._data
149149
150- def _to_python (
150+ def _to_native_python (
151151 self : Self ,
152152 full_iri : str ,
153153 ld_value : Union [EXPANDED_JSON_LD_VALUE , dict [str , EXPANDED_JSON_LD_VALUE ], list [str ], str ]
154154 ) -> Union ["ld_container" , BASIC_TYPE , TIME_TYPE ]:
155155 """
156- Returns a pythonized version of the given value pretending the value is in self and full_iri its key.
156+ Returns a native python version of the given value pretending the value is in self and full_iri its key.
157157
158158 Args:
159159 full_iri (str): The expanded iri of the key of ld_value / self (later if self is not a dictionary).
160160 ld_value (EXPANDED_JSON_LD_VALUE | dict[str, EXPANDED_JSON_LD_VALUE] | list[str] | str): The value thats
161- pythonized value is requested. ld_value has to be valid expanded JSON-LD if it were inside self._data.
161+ native python value is requested.
162+ ld_value has to be valid expanded JSON-LD if it were inside self._data.
162163
163164 Returns:
164- ld_dict | ld_list | BASIC_TYPE | TIME_TYPE: The pythonized value of the ld_value.
165+ ld_dict | ld_list | BASIC_TYPE | TIME_TYPE: The native python value of the ld_value.
165166 """
166167 if full_iri == "@id" :
167168 # values of key "@id" only have to be compacted
@@ -300,7 +301,7 @@ def __str__(self: Self) -> str:
300301 Returns:
301302 (str): The representation of self.
302303 """
303- return str (self .to_python ())
304+ return str (self .to_native_python ())
304305
305306 def compact (
306307 self : Self , context : Optional [Union [list [Union [JSON_LD_CONTEXT_DICT , str ]], JSON_LD_CONTEXT_DICT , str ]] = None
@@ -319,7 +320,7 @@ def compact(
319320 self .ld_value , context or self .context , {"documentLoader" : bundled_loader , "skipExpand" : True }
320321 )
321322
322- def to_python (self ):
323+ def to_native_python (self ):
323324 raise NotImplementedError ()
324325
325326 @classmethod
@@ -451,14 +452,14 @@ def is_typed_json_value(cls: type[Self], ld_value: Any) -> bool:
451452 def typed_ld_to_py (cls : type [Self ], data : list [dict [str , BASIC_TYPE ]], ** kwargs ) -> Union [BASIC_TYPE , TIME_TYPE ]:
452453 """
453454 Returns the value of the given expanded JSON-LD value containing a value type converted into that type.
454- Meaning the pythonized version of the JSON-LD value data is returned.
455+ Meaning the native python version of the JSON-LD value data is returned.
455456 ld_container.is_typed_ld_value(data) must return True.
456457
457458 Args:
458- data (list[dict[str, BASIC_TYPE]]): The value that is that is converted into its pythonized from .
459+ data (list[dict[str, BASIC_TYPE]]): The value that is that is converted into its native python version .
459460
460461 Returns:
461- BASIC_TYPE | TIME_TYPE: The pythonized version of data.
462+ BASIC_TYPE | TIME_TYPE: The native python version of data.
462463 """
463464 # FIXME: #434 dates are not returned as datetime/ date/ time but as string
464465 ld_value = data [0 ]['@value' ]
0 commit comments