context
Implementation of the JSON-LD Context structure. See: http://json-ld.org/
Classes:
Attributes:
-
NODE_KEYS– -
Term– -
UNDEF– -
URI_GEN_DELIMS–
NODE_KEYS
module-attribute
Term
module-attribute
Term = namedtuple('Term', 'id, name, type, container, index, language, reverse, context,prefix, protected')
Context
Context(source: _ContextSourceType = None, base: Optional[str] = None, version: Optional[float] = 1.1)
Methods:
-
add_term– -
expand– -
find_term– -
get_context_for_term– -
get_context_for_type– -
get_graph– -
get_id– -
get_key– -
get_keys– -
get_language– -
get_list– -
get_rev– -
get_set– -
get_type– -
get_value– -
isblank– -
load– -
resolve– -
resolve_iri– -
shrink_iri– -
subcontext– -
to_dict–Returns a dictionary representation of the context that can be
-
to_symbol–
Attributes:
-
active– -
base(Optional[str]) – -
doc_base– -
graph_key– -
id_key– -
lang_key– -
language– -
list_key– -
parent(Optional[Context]) – -
propagate– -
rev_key– -
terms(Dict[str, Any]) – -
type_key– -
value_key– -
version(float) – -
vocab(Optional[str]) –
Source code in rdflib/plugins/shared/jsonld/context.py
add_term
add_term(name: str, idref: str, coercion: Union[Defined, str] = UNDEF, container: Union[Collection[Any], str, Defined] = UNDEF, index: Optional[Union[str, Defined]] = None, language: Optional[Union[str, Defined]] = UNDEF, reverse: bool = False, context: Any = UNDEF, prefix: Optional[bool] = None, protected: bool = False)
Source code in rdflib/plugins/shared/jsonld/context.py
expand
Source code in rdflib/plugins/shared/jsonld/context.py
find_term
find_term(idref: str, coercion: Optional[Union[str, Defined]] = None, container: Union[Defined, str] = UNDEF, language: Optional[str] = None, reverse: bool = False)
Source code in rdflib/plugins/shared/jsonld/context.py
get_context_for_term
get_context_for_type
get_context_for_type(node: Any) -> Optional[Context]
Source code in rdflib/plugins/shared/jsonld/context.py
get_graph
get_id
get_key
get_keys
get_language
get_list
get_rev
get_set
get_type
get_value
isblank
load
Source code in rdflib/plugins/shared/jsonld/context.py
resolve
Source code in rdflib/plugins/shared/jsonld/context.py
resolve_iri
shrink_iri
Source code in rdflib/plugins/shared/jsonld/context.py
subcontext
subcontext(source: Any, propagate: bool = True) -> Context
Source code in rdflib/plugins/shared/jsonld/context.py
to_dict
Returns a dictionary representation of the context that can be serialized to JSON.
Returns:
-
Dict[str, Any]–a dictionary representation of the context.
Source code in rdflib/plugins/shared/jsonld/context.py
to_symbol
Source code in rdflib/plugins/shared/jsonld/context.py
Defined
Bases: int