Manage IRI prefix mappings.
fluree prefix <COMMAND>| Command | Description |
|---|---|
add <PREFIX> <IRI> |
Add a prefix mapping |
remove <PREFIX> |
Remove a prefix mapping |
list |
List all prefix mappings |
Manages IRI prefix mappings stored in .fluree/prefixes.json. These prefixes are used to expand compact IRIs in commands like history.
fluree prefix add ex http://example.org/
fluree prefix add foaf http://xmlns.com/foaf/0.1/
fluree prefix add schema https://schema.org/Output:
Added prefix: ex = <http://example.org/>
fluree prefix listOutput:
ex: <http://example.org/>
foaf: <http://xmlns.com/foaf/0.1/>
schema: <https://schema.org/>
If no prefixes are defined:
(no prefixes defined)
Add prefixes with: fluree prefix add <prefix> <iri>
Example: fluree prefix add ex http://example.org/
fluree prefix remove foafOutput:
Removed prefix: foaf
Once prefixes are defined, you can use compact IRIs:
# Instead of:
fluree history http://example.org/alice
# Use:
fluree history ex:aliceIRI namespaces should end with / or #:
# Good
fluree prefix add ex http://example.org/
fluree prefix add foaf http://xmlns.com/foaf/0.1/
# Warning (will still work but may cause issues)
fluree prefix add bad http://example.orgPrefixes are stored in .fluree/prefixes.json:
{
"ex": "http://example.org/",
"foaf": "http://xmlns.com/foaf/0.1/"
}