schema_salad.runtime ==================== .. py:module:: schema_salad.runtime .. autoapi-nested-parse:: Shared code for parsers generated by the Python codegen. See :option:`--codegen=python` & :py:mod:`python_codegen`. Attributes ---------- .. autoapisummary:: schema_salad.runtime.IdxType schema_salad.runtime.SaveableType schema_salad.runtime.save_type Classes ------- .. autoapisummary:: schema_salad.runtime.LoadingOptions schema_salad.runtime.Saveable Functions --------- .. autoapisummary:: schema_salad.runtime.extract_type schema_salad.runtime.convert_typing schema_salad.runtime.parse_errors schema_salad.runtime.save schema_salad.runtime.save_with_metadata schema_salad.runtime.file_uri schema_salad.runtime.prefix_url schema_salad.runtime.save_relative_uri schema_salad.runtime.shortname Module Contents --------------- .. py:type:: IdxType :canonical: MutableMapping[str, tuple[Any, 'LoadingOptions']] .. py:class:: LoadingOptions(fetcher = None, namespaces = None, schemas = None, fileuri = None, copyfrom = None, original_doc = None, addl_metadata = None, baseuri = None, idx = None, imports = None, includes = None, no_link_check = None, container = None) Class that holds the state of loading a SALAD document. .. py:attribute:: idx :type: Final[IdxType] .. py:attribute:: fileuri :type: Final[str | None] .. py:attribute:: baseuri :type: Final[str] .. py:attribute:: namespaces :type: Final[collections.abc.MutableMapping[str, str]] .. py:attribute:: schemas :type: Final[collections.abc.MutableSequence[str]] .. py:attribute:: original_doc :type: Final[Any | None] .. py:attribute:: addl_metadata :type: Final[collections.abc.MutableMapping[str, Any]] .. py:attribute:: fetcher :type: Final[schema_salad.fetcher.Fetcher] .. py:attribute:: vocab :type: Final[dict[str, str]] .. py:attribute:: rvocab :type: Final[dict[str, str]] .. py:attribute:: cache :type: Final[schema_salad.utils.CacheType] .. py:attribute:: imports :type: Final[list[str]] .. py:attribute:: includes :type: Final[list[str]] .. py:attribute:: no_link_check :type: Final[bool | None] .. py:attribute:: container :type: Final[str | None] .. py:property:: graph :type: rdflib.Graph Generate a merged rdflib.Graph from all entries in self.schemas. .. py:class:: Saveable Mark classes than have a save() and fromDoc() function. .. py:method:: fromDoc(_doc, baseuri, loadingOptions, docRoot = None) :classmethod: :abstractmethod: Construct this object from the result of yaml.load(). .. py:method:: save(top = False, base_url = '', relative_uris = True) :abstractmethod: Convert this object to a JSON/YAML friendly dictionary. .. py:data:: SaveableType .. py:type:: save_type :canonical: None | MutableMapping[str, Any] | MutableSequence[Any] | int | float | bool | str .. py:function:: extract_type(val_type) Take a type of value, and extracts the value as a string. .. py:function:: convert_typing(val_type) Normalize type names to schema-salad types. .. py:function:: parse_errors(error_message) Parse error messages from several loaders into one error message. .. py:function:: save(val, top = True, base_url = '', relative_uris = True) Convert an object to a JSON/YAML friendly dictionary. .. py:function:: save_with_metadata(val, valLoadingOpts, top = True, base_url = '', relative_uris = True) Save and set $namespaces, $schemas, $base and any other metadata fields at the top level. .. py:function:: file_uri(path, split_frag = False) Transform a file path into a URL with file scheme. .. py:function:: prefix_url(url, namespaces) Expand short forms into full URLs using the given namespace dictionary. .. py:function:: save_relative_uri(uri, base_url, scoped_id, ref_scope, relative_uris) Convert any URI to a relative one, obeying the scoping rules. .. py:function:: shortname(inputid) Compute the shortname of a fully qualified identifier. See https://w3id.org/cwl/v1.2/SchemaSalad.html#Short_names.