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 graphql representation of 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 = None, metamodel_name_map: ~typing.Dict[str, str] | None = None, importmap: str | ~typing.Mapping[str, str] | None = None, emit_prefixes: ~typing.Set[str] = <factory>, metamodel: ~linkml.utils.schemaloader.SchemaLoader | None = None, stacktrace: bool = False, include: str | ~pathlib.Path | ~linkml_runtime.linkml_model.meta.SchemaDefinition | None = None, classes: ~typing.List | None = None, raw_additions: ~typing.List | None = None, clswq: str | None = None, **_kwargs)[source]#

Experimental generator for TerminusDB

Generates JSON-LD to pass to WOQLQuery().

Assumes an “inference/main” graph if any slots have “is_a” values, because any statements with rdfs:subPropertyOf as the predicate must live in a TerminusDB “inference” graph rather than the “schema” graph. When creating a new TerminusDB database, only the “schema” and “instance” graphs are created. Thus, you may need to e.g. WOQLClient.create_graph(“inference”, “main”).

serialize(**kwargs) str#

Generate output in the required format

Parameters:

kwargs – Generator specific parameters

Returns:

Generated output