API Reference

Idiomatic conversion between URIs and compact URIs (CURIEs).

Functions

chain(converters, *[, case_sensitive])

Chain several converters.

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.

get_version()

Get the curies version string.

load_prefix_map(prefix_map, **kwargs)

Get a converter from a simple prefix map.

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_shacl(data, **kwargs)

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

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.

get_obo_converter()

Get the latest OBO Foundry context.

get_prefixcommons_converter(name)

Get a Prefix Commons-maintained context.

get_monarch_converter()

Get the Prefix Commons-maintained Monarch context.

get_go_converter()

Get the Prefix Commons-maintained GO context.

get_bioregistry_converter([web])

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

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.

Classes

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

A cached prefix map data structure.

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

A record of some prefixes and their associated URI prefixes.

Records([root])

A list of records.

ReferenceTuple(prefix, identifier)

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

Reference(*, prefix, identifier)

A reference to an entity in a given identifier space.

DuplicateValueError(duplicates)

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

DuplicateURIPrefixes(duplicates)

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

DuplicatePrefixes(duplicates)

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