@ontology-kit/okb 0.0.0-stage → 0.1.0-bootstrap.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +26 -2
- package/bin/okb.js +8 -0
- package/dist/checks.d.ts +33 -0
- package/dist/checks.js +966 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +718 -0
- package/dist/clidocs.d.ts +6 -0
- package/dist/clidocs.js +90 -0
- package/dist/clock.d.ts +2 -0
- package/dist/clock.js +16 -0
- package/dist/commands.d.ts +28 -0
- package/dist/commands.js +622 -0
- package/dist/export.d.ts +54 -0
- package/dist/export.js +290 -0
- package/dist/families.d.ts +20 -0
- package/dist/families.js +51 -0
- package/dist/help.d.ts +2 -0
- package/dist/help.js +57 -0
- package/dist/markdown.d.ts +60 -0
- package/dist/markdown.js +310 -0
- package/dist/metakb.d.ts +164 -0
- package/dist/metakb.js +130 -0
- package/dist/naming.d.ts +20 -0
- package/dist/naming.js +140 -0
- package/dist/ops/admin.d.ts +16 -0
- package/dist/ops/admin.js +119 -0
- package/dist/ops/classes.d.ts +21 -0
- package/dist/ops/classes.js +105 -0
- package/dist/ops/common.d.ts +6 -0
- package/dist/ops/common.js +4 -0
- package/dist/ops/instances.d.ts +8 -0
- package/dist/ops/instances.js +70 -0
- package/dist/ops/links.d.ts +9 -0
- package/dist/ops/links.js +85 -0
- package/dist/ops/naming.d.ts +4 -0
- package/dist/ops/naming.js +70 -0
- package/dist/ops/scope.d.ts +29 -0
- package/dist/ops/scope.js +124 -0
- package/dist/ops/slots.d.ts +31 -0
- package/dist/ops/slots.js +186 -0
- package/dist/ops/values.d.ts +20 -0
- package/dist/ops/values.js +151 -0
- package/dist/ops.d.ts +14 -0
- package/dist/ops.js +14 -0
- package/dist/provenance.d.ts +53 -0
- package/dist/provenance.js +296 -0
- package/dist/quotes.d.ts +14 -0
- package/dist/quotes.js +104 -0
- package/dist/render.d.ts +30 -0
- package/dist/render.js +413 -0
- package/dist/review.d.ts +10 -0
- package/dist/review.js +145 -0
- package/dist/site.d.ts +6 -0
- package/dist/site.js +6 -0
- package/dist/skills.d.ts +52 -0
- package/dist/skills.js +120 -0
- package/dist/status.d.ts +18 -0
- package/dist/status.js +59 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.js +5 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +7 -0
- package/meta-kb/data/edges.json +3172 -0
- package/meta-kb/data/manifest.json +19 -0
- package/meta-kb/data/nodes.json +3546 -0
- package/package.json +71 -3
- package/skills/build-domain-kb-from-docs/SKILL.md +87 -0
- package/skills/ontology-coach/SKILL.md +100 -0
- package/skills/ontology-review/SKILL.md +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alan B Smith
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ontology-kit/okb
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `okb` command-line tool from [Ontology Kit](https://ontology-kit.dev), a toolkit for building knowledge graphs with guardrails. You keep your knowledge in plain files you own, and okb checks them as you work: a checked file format, rules from a meta-KB, provenance down to verbatim quotes, and skills that let Claude drive it.
|
|
4
|
+
|
|
5
|
+
It's for a team that keeps a knowledge base and wants every fact to point back to its source. It's also for someone building their first: the Ontology 101 method (Noy & McGuinness, 2001), the Learn course and the tutorials walk you through it step by step.
|
|
6
|
+
|
|
7
|
+
The package ships the `okb` command, the meta-KB (a knowledge base about building knowledge bases, which holds the method and its rules), and skills that let Claude coach you, review your work, and extract a knowledge base from documents. Other tools can read the file format with the small [`@ontology-kit/format`](https://www.npmjs.com/package/@ontology-kit/format) package, which okb itself builds on.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Needs **Node.js 24+**.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install --global @ontology-kit/okb
|
|
15
|
+
okb skills install # adds the Claude skills; Claude Code and Cursor load them
|
|
16
|
+
okb init my-ontology
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
To update, run `npm update --global @ontology-kit/okb` and `okb skills install` again. You can also run it without installing, with `npx @ontology-kit/okb version`, or install it with pnpm (`pnpm add --global @ontology-kit/okb`). The unscoped [`ontology-kit`](https://www.npmjs.com/package/ontology-kit) package installs the same `okb` command.
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
**Docs: [ontology-kit.dev](https://ontology-kit.dev)**. Start with the [introduction](https://ontology-kit.dev/getting-started/) and the [installation guide](https://ontology-kit.dev/getting-started/installation/). The source is at [github.com/alanbsmith/ontology-kit](https://github.com/alanbsmith/ontology-kit).
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
[MIT](LICENSE)
|
package/bin/okb.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// In a source checkout (src/ exists) this runs the TypeScript sources, which Node runs by stripping
|
|
3
|
+
// types, so a stale dist/ is never used while developing. The published package ships dist/ and not
|
|
4
|
+
// src/, so an installed okb runs the compiled CLI.
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
|
|
7
|
+
const sources = new URL("../src/cli.ts", import.meta.url);
|
|
8
|
+
await import(existsSync(sources) ? sources.href : new URL("../dist/cli.js", import.meta.url).href);
|
package/dist/checks.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Ontology } from "@ontology-kit/format";
|
|
2
|
+
import { type Finding, type Severity } from "./types.js";
|
|
3
|
+
import { type MdDoc } from "./markdown.js";
|
|
4
|
+
export interface Hit {
|
|
5
|
+
message: string;
|
|
6
|
+
nodes: string[];
|
|
7
|
+
severity?: Severity;
|
|
8
|
+
}
|
|
9
|
+
type Check = (ont: Ontology, ctx: CheckContext) => Hit[];
|
|
10
|
+
export interface CheckContext {
|
|
11
|
+
/** Source id -> loaded pages (PDF/text) or parsed markdown, for prov-quote-current. */
|
|
12
|
+
pages: Map<string, string[] | MdDoc | Error>;
|
|
13
|
+
}
|
|
14
|
+
/** Step 1 asks for at least this many competency questions (also a step 1 doneWhen item). */
|
|
15
|
+
export declare const MIN_COMPETENCY_QUESTIONS = 3;
|
|
16
|
+
export declare const CHECKS: Record<string, Check>;
|
|
17
|
+
/** Near-identical quotes attributed to different sources (also used by `okb drift`). */
|
|
18
|
+
export declare function duplicateQuotes(ont: Ontology): Hit[];
|
|
19
|
+
export interface RunOptions {
|
|
20
|
+
/** Ignore the current step and run every rule. */
|
|
21
|
+
all?: boolean;
|
|
22
|
+
/** Only these rule keys. */
|
|
23
|
+
only?: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function loadSourcePages(ont: Ontology): Promise<Map<string, string[] | MdDoc | Error>>;
|
|
26
|
+
export interface CheckReport {
|
|
27
|
+
/** Errors first, then warnings, then hints. */
|
|
28
|
+
findings: Finding[];
|
|
29
|
+
/** Warnings and hints from rules for steps the user hasn't reached yet (not in `findings`). */
|
|
30
|
+
hiddenLater: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function runChecks(ont: Ontology, opts?: RunOptions, ctx?: CheckContext): CheckReport;
|
|
33
|
+
export {};
|