@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/dist/commands.js
ADDED
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The command reference behind docs/CLI.md: what each `okb` command does, an example,
|
|
3
|
+
* and its arguments. `tests/misc.test.ts` checks that every command in the dispatch table
|
|
4
|
+
* is here and that every flag the help text shows for a command is documented.
|
|
5
|
+
*/
|
|
6
|
+
const NAME_DESC = "The name, in the case your naming convention asks for.";
|
|
7
|
+
export const COMMANDS = [
|
|
8
|
+
{
|
|
9
|
+
name: "init",
|
|
10
|
+
group: "Getting started",
|
|
11
|
+
description: "Creates a new ontology folder with the starting files and shows the guide for step 1.",
|
|
12
|
+
forms: [{
|
|
13
|
+
description: "Creates the folder, then tells you what to do first.",
|
|
14
|
+
examples: ['okb init wine --name "Wine and Food"'],
|
|
15
|
+
args: [["<folder>", "path", "Where to create the ontology."], ["--name", "text", "The ontology's name. Defaults to the folder name."]],
|
|
16
|
+
}],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "status",
|
|
20
|
+
group: "Getting started",
|
|
21
|
+
description: "Shows which step you are on, what is done, and what to do next.",
|
|
22
|
+
forms: [{ description: "Prints every step with its checklist, plus a count of validator findings.", examples: ["okb status"], args: [] }],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "step",
|
|
26
|
+
group: "Getting started",
|
|
27
|
+
description: "Moves between the eight steps and shows the guide for a step.",
|
|
28
|
+
forms: [{
|
|
29
|
+
description: "With no argument it shows the guide for your current step. With one, it moves you there.",
|
|
30
|
+
examples: ["okb step", "okb step next", "okb step 4"],
|
|
31
|
+
args: [["[n|next|prev]", "number or word", "The step to move to: 1 to 8, `next`, or `prev`. Moving on with a step unfinished is allowed."]],
|
|
32
|
+
}],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "explain",
|
|
36
|
+
group: "Getting started",
|
|
37
|
+
description: "Explains a concept, rule, step or decision guide in plain language.",
|
|
38
|
+
forms: [{
|
|
39
|
+
description: "With no argument it lists everything you can ask about.",
|
|
40
|
+
examples: ["okb explain class", "okb explain 5", "okb explain --search inverse"],
|
|
41
|
+
args: [["[topic]", "text", "A concept, rule key, step number or decision guide."], ["--search", "text", "Find entries that mention these words instead."]],
|
|
42
|
+
}],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "validate",
|
|
46
|
+
group: "Getting started",
|
|
47
|
+
description: "Checks your ontology against the rules. Errors make the command exit with code 1.",
|
|
48
|
+
forms: [{
|
|
49
|
+
description: "By default it shows errors, plus warnings and hints for the steps you have reached.",
|
|
50
|
+
examples: ["okb validate", "okb validate --all --why"],
|
|
51
|
+
args: [
|
|
52
|
+
["--all", "flag", "Include warnings and hints from steps you haven't reached."],
|
|
53
|
+
["--why", "flag", "Show why each rule exists."],
|
|
54
|
+
["--rule", "rule key", "Run only this rule. Repeat it for more."],
|
|
55
|
+
["--strict", "flag", "Also exit with code 1 on warnings."],
|
|
56
|
+
["--json", "flag", "Print the findings as JSON."],
|
|
57
|
+
],
|
|
58
|
+
}],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "scope",
|
|
62
|
+
group: "Planning",
|
|
63
|
+
description: "Records the domain, purpose, users and boundaries of the ontology. With no flags it shows what you have.",
|
|
64
|
+
forms: [{
|
|
65
|
+
description: "Sets any of the fields you pass and prints the result.",
|
|
66
|
+
examples: ['okb scope --domain "Wine and food pairing" --purpose "Recommend wines for a meal" --users sommeliers,cooks'],
|
|
67
|
+
args: [
|
|
68
|
+
["--domain", "text", "What the ontology covers."],
|
|
69
|
+
["--purpose", "text", "What it is for."],
|
|
70
|
+
["--users", "list", "Who will use it."],
|
|
71
|
+
["--maintainers", "list", "Who keeps it up to date."],
|
|
72
|
+
["--out-of-scope", "list", "What it deliberately leaves out."],
|
|
73
|
+
["--kind", "text", "The kind of ontology, such as a domain ontology."],
|
|
74
|
+
["--name", "text", "Rename the ontology."],
|
|
75
|
+
],
|
|
76
|
+
}],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "cq",
|
|
80
|
+
group: "Planning",
|
|
81
|
+
description: "Manages competency questions: the questions your ontology must be able to answer.",
|
|
82
|
+
forms: [
|
|
83
|
+
{ sub: "add", description: "Adds one or more questions.", examples: ['okb cq add "Which wines go with fish?"'], args: [["<question>", "text", "The question. Quote it."]] },
|
|
84
|
+
{ sub: "list", description: "Lists the questions and what each one needs. Bare `okb cq` does the same.", examples: ["okb cq list"], args: [] },
|
|
85
|
+
{
|
|
86
|
+
sub: "link",
|
|
87
|
+
description: "Says which classes, slots or instances a question needs. Use `unlink` to undo it.",
|
|
88
|
+
examples: ["okb cq link 1 Wine Food goesWellWith"],
|
|
89
|
+
args: [["<number>", "number", "The question's number."], ["<name>...", "names", "The classes, slots or instances it needs."]],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
sub: "set",
|
|
93
|
+
description: "Changes a question's text or marks it answerable.",
|
|
94
|
+
examples: ["okb cq set 1 --status answerable"],
|
|
95
|
+
args: [["<number>", "number", "The question's number."], ["--text", "text", "New wording."], ["--status", "draft or answerable", "Whether the ontology can answer it yet."]],
|
|
96
|
+
},
|
|
97
|
+
{ sub: "remove", description: "Deletes a question.", examples: ["okb cq remove 3"], args: [["<number>", "number", "The question's number."]] },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "reuse",
|
|
102
|
+
group: "Planning",
|
|
103
|
+
description: "Records which existing ontologies you looked at and what you decided about each.",
|
|
104
|
+
forms: [
|
|
105
|
+
{
|
|
106
|
+
sub: "add",
|
|
107
|
+
description: "Records one ontology you considered.",
|
|
108
|
+
examples: ["okb reuse add --name FOAF --url http://xmlns.com/foaf/spec/ --decision reference"],
|
|
109
|
+
args: [
|
|
110
|
+
["--name", "text", "The ontology's name."],
|
|
111
|
+
["--decision", "reuse, adapt, reference or rejected", "What you decided."],
|
|
112
|
+
["--url", "url", "Where it lives."],
|
|
113
|
+
["--notes", "text", "Why."],
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
{ sub: "none", description: "Records that you looked and found nothing that fits.", examples: ['okb reuse none --why "Checked schema.org and FOAF; neither covers wine."'], args: [["--why", "text", "What you looked at and why nothing fit."]] },
|
|
117
|
+
{ sub: "list", description: "Lists what you recorded. Bare `okb reuse` does the same.", examples: ["okb reuse list"], args: [] },
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "term",
|
|
122
|
+
group: "Planning",
|
|
123
|
+
description: "Collects the important words of your domain, then decides what each one becomes.",
|
|
124
|
+
forms: [
|
|
125
|
+
{ sub: "add", description: "Adds terms to the list.", examples: ["okb term add wine grape winery color"], args: [["<term>...", "text", "One or more terms. Quote multi-word terms."], ["--note", "text", "A note to keep with them."]] },
|
|
126
|
+
{ sub: "list", description: "Lists terms grouped by what you decided. Bare `okb term` does the same.", examples: ["okb term list"], args: [] },
|
|
127
|
+
{
|
|
128
|
+
sub: "set",
|
|
129
|
+
description: "Decides what a term becomes.",
|
|
130
|
+
examples: ["okb term set wine --as class", "okb term set vintage --as synonym --node Year"],
|
|
131
|
+
args: [
|
|
132
|
+
["<term>", "text", "The term."],
|
|
133
|
+
["--as", "class, slot, instance, value, synonym or out-of-scope", "What it becomes."],
|
|
134
|
+
["--node", "name", "The class, slot or instance it became or points to."],
|
|
135
|
+
["--note", "text", "A note about the decision."],
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "convention",
|
|
142
|
+
group: "Modeling",
|
|
143
|
+
description: "Sets how names are written, so the validator can check them. With no flags it shows the current choices.",
|
|
144
|
+
forms: [{
|
|
145
|
+
description: "Sets any of the options you pass.",
|
|
146
|
+
examples: ["okb convention --class-case PascalCase --slot-case camelCase --number singular"],
|
|
147
|
+
args: [
|
|
148
|
+
["--class-case", "text", "Case for class names, such as PascalCase."],
|
|
149
|
+
["--slot-case", "text", "Case for slot names, such as camelCase."],
|
|
150
|
+
["--instance-case", "text", "Case for instance names."],
|
|
151
|
+
["--number", "singular or plural", "Whether class names are singular or plural."],
|
|
152
|
+
["--slot-affix", "text", "A prefix or suffix every slot name carries, if any."],
|
|
153
|
+
],
|
|
154
|
+
}],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "class",
|
|
158
|
+
group: "Modeling",
|
|
159
|
+
description: "Creates and changes classes, the kinds of things in your domain.",
|
|
160
|
+
forms: [
|
|
161
|
+
{
|
|
162
|
+
sub: "add",
|
|
163
|
+
description: "Adds a class.",
|
|
164
|
+
examples: ['okb class add RedWine --parent Wine --desc "Wine made with dark grapes"'],
|
|
165
|
+
args: [
|
|
166
|
+
["<Name>", "text", NAME_DESC],
|
|
167
|
+
["--parent", "class", "A parent class. Repeat it for more."],
|
|
168
|
+
["--desc", "text", "A one-line description."],
|
|
169
|
+
["--synonym", "text", "Another name for it. Repeat it for more."],
|
|
170
|
+
["--abstract", "flag", "Mark it as a grouping with no members of its own."],
|
|
171
|
+
["--terminological", "flag", "Mark it as terminological."],
|
|
172
|
+
["--force", "flag", "Add it even if the name breaks your convention."],
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
sub: "set",
|
|
177
|
+
description: "Changes a class.",
|
|
178
|
+
examples: ["okb class set RedWine --add-parent Beverage"],
|
|
179
|
+
args: [
|
|
180
|
+
["<Class>", "class", "The class to change."],
|
|
181
|
+
["--desc", "text", "New description."],
|
|
182
|
+
["--add-parent", "class", "Add a parent."],
|
|
183
|
+
["--remove-parent", "class", "Remove a parent."],
|
|
184
|
+
["--synonym", "text", "Add a synonym."],
|
|
185
|
+
["--abstract", "true or false", "Whether it is abstract."],
|
|
186
|
+
["--terminological", "true or false", "Whether it is terminological."],
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
{ sub: "disjoint", description: "Says that no one thing can belong to more than one of these classes.", examples: ["okb class disjoint RedWine WhiteWine RoseWine"], args: [["<Class>...", "classes", "Two or more classes."]] },
|
|
190
|
+
{
|
|
191
|
+
sub: "fix",
|
|
192
|
+
description: "Gives every member of a class the same value for a slot.",
|
|
193
|
+
examples: ["okb class fix DessertWine sugar=sweet"],
|
|
194
|
+
args: [["<Class>", "class", "The class."], ["<slot=value>...", "slot=value", "The values every member has."]],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
sub: "default",
|
|
198
|
+
description: "Gives a class a starting value for a slot that individual members can override.",
|
|
199
|
+
examples: ["okb class default Wine body=full"],
|
|
200
|
+
args: [["<Class>", "class", "The class."], ["<slot=value>...", "slot=value", "The starting values."]],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
sub: "restrict",
|
|
204
|
+
description: "Narrows a slot for one class: fewer values, a limit on how many, or a narrower range.",
|
|
205
|
+
examples: ["okb class restrict SingleVarietal grape --max 1"],
|
|
206
|
+
args: [
|
|
207
|
+
["<Class>", "class", "The class."],
|
|
208
|
+
["<slot>", "slot", "The slot to narrow."],
|
|
209
|
+
["--values", "list", "Allowed values."],
|
|
210
|
+
["--min", "number", "The fewest values allowed."],
|
|
211
|
+
["--max", "number", "The most values allowed."],
|
|
212
|
+
["--range", "class", "Allowed classes, for a relationship."],
|
|
213
|
+
["--clear", "flag", "Remove the restriction."],
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "tree",
|
|
220
|
+
group: "Modeling",
|
|
221
|
+
description: "Prints the class hierarchy as an indented tree.",
|
|
222
|
+
forms: [{ description: "Shows each class under its parents.", examples: ["okb tree", "okb tree --instances"], args: [["--instances", "flag", "Show instances under their classes."]] }],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "property",
|
|
226
|
+
group: "Modeling",
|
|
227
|
+
description: "A slot that holds a plain value, such as a number, text or one of a fixed list. It takes the same subcommands as `okb slot`.",
|
|
228
|
+
forms: [{
|
|
229
|
+
sub: "add",
|
|
230
|
+
description: "Adds a property to a class.",
|
|
231
|
+
examples: ["okb property add body --on Wine --type Enumerated --values light,medium,full --card single"],
|
|
232
|
+
args: [
|
|
233
|
+
["<name>", "text", NAME_DESC],
|
|
234
|
+
["--on", "class", "The class it belongs to."],
|
|
235
|
+
["--type", "String, Integer, Float, Boolean or Enumerated", "What kind of value it holds."],
|
|
236
|
+
["--values", "list", "The allowed values, for Enumerated."],
|
|
237
|
+
["--card", "single or multiple", "Whether it holds one value or several."],
|
|
238
|
+
["--desc", "text", "A one-line description."],
|
|
239
|
+
],
|
|
240
|
+
}],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: "relationship",
|
|
244
|
+
group: "Modeling",
|
|
245
|
+
description: "A slot that links one thing to another, such as a wine to its winery. Okb stores it as edges, so `maker` becomes `:MAKER`.",
|
|
246
|
+
forms: [
|
|
247
|
+
{
|
|
248
|
+
sub: "add",
|
|
249
|
+
description: "Adds a relationship between two classes.",
|
|
250
|
+
examples: ["okb relationship add maker --from Wine --to Winery --card single"],
|
|
251
|
+
args: [
|
|
252
|
+
["<name>", "text", NAME_DESC],
|
|
253
|
+
["--from", "class", "The class the relationship starts at."],
|
|
254
|
+
["--to", "class", "The class it points to."],
|
|
255
|
+
["--card", "single or multiple", "Whether it holds one target or several."],
|
|
256
|
+
],
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
sub: "inverse",
|
|
260
|
+
description: "Declares that two relationships are the same link read from opposite ends.",
|
|
261
|
+
examples: ["okb relationship inverse maker produces"],
|
|
262
|
+
args: [["<slotA>", "slot", "The relationship that is stored."], ["<slotB>", "slot", "Its inverse."]],
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
sub: "property",
|
|
266
|
+
description: "Adds a property to a relationship itself, such as the condition under which one thing is preferred over another.",
|
|
267
|
+
examples: ["okb relationship property preferredOver condition --type String"],
|
|
268
|
+
args: [
|
|
269
|
+
["<relationship>", "slot", "The relationship."],
|
|
270
|
+
["<name>", "text", "The property's name."],
|
|
271
|
+
["--type", "String, Integer, Float, Boolean or Enumerated", "What kind of value it holds."],
|
|
272
|
+
["--values", "list", "The allowed values, for Enumerated."],
|
|
273
|
+
["--required", "flag", "Every link must give it a value."],
|
|
274
|
+
["--desc", "text", "A one-line description."],
|
|
275
|
+
["--remove", "flag", "Remove the property."],
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: "slot",
|
|
282
|
+
group: "Modeling",
|
|
283
|
+
description: "Creates and changes slots, the properties and relationships of a class. `okb property` and `okb relationship` are friendlier names for the same command.",
|
|
284
|
+
forms: [
|
|
285
|
+
{
|
|
286
|
+
sub: "add",
|
|
287
|
+
description: "Adds a slot to a class.",
|
|
288
|
+
examples: ["okb slot add body --on Wine --type Enumerated --values light,medium,full"],
|
|
289
|
+
args: [
|
|
290
|
+
["<name>", "text", NAME_DESC],
|
|
291
|
+
["--on", "class", "A class it belongs to. Repeat it for more."],
|
|
292
|
+
["--type", "String, Integer, Float, Boolean, Enumerated or Instance", "What it holds. `Instance` makes it a relationship."],
|
|
293
|
+
["--values", "list", "The allowed values, for Enumerated."],
|
|
294
|
+
["--range", "class", "The class a relationship points to."],
|
|
295
|
+
["--card", "single or multiple", "Whether it holds one value or several."],
|
|
296
|
+
["--min", "number", "The fewest values allowed."],
|
|
297
|
+
["--max", "number", "The most values allowed."],
|
|
298
|
+
["--default", "text", "A starting value."],
|
|
299
|
+
["--desc", "text", "A one-line description."],
|
|
300
|
+
["--force", "flag", "Add it even if the name breaks your convention."],
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
sub: "set",
|
|
305
|
+
description: "Changes a slot. It takes every flag `add` takes, plus the ones below.",
|
|
306
|
+
examples: ["okb slot set maker --card single --min 1", "okb slot set body --off Beverage"],
|
|
307
|
+
args: [
|
|
308
|
+
["<slot>", "slot", "The slot to change."],
|
|
309
|
+
["--off", "class", "Take the slot off a class."],
|
|
310
|
+
["--add-range", "class", "Add a class a relationship can point to."],
|
|
311
|
+
["--remove-range", "class", "Remove one."],
|
|
312
|
+
["--on-rules", "flag", "Let rules set this slot."],
|
|
313
|
+
["--off-rules", "flag", "Stop rules setting this slot."],
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
{ sub: "inverse", description: "Declares that two relationships are the same link read from opposite ends.", examples: ["okb slot inverse maker produces"], args: [["<slotA>", "slot", "The relationship that is stored."], ["<slotB>", "slot", "Its inverse."]] },
|
|
317
|
+
],
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
name: "show",
|
|
321
|
+
group: "Modeling",
|
|
322
|
+
description: "Shows everything about one class, slot or instance: its parents, slots, values and links.",
|
|
323
|
+
forms: [{
|
|
324
|
+
description: "With no name it shows the ontology itself.",
|
|
325
|
+
examples: ["okb show Wine", "okb show class:Genre"],
|
|
326
|
+
args: [["[name]", "text", "The thing to show. When a class and a slot share a name, write `class:Genre` or `slot:genre`."]],
|
|
327
|
+
}],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "link",
|
|
331
|
+
group: "Modeling",
|
|
332
|
+
description: "Connects two instances (or an instance and a class) with a relationship.",
|
|
333
|
+
forms: [{
|
|
334
|
+
description: "Adds one link. Values for the relationship's own properties go at the end.",
|
|
335
|
+
examples: ['okb link Radio preferredOver SegmentedControl condition="2 to 7 options"'],
|
|
336
|
+
args: [
|
|
337
|
+
["<from>", "name", "Where the link starts."],
|
|
338
|
+
["<relationship>", "slot", "The relationship."],
|
|
339
|
+
["<to>", "name", "Where it ends."],
|
|
340
|
+
["<name=value>...", "name=value", "Values for the relationship's own properties."],
|
|
341
|
+
["--rule", "rule id", "The extracted rule this link comes from."],
|
|
342
|
+
["--clear", "text", "Remove a property value from the link."],
|
|
343
|
+
],
|
|
344
|
+
}],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: "unlink",
|
|
348
|
+
group: "Modeling",
|
|
349
|
+
description: "Removes a link.",
|
|
350
|
+
forms: [{ description: "Removes one link.", examples: ["okb unlink Radio preferredOver SegmentedControl"], args: [["<from>", "name", "Where the link starts."], ["<relationship>", "slot", "The relationship."], ["<to>", "name", "Where it ends."]] }],
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
name: "instance",
|
|
354
|
+
group: "Modeling",
|
|
355
|
+
description: "Adds and changes instances, the individual things your classes describe.",
|
|
356
|
+
forms: [
|
|
357
|
+
{
|
|
358
|
+
sub: "add",
|
|
359
|
+
description: "Adds an instance and sets its values.",
|
|
360
|
+
examples: ['okb instance add "Chateau Morgon Beaujolais" --of Beaujolais body=light maker="Chateau Morgon"'],
|
|
361
|
+
args: [
|
|
362
|
+
["<Name>", "text", "The instance's name. Quote it if it has spaces."],
|
|
363
|
+
["--of", "class", "A class it belongs to. Repeat it for more."],
|
|
364
|
+
["--desc", "text", "A one-line description."],
|
|
365
|
+
["<slot=value>...", "slot=value", "Values for its slots."],
|
|
366
|
+
],
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
sub: "set",
|
|
370
|
+
description: "Changes an instance's values. Use `+=` to add a value, `-=` to remove one, and `slot=` to clear it.",
|
|
371
|
+
examples: ['okb instance set "Chateau Morgon Beaujolais" grape+=Gamay', 'okb instance set "Chateau Morgon Beaujolais" --of Beaujolais'],
|
|
372
|
+
args: [
|
|
373
|
+
["<Name>", "text", "The instance."],
|
|
374
|
+
["<slot=value>...", "slot=value", "The changes."],
|
|
375
|
+
["--of", "class", "Move it to another class."],
|
|
376
|
+
["--desc", "text", "New description."],
|
|
377
|
+
],
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: "review",
|
|
383
|
+
group: "Reviewing and sharing",
|
|
384
|
+
description: "Turns the rules only a person can judge into questions about your ontology. The ontology-review skill uses it.",
|
|
385
|
+
forms: [{ description: "Lists the questions for the steps you have reached.", examples: ["okb review", "okb review --all --json"], args: [["--all", "flag", "Include every rule, not only the visible ones."], ["--json", "flag", "Print everything as JSON."]] }],
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: "decision",
|
|
389
|
+
group: "Reviewing and sharing",
|
|
390
|
+
description: "Records a design decision, with the reason, so you and others can see why the ontology is the way it is.",
|
|
391
|
+
forms: [
|
|
392
|
+
{
|
|
393
|
+
sub: "add",
|
|
394
|
+
description: "Records a decision. A decision can waive a rule, which turns that rule's warning into a note.",
|
|
395
|
+
examples: ['okb decision add --title "Wines are not foods" --decision "Keep them separate" --why "Pairing needs both"'],
|
|
396
|
+
args: [
|
|
397
|
+
["--title", "text", "A short title."],
|
|
398
|
+
["--decision", "text", "What you decided."],
|
|
399
|
+
["--why", "text", "The reason."],
|
|
400
|
+
["--question", "text", "The question it answers."],
|
|
401
|
+
["--alt", "text", "An option you rejected. Repeat it for more."],
|
|
402
|
+
["--about", "name", "A class, slot or instance it concerns. Repeat it for more."],
|
|
403
|
+
["--waives", "rule key", "A rule it explains away. Repeat it for more."],
|
|
404
|
+
],
|
|
405
|
+
},
|
|
406
|
+
{ sub: "list", description: "Lists the decisions. Bare `okb decision` does the same.", examples: ["okb decision list"], args: [] },
|
|
407
|
+
],
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: "diagram",
|
|
411
|
+
group: "Reviewing and sharing",
|
|
412
|
+
description: "Draws the ontology as a Mermaid diagram you can open in GitHub or VS Code.",
|
|
413
|
+
forms: [{ description: "Prints the diagram, or writes it to a file.", examples: ["okb diagram --out diagram.md"], args: [["--out", "path", "Write the diagram here instead of printing it."]] }],
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: "export",
|
|
417
|
+
group: "Reviewing and sharing",
|
|
418
|
+
description: "Writes the ontology as JSON or as openCypher, ready for Neo4j, Neptune or Memgraph. Instances become nodes labeled with their classes.",
|
|
419
|
+
forms: [{
|
|
420
|
+
description: "Prints the export, or writes it to a file.",
|
|
421
|
+
examples: ["okb export --format cypher --out wine.cypher"],
|
|
422
|
+
args: [
|
|
423
|
+
["--format", "json or cypher", "The output format. Defaults to json."],
|
|
424
|
+
["--out", "path", "Write to this file instead of printing."],
|
|
425
|
+
["--with-schema", "flag", "Include classes and slots, not only instances."],
|
|
426
|
+
["--no-inherited", "flag", "Leave out values an instance inherits from its class."],
|
|
427
|
+
["--no-rules", "flag", "Leave out extracted rules."],
|
|
428
|
+
["--include-unverified", "flag", "Include rules and quotes that haven't been verified."],
|
|
429
|
+
],
|
|
430
|
+
}],
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: "source",
|
|
434
|
+
group: "Working from documents",
|
|
435
|
+
description: "Registers documents you are extracting from, so quotes and rules can point back to them.",
|
|
436
|
+
forms: [
|
|
437
|
+
{
|
|
438
|
+
sub: "add",
|
|
439
|
+
description: "Registers a Markdown or PDF file.",
|
|
440
|
+
examples: ["okb source add docs/button.md --repo-url https://github.com/acme/ds/blob/main/button.md"],
|
|
441
|
+
args: [
|
|
442
|
+
["<file>", "path", "A Markdown or PDF file."],
|
|
443
|
+
["--title", "text", "A title."],
|
|
444
|
+
["--repo-url", "url", "The file's address on GitHub."],
|
|
445
|
+
["--url", "url", "The address of the rendered page."],
|
|
446
|
+
["--id", "text", "Your own id for it."],
|
|
447
|
+
],
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
sub: "outline",
|
|
451
|
+
description: "Lists every block of a Markdown source with its heading path and line numbers, and shows which are already quoted.",
|
|
452
|
+
examples: ["okb source outline button --quotable"],
|
|
453
|
+
args: [["<source>", "name", "The source."], ["--quotable", "flag", "Show only blocks you can quote."], ["--problems", "flag", "Show only problems in the document."]],
|
|
454
|
+
},
|
|
455
|
+
{ sub: "refresh", description: "Checks quotes again after the document changes.", examples: ["okb source refresh button"], args: [["<source>", "name", "The source."]] },
|
|
456
|
+
{ sub: "list", description: "Lists the sources. Bare `okb source` does the same.", examples: ["okb source list"], args: [] },
|
|
457
|
+
],
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "quote",
|
|
461
|
+
group: "Working from documents",
|
|
462
|
+
description: "Records a verbatim passage from a source. Okb finds it in the document for you.",
|
|
463
|
+
forms: [
|
|
464
|
+
{
|
|
465
|
+
sub: "add",
|
|
466
|
+
description: "Records one quote.",
|
|
467
|
+
examples: ['okb quote add button "Use a primary button for the main action." --cites Button'],
|
|
468
|
+
args: [
|
|
469
|
+
["<source>", "name", "The source it comes from."],
|
|
470
|
+
["<text>", "text", "The passage, word for word."],
|
|
471
|
+
["--cites", "node", "A node the quote supports. Repeat it for more."],
|
|
472
|
+
["--line", "number", "A line to look near, if the text appears more than once."],
|
|
473
|
+
["--allow-code", "flag", "Allow a quote from a code block."],
|
|
474
|
+
],
|
|
475
|
+
},
|
|
476
|
+
{ sub: "list", description: "Lists the quotes. Bare `okb quote` does the same.", examples: ["okb quote list"], args: [] },
|
|
477
|
+
],
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "rule",
|
|
481
|
+
group: "Working from documents",
|
|
482
|
+
description: "Records a rule a document states, tied to the quote that supports it.",
|
|
483
|
+
forms: [
|
|
484
|
+
{
|
|
485
|
+
sub: "add",
|
|
486
|
+
description: "Records one rule.",
|
|
487
|
+
examples: ['okb rule add --statement "Buttons SHOULD have one primary per page." --modality SHOULD --governs Button --cites quote.1'],
|
|
488
|
+
args: [
|
|
489
|
+
["--statement", "text", "The rule, in one sentence."],
|
|
490
|
+
["--modality", "MUST, SHOULD, MAY, MUST_NOT or SHOULD_NOT", "How strong the document makes it."],
|
|
491
|
+
["--cites", "quote id", "The quote that supports it. Repeat it for more."],
|
|
492
|
+
["--governs", "class or slot", "What it applies to. Repeat it for more."],
|
|
493
|
+
["--name", "text", "A short name."],
|
|
494
|
+
["--authored", "flag", "You wrote it; the document doesn't state it."],
|
|
495
|
+
["--value", "slot=value", "A value it sets. Repeat it for more."],
|
|
496
|
+
["--refines", "rule id", "A broader rule this one narrows."],
|
|
497
|
+
["--adds", "text", "What this rule adds to the one it refines."],
|
|
498
|
+
],
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
sub: "refines",
|
|
502
|
+
description: "Says that one rule narrows another.",
|
|
503
|
+
examples: ['okb rule refines rule.2 rule.1 --adds "Only inside dialogs"'],
|
|
504
|
+
args: [["<rule>", "rule id", "The narrower rule."], ["<broader rule>", "rule id", "The rule it narrows."], ["--adds", "text", "What it adds."], ["--remove", "flag", "Remove the link."]],
|
|
505
|
+
},
|
|
506
|
+
{ sub: "list", description: "Lists the rules. Bare `okb rule` does the same.", examples: ["okb rule list"], args: [] },
|
|
507
|
+
],
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: "fulfills",
|
|
511
|
+
group: "Working from documents",
|
|
512
|
+
description: "Says that an instance follows a rule.",
|
|
513
|
+
forms: [{ description: "Links the instance to the rule.", examples: ["okb fulfills SaveButton rule.1"], args: [["<instance>", "name", "The instance."], ["<rule>", "rule id", "The rule."], ["--remove", "flag", "Remove the link."]] }],
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: "cite",
|
|
517
|
+
group: "Working from documents",
|
|
518
|
+
description: "Attaches a quote you already recorded to another node.",
|
|
519
|
+
forms: [{ description: "Links the quote to the node.", examples: ["okb cite Button quote.4"], args: [["<node>", "name", "The class, slot, instance or rule."], ["<quote id>", "quote id", "The quote. `okb quote list` shows them."]] }],
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
name: "verify",
|
|
523
|
+
group: "Working from documents",
|
|
524
|
+
description: "Records the result of an independent check that a node matches what its quote says, or approves it.",
|
|
525
|
+
forms: [{
|
|
526
|
+
description: "Sets a verification status, or approves the node.",
|
|
527
|
+
examples: ["okb verify rule.1 --status SUPPORTED", "okb verify rule.1 --approve"],
|
|
528
|
+
args: [
|
|
529
|
+
["<node>", "name", "The node to verify."],
|
|
530
|
+
["--status", "SUPPORTED, OVERREACH or UNSUPPORTED", "What the check found."],
|
|
531
|
+
["--corrected", "text", "A corrected wording, for OVERREACH."],
|
|
532
|
+
["--confidence", "verbatim or paraphrased", "How closely the node follows the quote."],
|
|
533
|
+
["--note", "text", "A note about the check."],
|
|
534
|
+
["--approve", "flag", "Approve it after review."],
|
|
535
|
+
],
|
|
536
|
+
}],
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "skills",
|
|
540
|
+
group: "Skills",
|
|
541
|
+
description: "Puts the skills that come with okb where Claude Code and Cursor load them from, and checks that they match this okb.",
|
|
542
|
+
forms: [
|
|
543
|
+
{
|
|
544
|
+
sub: "install",
|
|
545
|
+
description: "Links the three skills into `~/.claude/skills/` (a link keeps them current when the package updates), or copies them. It replaces a link to an older okb, a broken link or an older copy. It refuses to touch a folder that is not one of okb's, and changes nothing if it refuses.",
|
|
546
|
+
examples: ["okb skills install", "okb skills install --copy", "okb skills install --dir ~/.cursor/skills"],
|
|
547
|
+
args: [
|
|
548
|
+
["--copy", "flag", "Copy the skill folders instead of linking to them. Run it again after you update okb."],
|
|
549
|
+
["--dir", "path", "The skills folder to use instead of `~/.claude/skills/`. The `OKB_SKILLS_DIR` environment variable sets it too."],
|
|
550
|
+
["--force", "flag", "Delete a folder or file that is not one of okb's skills (or a copy you edited) and put the skill in its place."],
|
|
551
|
+
],
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
sub: "status",
|
|
555
|
+
description: "Lists each skill with where it is installed and whether its version matches this okb. It exits with code 1 when any skill is missing or out of date.",
|
|
556
|
+
examples: ["okb skills status", "okb skills status --dir ~/.cursor/skills"],
|
|
557
|
+
args: [["--dir", "path", "The skills folder to check instead of `~/.claude/skills/`."]],
|
|
558
|
+
},
|
|
559
|
+
],
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
name: "rename",
|
|
563
|
+
group: "Housekeeping",
|
|
564
|
+
description: "Renames a class, slot or instance and updates everything that points to it.",
|
|
565
|
+
forms: [{ description: "Renames one thing.", examples: ["okb rename Vino Wine"], args: [["<old name>", "name", "The current name."], ["<new name>", "text", "The new name."], ["--force", "flag", "Rename it even if the name breaks your convention."]] }],
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
name: "remove",
|
|
569
|
+
group: "Housekeeping",
|
|
570
|
+
description: "Deletes a class, slot, instance, term or other node, with the edges that touch it.",
|
|
571
|
+
forms: [{ description: "Deletes one thing.", examples: ["okb remove Vino", "okb remove genre --type Slot"], args: [["<name>", "name", "What to delete."], ["--type", "text", "Which kind, when a name is ambiguous: Class, Slot, Instance, Term and so on."]] }],
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "drift",
|
|
575
|
+
group: "Housekeeping",
|
|
576
|
+
description: "Compares quotes with the documents they came from and reports quotes that no longer match.",
|
|
577
|
+
forms: [{ description: "Checks one or more ontology folders. With none it checks the current folder.", examples: ["okb drift .", "okb drift ../wine ../food"], args: [["[folder]...", "paths", "The ontology folders to check."]] }],
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: "help",
|
|
581
|
+
group: "Housekeeping",
|
|
582
|
+
description: "Prints a one-screen summary of the commands. `okb --help` and `okb -h` do the same.",
|
|
583
|
+
forms: [{ description: "Prints the summary.", examples: ["okb help"], args: [] }],
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
name: "version",
|
|
587
|
+
group: "Housekeeping",
|
|
588
|
+
description: "Prints the okb version and the version of the rules it carries. `okb --version` does the same.",
|
|
589
|
+
forms: [{ description: "Prints both versions.", examples: ["okb version"], args: [] }],
|
|
590
|
+
},
|
|
591
|
+
];
|
|
592
|
+
/** The commands you need most, for the cheat sheet. Each example's command must exist above. */
|
|
593
|
+
export const CHEAT_SHEET = [
|
|
594
|
+
{ example: 'okb init wine --name "Wine and Food"', description: "Start a new ontology" },
|
|
595
|
+
{ example: "okb status", description: "See where you are and what to do next" },
|
|
596
|
+
{ example: "okb step next", description: "Move on to the next step" },
|
|
597
|
+
{ example: "okb explain class", description: "Learn what a term or rule means" },
|
|
598
|
+
{ example: "okb validate", description: "Check your ontology against the rules" },
|
|
599
|
+
{ example: 'okb scope --domain "..." --purpose "..."', description: "Record what the ontology is for" },
|
|
600
|
+
{ example: 'okb cq add "Which wines go with fish?"', description: "Add a competency question" },
|
|
601
|
+
{ example: 'okb reuse none --why "..."', description: "Record that nothing existing fits" },
|
|
602
|
+
{ example: "okb term add wine grape winery", description: "Collect the words of your domain" },
|
|
603
|
+
{ example: "okb class add RedWine --parent Wine", description: "Add a class" },
|
|
604
|
+
{ example: "okb tree", description: "See the class hierarchy" },
|
|
605
|
+
{ example: "okb property add body --on Wine --type Enumerated --values light,full", description: "Add a plain-value slot" },
|
|
606
|
+
{ example: "okb relationship add maker --from Wine --to Winery", description: "Add a link between classes" },
|
|
607
|
+
{ example: "okb slot set maker --card single --min 1", description: "Tighten a slot" },
|
|
608
|
+
{ example: "okb show Wine", description: "See everything about one class, slot or instance" },
|
|
609
|
+
{ example: 'okb instance add "Chateau Morgon" --of Beaujolais body=light', description: "Add an instance" },
|
|
610
|
+
{ example: "okb link Radio preferredOver SegmentedControl", description: "Connect two instances" },
|
|
611
|
+
{ example: "okb review", description: "Get questions only a person can judge" },
|
|
612
|
+
{ example: 'okb decision add --title "..." --decision "..." --why "..."', description: "Record a design decision" },
|
|
613
|
+
{ example: "okb diagram --out diagram.md", description: "Draw the ontology" },
|
|
614
|
+
{ example: "okb export --format cypher --out wine.cypher", description: "Export for a graph database" },
|
|
615
|
+
{ example: "okb source add docs/button.md", description: "Register a document to extract from" },
|
|
616
|
+
{ example: 'okb quote add button "verbatim text" --cites Button', description: "Record a quote" },
|
|
617
|
+
{ example: 'okb rule add --statement "..." --modality SHOULD --cites quote.1', description: "Record a rule a document states" },
|
|
618
|
+
{ example: "okb verify rule.1 --status SUPPORTED", description: "Record an independent check" },
|
|
619
|
+
{ example: "okb skills install", description: "Install the Claude skills that ship with okb" },
|
|
620
|
+
{ example: "okb rename Vino Wine", description: "Rename something everywhere" },
|
|
621
|
+
{ example: "okb remove Vino", description: "Delete something" },
|
|
622
|
+
];
|