schema_salad.ref_resolver
Classes
A Dict where all keys are normalized using the provided function. |
|
Functions
|
|
|
|
Convert ruamel.yaml exception to our type. |
|
|
Module Contents
- schema_salad.ref_resolver.file_uri(path, split_frag=False)
- schema_salad.ref_resolver.to_validation_exception(e)
Convert ruamel.yaml exception to our type.
- Parameters:
e (ruamel.yaml.error.MarkedYAMLError)
- Return type:
- class schema_salad.ref_resolver.NormDict(normalize=str)
Bases:
dict[str,ruamel.yaml.comments.CommentedMap | ruamel.yaml.comments.CommentedSeq | str | None]
A Dict where all keys are normalized using the provided function.
- Parameters:
normalize (collections.abc.Callable[[str], str])
- normalize: Final
- __getitem__(key)
Return self[key].
- Parameters:
key (Any)
- Return type:
Any
- __setitem__(key, value)
Set self[key] to value.
- Parameters:
key (Any)
value (Any)
- Return type:
Any
- __delitem__(key)
Delete self[key].
- Parameters:
key (Any)
- Return type:
Any
- __contains__(key)
True if the dictionary has the specified key, else False.
- Parameters:
key (Any)
- Return type:
- __del__()
- Return type:
None
- class schema_salad.ref_resolver.Loader(ctx, schemagraph=None, foreign_properties=None, idx=None, cache=None, session=None, fetcher_constructor=None, skip_schemas=None, url_fields=None, allow_attachments=None, doc_cache=True, salad_version=None)
- Parameters:
ctx (schema_salad.utils.ContextType)
schemagraph (rdflib.graph.Graph | None)
idx (schema_salad.utils.IdxType | None)
cache (schema_salad.utils.CacheType | None)
session (requests.sessions.Session | None)
fetcher_constructor (schema_salad.utils.FetcherCallableType | None)
skip_schemas (bool | None)
allow_attachments (schema_salad.utils.AttachmentsType | None)
salad_version (str | None)
- idx: schema_salad.utils.IdxType
- ctx: Final[schema_salad.utils.ContextType]
- graph
- foreign_properties: Final
- cache: Final
- skip_schemas: Final
- session
- fetcher_constructor: Final
- fetcher: Final
- fetch_text: Final
- check_exists: Final
- allow_attachments: Final = None
- salad_version: Final
- expand_url(url, base_url, scoped_id=False, vocab_term=False, scoped_ref=None)
- add_namespaces(ns)
Add the given namespace to our vocab list.
- add_schemas(ns, base_url)
Fetch external schemas and add them to the graph.
- add_context(newcontext)
- Parameters:
newcontext (schema_salad.utils.ContextType)
- Return type:
None
- resolve_ref(ref, base_url=None, checklinks=True, strict_foreign_properties=False, content_types=None)
- resolve_all(document, base_url, file_base=None, checklinks=True, strict_foreign_properties=False)
- fetch(url, inject_ids=True, content_types=None)
- validate_scoped(field, link, docid)
- validate_link(field, link, docid, all_doc_ids)