LinkML
Materialize a derived LinkML schema: imports resolved, slots pushed into attributes, and the elements out of scope pruned.
ohi get w3c/prov-oohi linkml to linkml --full-uris \ --to prov-o.derived.yaml prov-o.linkml.yamlimport ohi_linkml
with ohi_linkml.load_file("prov-o.linkml.yaml") as schema: output = schema.linkml(full_uris=True)import { readFileSync } from "node:fs";import { LinkML } from "@neverblink/linkml";
const yaml = readFileSync("prov-o.linkml.yaml", "utf8");const { view, report } = LinkML.loadFromString(yaml, {});if (!view) throw new Error(JSON.stringify(report));const output = view.linkml({ full_uris: true });import eu.neverblink.linkml.generator.options.LinkMlGeneratorOptionsimport eu.neverblink.linkml.generator.linkml.LinkMlGeneratorimport eu.neverblink.linkml.schemaview.{SchemaIssues, SchemaView}
val loaded = SchemaView.loadSchemaViewFromUri("prov-o.linkml.yaml")given SchemaView = SchemaIssues.orThrow(loaded)val output = LinkMlGenerator().serialize( LinkMlGeneratorOptions(fullUris = true),)#include <stddef.h>#include "ohi_linkml.h"
linkml_init_threads();char *report = NULL, *error = NULL;long long schema = linkml_load_file("prov-o.linkml.yaml", NULL, &report, &error);char *output = linkml_linkml(schema, "{\"full_uris\": true}", &error);linkml_free(output);linkml_free(report);linkml_free(error);linkml_close(schema);Options
Section titled “Options”formatJsonOutputFormatdefault yamlCLI
--formatThe serialization of the output.
yamlYAML.jsonJSON.
full_urisbooleandefault falseCLI
--full-urisScala fullUrisWhether to write URIs in full, instead of compacting them to CURIEs with the schema's prefixes.
pruning_modePruningModedefault skipCLI
--pruning-modeScala pruningModeThe elements of the schema to include in the output.
tree_rootThe elements reachable from the tree root class. Without a tree root, the same asschema.schemaEverything defined in the root schema, and every element reachable from it. This leaves out the unused parts of imported schemas, such as most oflinkml:types.skipEvery element of the root schema and of all its imports.
skip_class_derivationbooleandefault falseCLI
--skip-class-derivationScala skipClassDerivationWhether to copy the classes as they are, instead of deriving them.
tree_rootstringCLI
--tree-rootScala treeRootThe class to use as the tree root, instead of the class with tree_root: true in the schema. Only for the tree_root pruning mode.