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:
digraph inheritance5b4caf496b { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "NormDict" [URL="#schema_salad.ref_resolver.NormDict",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A Dict where all keys are normalized using the provided function."]; }dict
[str
,Union
[ruamel.yaml.comments.CommentedMap
,ruamel.yaml.comments.CommentedSeq
,str
,None
]]A Dict where all keys are normalized using the provided function.
- normalize
- __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 (Optional[rdflib.graph.Graph])
idx (Optional[schema_salad.utils.IdxType])
cache (Optional[schema_salad.utils.CacheType])
session (Optional[requests.sessions.Session])
fetcher_constructor (Optional[schema_salad.utils.FetcherCallableType])
skip_schemas (Optional[bool])
allow_attachments (Optional[schema_salad.utils.AttachmentsType])
salad_version (Optional[str])
- idx: schema_salad.utils.IdxType
- ctx: schema_salad.utils.ContextType
- graph
- foreign_properties
- cache
- skip_schemas
- fetcher_constructor
- fetcher
- fetch_text
- check_exists
- allow_attachments
- 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 exernal 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)