okf 0.2.0 copy "okf: ^0.2.0" to clipboard
okf: ^0.2.0 copied to clipboard

A format-first Dart toolkit for reading, validating, writing, indexing, and graphing Open Knowledge Format bundles.

example/okf.dart

import 'dart:io';

import 'package:okf/okf_io.dart';

Future<void> main(List<String> arguments) async {
  if (arguments.length != 1) {
    stderr.writeln('Usage: dart run example/okf.dart <bundle>');
    exitCode = OkfExitCode.usage.value;
    return;
  }

  final result = await const OkfBundleLoader().inspect(arguments.single);
  final report = result.validate().report;
  final graph = OkfGraph.fromBundle(result.bundle);

  stdout.writeln(
    'Loaded ${result.bundle.concepts.length} concepts and '
    '${graph.edges.length} relationships.',
  );
  if (report.findings.isNotEmpty) {
    stdout.writeln(report.toText());
  }

  exitCode = OkfVerdict.of(report).exitCode;
}
1
likes
160
points
453
downloads

Documentation

API reference

Publisher

verified publisherconcepta.dev

Weekly Downloads

A format-first Dart toolkit for reading, validating, writing, indexing, and graphing Open Knowledge Format bundles.

Repository (GitHub)
View/report issues

Topics

#okf #knowledge #markdown #yaml #metadata

License

Apache-2.0 (license)

Dependencies

args, crypto, markdown, mcp_dart, path, unorm_dart, yaml

More

Packages that depend on okf