triplemodel.namespaces

Namespace prefixes, CURIE expansion, and graph binding.

triplemodel.namespaces.expand_curie(curie, prefixes)[source]

Expand prefix:local to a full IRI; pass through absolute IRIs.

Return type:

str

Parameters:
triplemodel.namespaces.resolve_predicate(predicate, prefixes)[source]

Expand a predicate CURIE using prefixes when applicable.

Return type:

str

Parameters:
triplemodel.namespaces.bind_namespaces(graph, prefixes, *, strategy='core')[source]

Bind prefixes on graph for serialization (recorded for Turtle output).

Return type:

None

Parameters:
  • graph (_NamespaceBindable)

  • prefixes (dict[str, str])

  • strategy (Literal['core', 'none'])