load_jsonld_context

load_jsonld_context(data: str | Path | dict[str, Any], **kwargs: Any) Converter[source]

Get a converter from a JSON-LD object, which contains a prefix map in its @context key.

Parameters:
  • data – A JSON-LD object

  • kwargs – Keyword arguments to pass to curies.Converter.__init__()

Returns:

A converter

Example from a remote context file:

>>> base = "https://raw.githubusercontent.com"
>>> url = f"{base}/biopragmatics/bioregistry/main/exports/contexts/semweb.context.jsonld"
>>> converter = Converter.from_jsonld(url)
>>> "rdf" in converter.prefix_map