linkml generate
#
Summary#
See the individual generator pages,
or run linkml generate {format} --help
for additional usage information
linkml generate#
Generate formats from a LinkML schema
linkml generate [OPTIONS] COMMAND [ARGS]...
Options
- -V, --version#
Show the version and exit.
Commands
- cli
Generate typescript interfaces and types
- csv
Generate CSV/TSV file from LinkML model
- doc
Generate documentation folder from a…
- erdiagram
Generate a mermaid ER diagram from a schema.
- excel
Generate Excel representation of a LinkML…
- golang
Generate Golang types
- golr-views
Generate GOLR representation of a LinkML…
- graphql
Generate graphql representation of a…
- graphviz
Generate graphviz representations of the…
- java
Generate java classes to represent a…
- json-schema
Generate JSON Schema representation of a…
- jsonld
Generate JSONLD file from LinkML schema.
- jsonld-context
Generate jsonld @context definition from…
- linkml
- markdown
Generate markdown documentation of a…
- namespaces
Generate a namespace manager for all of…
- owl
Generate an OWL representation of a LinkML…
- plantuml
Generate a UML representation of a LinkML…
- prefix-map
Generate jsonld @context definition from…
- project
Generate an entire project LinkML schema
- proto
Generate proto representation of LinkML model
- pydantic
Generate pydantic classes to represent a…
- python
Generate python classes to represent a…
- rdf
Generate an RDF representation of a LinkML…
- shacl
Generate SHACL turtle from a LinkML model
- shex
Generate a ShEx Schema for a LinkML model
- sparql
Generate SPARQL queries for validation
- sqla
Generate SQL DDL representation
- sqltables
Generate SQL DDL representation
- sssom
Generate SSSOM TSV to represent a LinkML…
- summary
Generate TSV summary files for viewing in…
- terminusdb
Generate graphql representation of a…
- yaml
Validate input and produce fully resolved…
- yuml
Generate a UML representation of a LinkML…
Complete#
You’ll probably need to use the side navigation bar…
Note
The command isn’t actually linkml generate (full)
it’s just a quirk of the package we use for documenting the cli
linkml generate (full)#
Generate formats from a LinkML schema
linkml generate (full) [OPTIONS] COMMAND [ARGS]...
Options
- -V, --version#
Show the version and exit.
cli#
Generate typescript interfaces and types
See https://github.com/linkml/linkml-runtime.js
linkml generate (full) cli [OPTIONS] YAMLFILE
Options
- --output <output>#
- --include-induced-slots#
Generate slots induced through inheritance
- -u, --gen-type-utils#
Generate Type checking utils
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'text'
- Options:
text
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
csv#
Generate CSV/TSV file from LinkML model
linkml generate (full) csv [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- -r, --root <root>#
Class(es) to transform
- -f, --format <format>#
Output format
- Default:
'csv'
- Options:
csv | tsv
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
doc#
Generate documentation folder from a LinkML YAML schema
Currently a default set of templates for markdown is provided (see the folder linkml/generators/docgen/)
If you specify another format (e.g. html) then you need to provide a template_directory argument, with a template for each type of entity inside.
Examples can optionally be integrated into the documentation; to enable this, pass in the –example-directory argument. The example directory should contain one file per example, following the naming convention <ClassName>-<ExampleName>.<extension>.
For example, to include examples on the page for Person, include examples
Person-001.yaml, Person-002.yaml, etc.
Currently examples must be in yaml
linkml generate (full) doc [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- --subfolder-type-separation, --no-subfolder-type-separation#
Separate type (class, slot, etc.) outputs in different subfolders for navigation purposes
- -d, --include <include>#
Include LinkML Schema outside of imports mechanism. Helpful in including deprecated classes and slots in a separate YAML, and including it when necessary but not by default (e.g. in documentation or for backwards compatibility)
- --example-directory <example_directory>#
Folder in which example files are found. These are used to make inline examples
- --render-imports, --no-render-imports#
Render also the documentation of elements from imported schemas
- Default:
False
- --hierarchical-class-view, --no-hierarchical-class-view#
Render class table on index page in a hierarchically indented view
- --use-class-uris, --no-use-class-uris#
Use IDs from class_uri instead of names
- --use-slot-uris, --no-use-slot-uris#
Use IDs from slot_uri instead of names
- --template-directory <template_directory>#
Folder in which custom templates are kept
- --genmeta, --no-genmeta#
Generating metamodel. Only use this for generating meta.py
- Default:
False
- --sort-by <sort_by>#
Metaslot to use to sort elements by e.g. rank, name, title
- Default:
'name'
- --include-top-level-diagram, --no-include-top-level-diagram#
Include ER diagram of the entire schema on index page.
- Default:
False
- --diagram-type <diagram_type>#
Type of UML diagram to be rendered on class documentation pages.
- Options:
mermaid_class_diagram | plantuml_class_diagram | er_diagram
- --dialect <dialect>#
Dialect or ‘flavor’ of Markdown used.
- --index-name <index_name>#
Name of the index document.
- Default:
'index'
- -d, --directory <directory>#
Required Folder to which document files are written
- -f, --format <format>#
Output format
- Default:
'markdown'
- Options:
markdown | rst | html | latex
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
erdiagram#
Generate a mermaid ER diagram from a schema.
By default, all entities traversable from the tree_root are included. If no tree_root is present, then all entities are included.
To create an ER diagram for selected classes, use the –classes option.
linkml generate (full) erdiagram [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- --include-upstream#
Include upstream classes
- -c, --classes <classes>#
List of classes to serialize
- --max-hops <max_hops>#
Maximum number of hops
- -f, --format <format>#
- Options:
markdown | mermaid
- --follow-references, --no-follow-references#
If True, follow references even if not inlined
- --exclude-attributes, --no-exclude-attributes#
If True, do not include attributes in entities
- --structural, --no-structural#
If True, then only the tree_root and entities reachable from the root are drawn
- -f, --format <format>#
Output format
- Default:
'markdown'
- Options:
markdown | mermaid
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
excel#
Generate Excel representation of a LinkML model
linkml generate (full) excel [OPTIONS] YAMLFILE
Options
- --split-workbook-by-class#
Split model into separate Excel workbooks/files, one for each class
- --include-mixins#
Include mixin classes in the generated Excel workbook/workbooks
- -o, --output <output>#
Name of Excel spreadsheet to be created, or name of directory to create split workbooks in
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'xlsx'
- Options:
xlsx
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
golang#
Generate Golang types
This very simple generator produces a Golang package named after the given schema with structs that implement the classes in that schema.
linkml generate (full) golang [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'text'
- Options:
text
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
golr-views#
Generate GOLR representation of a LinkML model
linkml generate (full) golr-views [OPTIONS] YAMLFILE
Options
- -d, --dir <dir>#
Output directory
- Default:
'golr-views'
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'golr'
- Options:
golr
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
graphql#
Generate graphql representation of a LinkML model
linkml generate (full) graphql [OPTIONS] YAMLFILE
Options
- --strict-naming#
Treat warnings about invalid names or schema elements as errors.
- Default:
False
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'graphql'
- Options:
graphql
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
graphviz#
Generate graphviz representations of the LinkML model
linkml generate (full) graphviz [OPTIONS] YAMLFILE
Options
- -d, --directory <directory>#
Output directory - if supplied, a graph per class will be generated
- -o, --out <out>#
Target file – if supplied, one large graph will be generated
- -c, --classname <classname>#
Class(es) to transform
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'png'
- Options:
png | bmp | canon | cgimage | cmap | cmapx | cmapx_np | dot | dot_json | eps | exr | fig | gd | gd2 | gif | gtk | gv | ico | imap | imap_np | ismap | jp2 | jpe | jpeg | jpg | json | json0 | pct | pdf | pic | pict | plain | plain-ext | png | pov | ps | ps2 | psd | sgi | svg | svgz | tga | tif | tiff | tk | vml | vmlz | vrml | wbmp | webp | x11 | xdot | xdot1.2 | xdot1.4 | xdot_json | xlib
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
java#
Generate java classes to represent a LinkML model
linkml generate (full) java [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- --generate-records, --no-generate-records#
Optional Java 17 record implementation
- --template-file <template_file>#
Optional jinja2 template to use for class generation
- --package <package>#
Package name where relevant for generated class files
- --output-directory <output_directory>#
Output directory for individually generated class files
- Default:
'output'
- -f, --format <format>#
Output format
- Default:
'java'
- Options:
java
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
json-schema#
Generate JSON Schema representation of a LinkML model
linkml generate (full) json-schema [OPTIONS] YAMLFILE
Options
- -i, --inline#
Generate references to types rather than inlining them. Note that declaring a slot as inlined: true will always inline the class
- -t, --top-class <top_class>#
Top level class; slots of this class will become top level properties in the json-schema
- --not-closed, --closed#
Set additionalProperties=False if closed otherwise true if not closed at the global level
- Default:
True
- --include-range-class-descendants, --no-range-class-descendants#
When handling range constraints, include all descendants of the range class instead of just the range class
- --indent <indent>#
If this is a positive number the resulting JSON will be pretty-printed with that indent level. Set to 0 to disable pretty-printing and return the most compact JSON representation
- Default:
4
- --title-from <title_from>#
Specify from which slot are JSON Schema ‘title’ annotations generated.
- Options:
name | title
- -d, --include <include>#
Include LinkML Schema outside of imports mechanism. Helpful in including deprecated classes and slots in a separate YAML, and including it when necessary but not by default (e.g. in documentation or for backwards compatibility)
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'json'
- Options:
json
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
jsonld#
Generate JSONLD file from LinkML schema.
Status: incomplete
linkml generate (full) jsonld [OPTIONS] YAMLFILE
Options
- --context <context>#
JSONLD context file (default: https://w3id.org/linkml/meta.context.jsonld and <model>.prefixes.context.jsonld)
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'jsonld'
- Options:
jsonld | json
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
jsonld-context#
Generate jsonld @context definition from LinkML model
linkml generate (full) jsonld-context [OPTIONS] YAMLFILE
Options
- --base <base>#
Base URI for model
- --prefixes, --no-prefixes#
Emit context for prefixes (default=–prefixes)
- Default:
True
- --model, --no-model#
Emit context for model elements (default=–model)
- Default:
True
- --flatprefixes, --no-flatprefixes#
Emit non-JSON-LD compliant prefixes as an object (deprecated: use gen-prefix-map instead).
- Default:
False
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'context'
- Options:
context | json
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
linkml#
linkml generate (full) linkml [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- -o, --output <output>#
Name of JSON or YAML file to be created
- --materialize-patterns, --no-materialize-patterns#
Materialize structured patterns as patterns
- Default:
True
- --materialize-attributes, --no-materialize-attributes#
Materialize induced slots as attributes
- Default:
True
- --materialize, --no-materialize#
Materialize both, induced slots as attributes and structured patterns as patterns
- Default:
True
- -f, --format <format>#
Output format
- Default:
'json'
- Options:
json | yaml
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
markdown#
Generate markdown documentation of a LinkML model
linkml generate (full) markdown [OPTIONS] YAMLFILE
Options
- -d, --dir <dir>#
Required Output directory
- -c, --classes <classes>#
Class(es) to emit
- -M, --map-fields <map_fields>#
Map metamodel fields, e.g. slot=field
- -i, --img#
Download YUML images to ‘image’ directory
- -I, --index-file <index_file>#
Name of markdown file that holds index
- --noimages#
Do not (re-)generate images
- --noyuml#
Do not add yUML figures to pages
- --notypesdir#
Do not create a separate types directory
- --warnonexist#
Warn if output file already exists
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'md'
- Options:
md
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
namespaces#
Generate a namespace manager for all of the prefixes represented in a LinkML model
linkml generate (full) namespaces [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'py'
- Options:
py
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
owl#
Generate an OWL representation of a LinkML model
Generate OWL using default parameters:
gen-owl my_schema.yaml
Note that in previous versions of this generator, the default was to use type objects and to include metaclasses. To restore this behavior:
gen-owl –metaclasses –type-objects my_schema.yaml
For more info, see: https://linkml.io/linkml/generators/owl
linkml generate (full) owl [OPTIONS] YAMLFILE
Options
- -o, --output <output>#
Output file name
- --metadata-profile <metadata_profile>#
What kind of metadata profile to use for annotations on generated OWL objects
- Default:
'linkml'
- Options:
linkml | rdfs | ols
- --type-objects, --no-type-objects#
If true, will model linkml types as objects, not literals
- Default:
False
- --metaclasses, --no-metaclasses#
If true, include linkml metamodel classes as metaclasses. Note this introduces punning in OWL-DL
- Default:
False
- --add-root-classes, --no-add-root-classes#
If true, include linkml metamodel classes as superclasses.
- Default:
False
- --add-ols-annotations, --no-add-ols-annotations#
If true, auto-include annotations from https://www.ebi.ac.uk/ols/docs/installation-guide
- Default:
True
- --ontology-uri-suffix <ontology_uri_suffix>#
Suffix to append to schema id to generate OWL Ontology IRI
- Default:
'.owl.ttl'
- --assert-equivalent-classes, --no-assert-equivalent-classes#
If true, add owl:equivalentClass between a class and a class_uri
- Default:
False
- --mixins-as-expressions, --no-mixins-as-expressions#
If true, then mixins are represented as existential expressions
- Default:
False
- --use-native-uris, --no-use-native-uris#
Use model URIs rather than class/slot URIs
- Default:
True
- --default-permissible-value-type <default_permissible_value_type>#
Default OWL type for permissible values
- Default:
'http://www.w3.org/2002/07/owl#Class'
- --enum-iri-separator <enum_iri_separator>#
IRI separator for enums.
- Default:
'#'
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'owl'
- Options:
owl | ttl | json-ld | xml | n3 | turtle | ttl | ntriples | nt | nt11 | nquads | trix | trig | hext | patch
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
plantuml#
Generate a UML representation of a LinkML model
linkml generate (full) plantuml [OPTIONS] YAMLFILE
Options
- -c, --classes <classes>#
Class(es) to emit
- -d, --directory <directory>#
Output directory - if supplied, PlantUML rendering will be saved in file
- -k, --kroki-server <kroki_server>#
URL of the Kroki server to use for diagram drawing
- --dry-run#
Print out Kroki URL calls instead of sending the real requests
- Default:
False
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'puml'
- Options:
puml | plantuml | png | pdf | jpg | json | svg
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
prefix-map#
Generate jsonld @context definition from LinkML model
linkml generate (full) prefix-map [OPTIONS] YAMLFILE
Options
- --base <base>#
Base URI for model
- -o, --output <output>#
Output file path
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'json'
- Options:
json | tsv
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
project#
Generate an entire project LinkML schema
Generate all downstream artefacts using default configuration:
Exclusion lists: all except ShEx:
Inclusion lists: only jsonschema and python:
Configuration, on command line:
Configuration, via yaml file:
config.yaml:
linkml generate (full) project [OPTIONS] YAMLFILE
Options
- -d, --dir <dir>#
directory in which to place generated files. E.g. linkml_model, biolink_model
- -A, --generator-arguments <generator_arguments>#
yaml configuration for generators
- -C, --config-file <config_file>#
path to yaml configuration
- -X, --exclude <exclude>#
list of artefacts to be excluded
- -I, --include <include>#
list of artefacts to be included. If not set, defaults to all
- --mergeimports, --no-mergeimports#
Merge imports into source file
- Default:
True
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -V, --version#
Show the version and exit.
Arguments
- YAMLFILE#
Required argument
proto#
Generate proto representation of LinkML model
linkml generate (full) proto [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'proto'
- Options:
proto
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
pydantic#
Generate pydantic classes to represent a LinkML model
linkml generate (full) pydantic [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- --meta <meta>#
How to include linkml schema metadata in generated pydantic classes. See docs for MetadataMode for full description of choices. Default (auto) is to include all metadata that can’t be otherwise represented
- Options:
MetadataMode.FULL | MetadataMode.EXCEPT_CHILDREN | MetadataMode.AUTO | MetadataMode.NONE
- --black#
Format generated models with black (must be present in the environment)
- --extra-fields <extra_fields>#
How to handle extra fields in BaseModel.
- Options:
allow | ignore | forbid
- --array-representations <array_representations>#
List of array representations to accept for array slots. Default is list of lists.
- Options:
list | numpydantic
- --template-dir <template_dir>#
Optional jinja2 template directory to use for class generation.
Pass a directory containing templates with the same name as any of the default
PydanticTemplateModel
templates to override them. The given directory will be searched for matching templates, and use the default templates as a fallback if an override is not foundAvailable templates to override:
- attribute.py.jinja- base_model.py.jinja- class.py.jinja- conditional_import.py.jinja- enum.py.jinja- imports.py.jinja- module.py.jinja- validator.py.jinja
- -f, --format <format>#
Output format
- Default:
'pydantic'
- Options:
pydantic
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
python#
Generate python classes to represent a LinkML model
linkml generate (full) python [OPTIONS] YAMLFILE
Options
- --head, --no-head#
Emit metadata heading
- Default:
True
- --genmeta, --no-genmeta#
Generating metamodel. Only use this for generating meta.py
- Default:
False
- --classvars, --no-classvars#
Generate CLASSVAR info
- Default:
True
- --slots, --no-slots#
Generate Slot information
- Default:
True
- --validate, --no-validate#
Validate generated code by compiling it
- Default:
False
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'py'
- Options:
py
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
rdf#
Generate an RDF representation of a LinkML model
linkml generate (full) rdf [OPTIONS] YAMLFILE
Options
- -o, --output <output>#
Output file name
- --context <context>#
JSONLD context file (default: https://w3id.org/linkml/meta.context.jsonld)
- Default:
'https://w3id.org/linkml/meta.context.jsonld'
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'ttl'
- Options:
ttl | hext | json-ld | n3 | nquads | nt | nt11 | ntriples | patch | trig | trix | ttl | turtle | xml
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
shacl#
Generate SHACL turtle from a LinkML model
linkml generate (full) shacl [OPTIONS] YAMLFILE
Options
- --closed, --non-closed#
Use ‘–closed’ to generate closed SHACL shapes. Use ‘–non-closed’ to generate open SHACL shapes.
- Default:
True
- -s, --suffix <suffix>#
Use –suffix to append given string to SHACL class name (e. g. –suffix Shape: Person becomes PersonShape).
- --include-annotations, --exclude-annotations#
Use –include-annotations to include annotations of slots, types, and classes in the generated SHACL shapes.
- Default:
False
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'ttl'
- Options:
ttl
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
shex#
Generate a ShEx Schema for a LinkML model
linkml generate (full) shex [OPTIONS] YAMLFILE
Options
- -o, --output <output>#
Output file name
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'shex'
- Options:
shex | json | rdf
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
sparql#
Generate SPARQL queries for validation
This will generate a directory of queries that can be used for QC over a triplestore that is conformant to the same LinkML schema.
Each query in the directory will be of the form
CHECK_<ConstraintType>_<SchemaElement>.rq
Example:
gen-sparql -d ./sparql/ personinfo.yaml
linkml generate (full) sparql [OPTIONS] YAMLFILE
Options
- -d, --dir <dir>#
Directory in which queries will be deposited
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'sparql'
- Options:
sparql
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
sqla#
Generate SQL DDL representation
linkml generate (full) sqla [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- --use-foreign-keys, --no-use-foreign-keys#
Emit FK declarations
- Default:
True
- --pydantic, --no-pydantic#
If True, generate Pydantic classes (imperative mode only)
- Default:
False
- --generate-classes, --no-generate-classes#
If True, generate Python datamodel (imperative mode only)
- Default:
False
- --declarative, --no-declarative#
Generate SQL Alchemy declarative vs imperative
- Default:
True
- -f, --format <format>#
Output format
- Default:
'sqla'
- Options:
sqla
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
sqltables#
Generate SQL DDL representation
linkml generate (full) sqltables [OPTIONS] YAMLFILE
Options
- --dialect <dialect>#
SQL-Alchemy dialect, e.g. sqlite, mysql+odbc
- Default:
'sqlite'
- --sqla-file <sqla_file>#
Path to sqlalchemy generated python
- --relmodel-output <relmodel_output>#
Path to intermediate LinkML YAML of transformed relational model
- --python-import <python_import>#
Python import header for generated sql-alchemy code
- --use-foreign-keys, --no-use-foreign-keys#
Emit FK declarations
- Default:
True
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'sql'
- Options:
sql
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
sssom#
Generate SSSOM TSV to represent a LinkML model
linkml generate (full) sssom [OPTIONS] YAMLFILE
Options
- -o, --output <output>#
Output file name
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'tsv'
- Options:
tsv
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
summary#
Generate TSV summary files for viewing in Excel and the like
linkml generate (full) summary [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'tsv'
- Options:
tsv
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
terminusdb#
Generate graphql representation of a LinkML model
linkml generate (full) terminusdb [OPTIONS] YAMLFILE
Options
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'json'
- Options:
json
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
yaml#
Validate input and produce fully resolved yaml equivalent
linkml generate (full) yaml [OPTIONS] YAMLFILE
Options
- --raw, --no-raw#
Use the raw loader and do not inject additional information
- Default:
False
- -V, --validateonly, -g, --generate#
Just validate / generate output (default: generate)
- Default:
False
- -V, --version#
Show the version and exit.
- -f, --format <format>#
Output format
- Default:
'yaml'
- Options:
yaml
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument
yuml#
Generate a UML representation of a LinkML model
linkml generate (full) yuml [OPTIONS] YAMLFILE
Options
- -c, --classes <classes>#
Class(es) to emit
- -d, --directory <directory>#
Output directory - if supplied, YUML rendering will be saved in file
- --diagram-name <diagram_name>#
Name of the diagram in the output directory (without suffix!)
- -f, --format <format>#
Output format
- Default:
'yuml'
- Options:
yuml | png | pdf | jpg | json | svg
- --metadata, --no-metadata#
Include metadata in output
- Default:
True
- --useuris, --metauris#
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>#
Import mapping file
- --log_level <log_level>#
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose#
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports#
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace#
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE#
Required argument