schema_salad.jsonld_context

Attributes

ContextType

Exceptions

SchemaException

Indicates error with the provided schema definition.

Functions

aslist(thing)

Wrap single items and lists.

json_dumps(obj, **kwargs)

Force use of unicode.

pred(datatype, field, name, context, defaultBase, ...)

process_type(t, g, context, defaultBase, namespaces, ...)

salad_to_jsonld_context(j, schema_ctx)

fix_jsonld_ids(obj, ids)

Add missing identity entries.

makerdf(workflow, wf, ctx[, graph])

Module Contents

exception schema_salad.jsonld_context.SchemaException(msg, sl=None, children=None, bullet_for_children='')

Bases: SchemaSaladException

digraph inheritance08a6308b5c { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "SchemaException" [URL="../exceptions/index.html#schema_salad.exceptions.SchemaException",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="Indicates error with the provided schema definition."]; "SchemaSaladException" -> "SchemaException" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SchemaSaladException" [URL="../exceptions/index.html#schema_salad.exceptions.SchemaSaladException",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="Base class for all schema-salad exceptions."]; }

Indicates error with the provided schema definition.

Parameters:
schema_salad.jsonld_context.ContextType
schema_salad.jsonld_context.aslist(thing)

Wrap single items and lists.

Return lists unchanged.

Parameters:

thing (Any)

Return type:

MutableSequence[Any]

schema_salad.jsonld_context.json_dumps(obj, **kwargs)

Force use of unicode.

Parameters:
  • obj (Any)

  • kwargs (Any)

Return type:

str

schema_salad.jsonld_context.pred(datatype, field, name, context, defaultBase, namespaces)
Parameters:
Return type:

Union[Dict[str, Optional[str]], str]

schema_salad.jsonld_context.process_type(t, g, context, defaultBase, namespaces, defaultPrefix)
Parameters:
Return type:

None

schema_salad.jsonld_context.salad_to_jsonld_context(j, schema_ctx)
Parameters:
  • j (Iterable[MutableMapping[str, Any]])

  • schema_ctx (MutableMapping[str, Any])

Return type:

Tuple[schema_salad.utils.ContextType, rdflib.Graph]

schema_salad.jsonld_context.fix_jsonld_ids(obj, ids)

Add missing identity entries.

Parameters:
  • obj (Union[ruamel.yaml.comments.CommentedMap, float, str, ruamel.yaml.comments.CommentedSeq])

  • ids (List[str])

Return type:

None

schema_salad.jsonld_context.makerdf(workflow, wf, ctx, graph=None)
Parameters:
  • workflow (Optional[str])

  • wf (Union[ruamel.yaml.comments.CommentedMap, float, str, ruamel.yaml.comments.CommentedSeq])

  • ctx (schema_salad.utils.ContextType)

  • graph (Optional[rdflib.Graph])

Return type:

rdflib.Graph