API Reference

Idiomatic conversion between URIs and compact URIs (CURIEs).

Functions

chain(converters, *[, case_sensitive])

Chain several converters.

discover(uris, *[, delimiters, cutoff, ...])

Discover new URI prefixes and construct a converter with a unique dummy CURIE prefix for each.

discover_from_rdf(graph, *[, format])

Discover new URI prefixes from RDF content via rdflib.

get_bioregistry_converter([web])

Get the latest extended prefix map from the Bioregistry [hoyt2022].

get_go_converter()

Get the Prefix Commons-maintained GO context.

get_monarch_converter()

Get the Prefix Commons-maintained Monarch context.

get_obo_converter()

Get the latest OBO Foundry context.

get_prefixcommons_converter([name])

Get a Prefix Commons-maintained context.

get_version()

Get the curies version string.

load_extended_prefix_map(records, **kwargs)

Get a converter from a list of dictionaries by creating records out of them.

load_jsonld_context(data, **kwargs)

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

load_prefix_map(prefix_map, **kwargs)

Get a converter from a simple prefix map.

load_shacl(data, **kwargs)

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

remap_curie_prefixes(converter, remapping)

Apply CURIE prefix remappings.

remap_uri_prefixes(converter, remapping)

Apply URI prefix remappings.

rewire(converter, rewiring)

Apply URI prefix upgrades.

upgrade_prefix_map(prefix_map)

Convert a (potentially problematic) prefix map (i.e., not bijective) into a list of records.

write_extended_prefix_map(converter, path)

Write an extended prefix map as JSON to a file.

write_jsonld_context(converter, path, *[, ...])

Write the converter's bijective map as a JSON-LD context to a file.

write_shacl(converter, path, *[, ...])

Write the converter's bijective map as SHACL in turtle RDF to a file.

write_tsv(converter, path, *[, header])

Write a simple prefix map CSV file.

Classes

Converter(records, *[, delimiter, strict])

A cached prefix map data structure.

DuplicatePrefixes(duplicates)

An error raised with constructing a converter with data containing duplicate prefixes.

DuplicateURIPrefixes(duplicates)

An error raised with constructing a converter with data containing duplicate URI prefixes.

DuplicateValueError(duplicates)

An error raised with constructing a converter with data containing duplicate values.

NamedReference(*, prefix, identifier, name)

A reference with a name.

Record(*, prefix, uri_prefix, ...)

A record of some prefixes and their associated URI prefixes.

Records([root])

A list of records.

Reference(*, prefix, identifier)

A reference to an entity in a given identifier space.

ReferenceTuple(prefix, identifier)

A pair of a prefix (corresponding to a semantic space) and a local unique identifier in that semantic space.