{"library":"prefixmaps","title":"Prefixmaps Library","description":"The `prefixmaps` library, currently at version 0.2.6, is a Python tool for managing and resolving semantic prefix maps, particularly for CURIEs (Compact URIs). It simplifies the expansion of short-form identifiers into full IRIs and vice versa, primarily by leveraging community-maintained prefix registries like those from OBO Foundry. Releases occur periodically to update prefix data and improve functionality.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install prefixmaps"],"cli":{"name":"prefixmaps","version":"sh: 1: prefixmaps: not found"}},"imports":["from prefixmaps import PrefixMap","from prefixmaps.io import load_jsonld_context"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from prefixmaps import PrefixMap\n\n# Initialize with the default OBO Foundry prefix map (loaded from the web)\npm = PrefixMap()\n\n# Expand a CURIE (Compact URI) to a full IRI\ncurie = \"GO:0008150\"\niri = pm.expand(curie)\nprint(f\"Expanded {curie} to: {iri}\")\n\n# Compress a full IRI to a CURIE (if a matching prefix is found)\nfull_iri = \"http://purl.obolibrary.org/obo/BFO_0000001\"\ncompressed_curie = pm.compress(full_iri)\nprint(f\"Compressed {full_iri} to: {compressed_curie}\")\n\n# Check if a prefix exists in the map\nprint(f\"Has prefix 'GO': {pm.has_prefix('GO')}\")\nprint(f\"Has prefix 'UNKNOWN': {pm.has_prefix('UNKNOWN')}\")","lang":"python","description":"Demonstrates initializing a PrefixMap, expanding a CURIE, compressing an IRI, and checking for prefix existence.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}