Prefix Generator — linkml documentation

# Prefix Generator

## Overview

The prefix generator can be used to create a mapping between prefixes and URIs or IRIs. Prefixes are essentially shorthands or aliases to these longer URIs or IRIs. The aliases and their corresponding expansions are specified as key value pairs under the `prefixes` section of a LinkML schema. You can read more about prefixes and URIs, IRIs and CURIEs in the URIs and Mappings section of the docs.

## Example Output

personinfo.json personinfo.tsv

To generate a JSON style mapping, run:

    gen-prefix-map examples/personinfo.yaml --output examples/personinfo.json

To generate a simple TSV style mapping, run:

    gen-prefix-map examples/personinfo.yaml --output examples/personinfo.tsv

If you want to simply view the data in the format of your choice, use the `--format` option.

## Docs

### Command Line

#### gen-prefix-map

Generate jsonld @context definition from LinkML model

    gen-prefix-map [OPTIONS] YAMLFILE

Options

--base <base>

  Base URI for model

-o, --output <output>

  Output file path

-f, --format <format>

  Output format (default=json)

  Options

    json | tsv

--metadata, --no-metadata

  Include metadata in output (default=–metadata)

--useuris, --metauris

  Include metadata in output (default=–useuris)

-im, --importmap <importmap>

  Import mapping file

--log_level <log_level>

  Logging level (default=WARNING)

  Options

    CRITICAL | ERROR | WARNING | INFO | DEBUG

--mergeimports, --no-mergeimports

  Merge imports into source file (default=mergeimports)

Arguments

YAMLFILE

  Required argument

### Code