TerminusDB

Overview

TerminusDB is an open-source knowledge graph database that provides reliable, private & efficient revision control & collaboration.

LinkML schemas can be compiled down to terminusdb WOQL schemas

To run:

gen-terminusdb personinfo.yaml

Docs

Command Line

gen-terminusdb

Generate TerminusDB JSON-LD schema from a LinkML model

gen-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

Code

class linkml.generators.terminusdbgen.TerminusdbGenerator(schema: str | ~typing.TextIO | ~linkml_runtime.linkml_model.meta.SchemaDefinition | ~linkml.utils.generator.Generator | ~pathlib.Path, schemaview: ~linkml_runtime.utils.schemaview.SchemaView | None = None, format: str | None = None, metadata: bool = True, useuris: bool | None = None, log_level: int | None = 30, mergeimports: bool | None = True, source_file_date: str | None = None, source_file_size: int | None = None, logger: ~logging.Logger | None = None, verbose: bool | None = None, output: str | None = None, namespaces: ~linkml_runtime.utils.namespaces.Namespaces | None = None, directory_output: bool = False, base_dir: str = None, metamodel_name_map: dict[str, str] = None, importmap: str | ~collections.abc.Mapping[str, str] | None = None, emit_prefixes: set[str] = <factory>, metamodel: ~linkml.utils.schemaloader.SchemaLoader = None, stacktrace: bool = False, include: str | ~pathlib.Path | ~linkml_runtime.linkml_model.meta.SchemaDefinition | None = None, documents: list = <factory>, current_class_doc: dict = <factory>)[source]

Generator for TerminusDB JSON-LD schema documents.

Produces a JSON array of schema documents compatible with the TerminusDB v10+ document interface. The output can be loaded via client.insert_document(docs, graph_type="schema").

serialize(**kwargs) str

Generate output in the required format

Parameters:

kwargs – Generator specific parameters

Returns:

Generated output