glassbrain 0.2.0-alpha.5 → 0.2.0-alpha.7

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.
@@ -2,50 +2,152 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://unpkg.com/glassbrain/schema/graph.schema.json",
4
4
  "title": "glassbrain graph",
5
- "description": "One file of a glassbrain knowledge graph. A graph is nodes plus edges; structure comes from `parent` (containment), not from edges. Every node carries `parent`: null for the root, otherwise `\"<id>@<order>\"` where `order` is a positive number or -1 for explicitly unordered. Several files in one folder are merged into one graph (same id = same node). Unknown fields are kept and shown in the detail panel.",
5
+ "description": "An ordered forest of node fragments plus semantic edges. Nest nodes in children; array order is reading order. Same id means the same node: absent fields are filled, equal values are accepted, conflicting values are errors. Children declarations must have identical direct child id sequences. Top-level fragments acquire a parent wherever another node contains their id. Each node has at most one parent; cycles are invalid.",
6
6
  "type": "object",
7
- "anyOf": [{ "required": ["nodes"] }, { "required": ["edges"] }],
7
+ "anyOf": [
8
+ {
9
+ "required": [
10
+ "nodes"
11
+ ]
12
+ },
13
+ {
14
+ "required": [
15
+ "edges"
16
+ ]
17
+ }
18
+ ],
8
19
  "properties": {
9
- "name": { "type": "string", "description": "Title of this file (shown as its source name)." },
10
- "title": { "type": "string", "description": "Alias of `name`." },
20
+ "name": {
21
+ "type": "string",
22
+ "description": "Title of this file (shown as its source name)."
23
+ },
24
+ "title": {
25
+ "type": "string",
26
+ "description": "Alias of `name`."
27
+ },
11
28
  "nodes": {
12
29
  "type": "array",
13
- "items": { "$ref": "#/$defs/node" }
30
+ "items": {
31
+ "$ref": "#/$defs/node"
32
+ }
14
33
  },
15
34
  "edges": {
16
35
  "type": "array",
17
- "items": { "$ref": "#/$defs/edge" }
36
+ "items": {
37
+ "$ref": "#/$defs/edge"
38
+ }
18
39
  }
19
40
  },
20
41
  "$defs": {
21
42
  "node": {
22
43
  "type": "object",
23
- "required": ["id", "parent"],
44
+ "required": [
45
+ "id"
46
+ ],
24
47
  "properties": {
25
- "id": { "type": ["string", "number"], "pattern": "^[^\\s@]{1,80}$", "description": "Stable identity. Keep it the same across versions: that is how a diff knows it is the same thing. No `@` and no whitespace, at most 80 characters; prefer a short code (`a-z0-9_`, under 20)." },
26
- "label": { "type": "string", "description": "Display name. Falls back to `name`, then `id`." },
27
- "name": { "type": "string", "description": "Alias of `label`." },
28
- "kind": { "type": "string", "description": "What sort of thing this is. Colors come from the profile's `nodePalette[kind]`; kinds not in the palette are drawn as skeleton." },
29
- "parent": { "type": ["string", "null"], "pattern": "^[^\\s@]{1,80}@(-1|[1-9]\\d*(\\.\\d+)?|0\\.\\d*[1-9]\\d*)$", "description": "`\"<id>@<order>\"`: the id of the node this one sits inside, then its position among the siblings (1, 2, 3…; 3.5 inserts between 3 and 4), or -1 for explicitly unordered. null for the root. Required: the only source of structure, and the layout, the layers and the outline are all built from it." },
30
- "flags": { "type": "array", "items": { "type": "string" }, "description": "Boolean markers; each becomes a CSS-like class. A flag listed in the profile's `placeholderFlags` draws the node as a placeholder." },
31
- "description": { "type": "string", "description": "Markdown shown in the detail panel. `[text](node:<id>)` links jump to another node." }
48
+ "id": {
49
+ "type": [
50
+ "string",
51
+ "number"
52
+ ],
53
+ "pattern": "\\S",
54
+ "description": "Non-empty stable identity. Keep it the same across versions: that is how a diff knows it is the same thing. Prefer a short code."
55
+ },
56
+ "label": {
57
+ "type": "string",
58
+ "description": "Display name. Falls back to `name`, then `id`."
59
+ },
60
+ "name": {
61
+ "type": "string",
62
+ "description": "Alias of `label`."
63
+ },
64
+ "kind": {
65
+ "type": "string",
66
+ "description": "What sort of thing this is. Colors come from the profile's `nodePalette[kind]`; kinds not in the palette are drawn as skeleton."
67
+ },
68
+ "flags": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string"
72
+ },
73
+ "description": "Boolean markers; each becomes a CSS-like class. A flag listed in the profile's `placeholderFlags` draws the node as a placeholder."
74
+ },
75
+ "description": {
76
+ "type": "string",
77
+ "description": "Markdown shown in the detail panel. `[text](node:<id>)` links jump to another node."
78
+ },
79
+ "children": {
80
+ "type": "array",
81
+ "items": {
82
+ "$ref": "#/$defs/node"
83
+ },
84
+ "description": "Ordered direct children. Omitted means unspecified; [] explicitly declares no children. Multiple declarations must name the same ids in the same order; child fields are composed independently by id."
85
+ },
86
+ "unordered": { "type": "boolean" },
87
+ "parent": false,
88
+ "order": false,
89
+ "layer": false
32
90
  },
33
91
  "additionalProperties": true
34
92
  },
35
93
  "edge": {
36
94
  "type": "object",
37
95
  "anyOf": [
38
- { "required": ["source", "target"] },
39
- { "required": ["from", "to"] }
96
+ {
97
+ "required": [
98
+ "source",
99
+ "target"
100
+ ]
101
+ },
102
+ {
103
+ "required": [
104
+ "from",
105
+ "to"
106
+ ]
107
+ }
40
108
  ],
41
109
  "properties": {
42
- "source": { "type": ["string", "number"], "description": "Node id the edge starts at." },
43
- "target": { "type": ["string", "number"], "description": "Node id the edge points to." },
44
- "from": { "type": ["string", "number"], "description": "Alias of `source`." },
45
- "to": { "type": ["string", "number"], "description": "Alias of `target`." },
46
- "kind": { "type": "string", "description": "Relation type. Colors come from the profile's `edgePalette[kind]`. An edge is identified by its two ends plus its kind." },
47
- "label": { "type": "string" },
48
- "weight": { "type": "number", "minimum": 0, "maximum": 1, "description": "0–1 (confidence, strength…); drives line width." }
110
+ "source": {
111
+ "type": [
112
+ "string",
113
+ "number"
114
+ ],
115
+ "description": "Node id the edge starts at."
116
+ },
117
+ "target": {
118
+ "type": [
119
+ "string",
120
+ "number"
121
+ ],
122
+ "description": "Node id the edge points to."
123
+ },
124
+ "from": {
125
+ "type": [
126
+ "string",
127
+ "number"
128
+ ],
129
+ "description": "Alias of `source`."
130
+ },
131
+ "to": {
132
+ "type": [
133
+ "string",
134
+ "number"
135
+ ],
136
+ "description": "Alias of `target`."
137
+ },
138
+ "kind": {
139
+ "type": "string",
140
+ "description": "Relation type. Colors come from the profile's `edgePalette[kind]`. An edge is identified by its two ends plus its kind."
141
+ },
142
+ "label": {
143
+ "type": "string"
144
+ },
145
+ "weight": {
146
+ "type": "number",
147
+ "minimum": 0,
148
+ "maximum": 1,
149
+ "description": "0–1 (confidence, strength…); drives line width."
150
+ }
49
151
  },
50
152
  "additionalProperties": true
51
153
  }
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://unpkg.com/glassbrain/schema/profile.schema.json",
4
4
  "title": "glassbrain profile (_profile.json)",
5
- "description": "The declarative part of a glassbrain profile, as a `_profile.json` next to the graph files. Everything is optional: with no profile a graph still renders (kinds without a color are drawn as skeleton). Layers are not configured here: they are derived from `order` in the graph. Parsers, merge and domain validation are code and live in a TypeScript profile instead.",
5
+ "description": "The declarative part of a glassbrain profile, as a `_profile.json` next to the graph files. Everything is optional: with no profile a graph still renders (kinds without a color are drawn as skeleton). Layers are not configured here: they are derived from the order of children in the graph. Parsers, merge and domain validation are code and live in a TypeScript profile instead.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "nodePalette": {
@@ -42,7 +42,7 @@
42
42
  "properties": {
43
43
  "defaultLayers": {
44
44
  "type": "boolean",
45
- "description": "Open with the layer (2.5D plane) view on when the graph has ordered siblings. Default false."
45
+ "description": "Open with the layer (2.5D plane) view on when the graph has ordered siblings. By default, opens layered when the graph has two or more floors."
46
46
  },
47
47
  "layerColors": {
48
48
  "type": "array",