RDFS
Generate RDFS, serialized as N-Triples or Turtle.
ohi get w3c/prov-oohi linkml to rdfs --only-classes-from-root-schema \ --to prov-o.rdfs.ttl prov-o.linkml.yamlimport ohi_linkml
with ohi_linkml.load_file("prov-o.linkml.yaml") as schema: output = schema.rdfs(only_classes_from_root_schema=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.rdfs({ only_classes_from_root_schema: true });import eu.neverblink.linkml.generator.options.RdfsGeneratorOptionsimport eu.neverblink.linkml.generator.rdfs.RdfsGeneratorimport eu.neverblink.linkml.schemaview.{SchemaIssues, SchemaView}
val loaded = SchemaView.loadSchemaViewFromUri("prov-o.linkml.yaml")given SchemaView = SchemaIssues.orThrow(loaded)val output = RdfsGenerator().serialize( RdfsGeneratorOptions(onlyClassesFromRootSchema = 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_rdfs( schema, "{\"only_classes_from_root_schema\": true}", &error);linkml_free(output);linkml_free(report);linkml_free(error);linkml_close(schema);Options
Section titled “Options”formatRdfFormatdefault ttlCLI
--formatThe RDF serialization of the output.
ttlTurtle, with prefixes and pretty-printed.ntN-Triples, one statement per line.
only_classes_from_root_schemabooleandefault falseCLI
--only-classes-from-root-schemaScala onlyClassesFromRootSchemaWhether to include only the classes and enums of the root schema. This is useful for one output file per schema file, without the imported classes in each.