Statistics
Count the elements, their documentation, mappings and languages, and the imports. Returns a SchemaStats of model/schema-stats.yaml.
ohi get w3c/prov-oohi linkml to stats --pruning-mode skip prov-o.linkml.yamlimport ohi_linkml
with ohi_linkml.load_file("prov-o.linkml.yaml") as schema: result = schema.stats(pruning_mode="skip")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 result = view.stats({ pruning_mode: "skip" });import eu.neverblink.linkml.generator.options.*import eu.neverblink.linkml.generator.stats.StatsGeneratorimport eu.neverblink.linkml.schemaview.{SchemaIssues, SchemaView}
val loaded = SchemaView.loadSchemaViewFromUri("prov-o.linkml.yaml")given SchemaView = SchemaIssues.orThrow(loaded)val result = StatsGenerator().generate( StatsGeneratorOptions(pruningMode = PruningMode.Skip),)#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 *result = linkml_stats( schema, "{\"pruning_mode\": \"skip\"}", &error);linkml_free(result);linkml_free(report);linkml_free(error);linkml_close(schema);Options
Section titled “Options”pruning_modePruningModedefault schemaCLI
--pruning-modeScala pruningModeThe elements in scope for the counts.
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.
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.