@nicia-ai/typegraph 0.40.0 → 0.41.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/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.d.cts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/pglite-store.cjs +3 -3
- package/dist/backend/postgres/pglite-store.d.cts +5 -5
- package/dist/backend/postgres/pglite-store.d.ts +5 -5
- package/dist/backend/postgres/pglite-store.js +2 -2
- package/dist/backend/postgres/pglite.d.cts +2 -2
- package/dist/backend/postgres/pglite.d.ts +2 -2
- package/dist/backend/sqlite/index.d.cts +5 -5
- package/dist/backend/sqlite/index.d.ts +5 -5
- package/dist/backend/sqlite/libsql.d.cts +2 -2
- package/dist/backend/sqlite/libsql.d.ts +2 -2
- package/dist/backend/sqlite/local-store.cjs +3 -3
- package/dist/backend/sqlite/local-store.d.cts +5 -5
- package/dist/backend/sqlite/local-store.d.ts +5 -5
- package/dist/backend/sqlite/local-store.js +2 -2
- package/dist/backend/sqlite/local.d.cts +2 -2
- package/dist/backend/sqlite/local.d.ts +2 -2
- package/dist/{chunk-K4FB2RMO.cjs → chunk-JP5EICR6.cjs} +7 -2
- package/dist/chunk-JP5EICR6.cjs.map +1 -0
- package/dist/chunk-KOI7UEI5.js +81 -0
- package/dist/chunk-KOI7UEI5.js.map +1 -0
- package/dist/{chunk-H6I36MGT.cjs → chunk-LOKG3KQV.cjs} +114 -37
- package/dist/chunk-LOKG3KQV.cjs.map +1 -0
- package/dist/{chunk-3BL3JFHL.js → chunk-MQBF3XGY.js} +82 -5
- package/dist/chunk-MQBF3XGY.js.map +1 -0
- package/dist/chunk-QCKD3RCI.cjs +83 -0
- package/dist/chunk-QCKD3RCI.cjs.map +1 -0
- package/dist/{chunk-CU3LPYNB.js → chunk-V3S74J44.js} +7 -3
- package/dist/chunk-V3S74J44.js.map +1 -0
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/{ddl-KnCdF_le.d.cts → ddl-BCXFRLWg.d.cts} +3 -3
- package/dist/{ddl-BLEzHw6j.d.ts → ddl-ByLmGgn9.d.ts} +3 -3
- package/dist/{define-graph-DQnj3fNH.d.ts → define-graph-BSviZubs.d.ts} +1 -1
- package/dist/{define-graph-Cv3CFwKm.d.cts → define-graph-XyJheaFm.d.cts} +1 -1
- package/dist/graph-merge/index.cjs +5 -5
- package/dist/graph-merge/index.d.cts +5 -5
- package/dist/graph-merge/index.d.ts +5 -5
- package/dist/graph-merge/index.js +2 -2
- package/dist/index.cjs +58 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/interchange/index.d.cts +5 -5
- package/dist/interchange/index.d.ts +5 -5
- package/dist/{manager-DjE6Mhag.d.ts → manager-C7iC5bk_.d.ts} +27 -3
- package/dist/{manager-mqee5MVB.d.cts → manager-Dm6MCYO7.d.cts} +27 -3
- package/dist/{postgres-Bm4DyFQU.d.cts → postgres-Cb6ceh4-.d.ts} +1 -1
- package/dist/{postgres-DtaVALOZ.d.ts → postgres-DZxwzCQ8.d.cts} +1 -1
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/provenance/index.d.cts +5 -5
- package/dist/provenance/index.d.ts +5 -5
- package/dist/schema/index.cjs +29 -95
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +55 -55
- package/dist/schema/index.d.ts +55 -55
- package/dist/schema/index.js +2 -80
- package/dist/schema/index.js.map +1 -1
- package/dist/{searchable-ChJ29MCd.d.ts → searchable-Cet4Oztt.d.ts} +2 -2
- package/dist/{searchable-BxlJQVFw.d.cts → searchable-aUaKh3_r.d.cts} +2 -2
- package/dist/{sqlite-m9Izphk_.d.ts → sqlite-Cb3Ilj9_.d.ts} +1 -1
- package/dist/{sqlite-DT6tTHOG.d.cts → sqlite-Dxklpizv.d.cts} +1 -1
- package/dist/{store-view-CagdeyNn.d.ts → store-view-BDjGFjpN.d.ts} +64 -13
- package/dist/{store-view-C-buB8Q8.d.cts → store-view-PCT7vTKH.d.cts} +64 -13
- package/dist/{types-CYdXzZef.d.ts → types-CFZiEEPh.d.ts} +1 -1
- package/dist/{types-CqSfMRW3.d.cts → types-CsaG00wS.d.cts} +1 -1
- package/dist/{types-D8szWDUo.d.ts → types-D-vOo_pM.d.ts} +1 -1
- package/dist/{types-C5pZeKTl.d.cts → types-ho4DJJb_.d.cts} +1 -1
- package/dist/{where-sQL4u5h-.d.ts → where-DLYaXa4L.d.ts} +1 -1
- package/dist/{where-C3-HRgUq.d.cts → where-udes1WRA.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3BL3JFHL.js.map +0 -1
- package/dist/chunk-CU3LPYNB.js.map +0 -1
- package/dist/chunk-H6I36MGT.cjs.map +0 -1
- package/dist/chunk-K4FB2RMO.cjs.map +0 -1
package/dist/schema/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQCKD3RCI_cjs = require('../chunk-QCKD3RCI.cjs');
|
|
4
|
+
var chunkJP5EICR6_cjs = require('../chunk-JP5EICR6.cjs');
|
|
4
5
|
require('../chunk-RW24SAHI.cjs');
|
|
5
6
|
var chunkX4PVHAZ6_cjs = require('../chunk-X4PVHAZ6.cjs');
|
|
6
7
|
require('../chunk-ACSVZPK7.cjs');
|
|
@@ -24,153 +25,87 @@ require('../chunk-XRU7V7FF.cjs');
|
|
|
24
25
|
require('../chunk-SAFZ6JTI.cjs');
|
|
25
26
|
require('../chunk-TDXIBCGY.cjs');
|
|
26
27
|
|
|
27
|
-
// src/schema/deserializer.ts
|
|
28
|
-
function deserializeSchema(schema) {
|
|
29
|
-
const nodeNames = Object.keys(schema.nodes);
|
|
30
|
-
const edgeNames = Object.keys(schema.edges);
|
|
31
|
-
const metaEdgeNames = Object.keys(schema.ontology.metaEdges);
|
|
32
|
-
return {
|
|
33
|
-
graphId: schema.graphId,
|
|
34
|
-
version: schema.version,
|
|
35
|
-
generatedAt: schema.generatedAt,
|
|
36
|
-
getNode: (name) => schema.nodes[name],
|
|
37
|
-
getNodeNames: () => nodeNames,
|
|
38
|
-
getEdge: (name) => schema.edges[name],
|
|
39
|
-
getEdgeNames: () => edgeNames,
|
|
40
|
-
getMetaEdge: (name) => schema.ontology.metaEdges[name],
|
|
41
|
-
getMetaEdgeNames: () => metaEdgeNames,
|
|
42
|
-
getRelations: () => schema.ontology.relations,
|
|
43
|
-
getClosures: () => schema.ontology.closures,
|
|
44
|
-
getDefaults: () => schema.defaults,
|
|
45
|
-
getRaw: () => schema,
|
|
46
|
-
buildRegistry: () => buildRegistryFromClosures(schema)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function buildRegistryFromClosures(schema) {
|
|
50
|
-
const { closures } = schema.ontology;
|
|
51
|
-
const subClassAncestors = recordToMap(closures.subClassAncestors);
|
|
52
|
-
const subClassDescendants = recordToMap(closures.subClassDescendants);
|
|
53
|
-
const broaderClosure = recordToMap(closures.broaderClosure);
|
|
54
|
-
const narrowerClosure = recordToMap(closures.narrowerClosure);
|
|
55
|
-
const equivalenceSets = recordToMap(closures.equivalenceSets);
|
|
56
|
-
const partOfClosure = recordToMap(closures.partOfClosure);
|
|
57
|
-
const hasPartClosure = recordToMap(closures.hasPartClosure);
|
|
58
|
-
const iriToKind = simpleRecordToMap(closures.iriToKind);
|
|
59
|
-
const disjointPairs = new Set(closures.disjointPairs);
|
|
60
|
-
const edgeInverses = simpleRecordToMap(closures.edgeInverses);
|
|
61
|
-
const edgeImplicationsClosure = recordToMap(closures.edgeImplicationsClosure);
|
|
62
|
-
const edgeImplyingClosure = recordToMap(closures.edgeImplyingClosure);
|
|
63
|
-
const nodeKinds = /* @__PURE__ */ new Map();
|
|
64
|
-
const edgeKinds = /* @__PURE__ */ new Map();
|
|
65
|
-
const registry = new chunkK4FB2RMO_cjs.KindRegistry(nodeKinds, edgeKinds, {
|
|
66
|
-
subClassAncestors,
|
|
67
|
-
subClassDescendants,
|
|
68
|
-
broaderClosure,
|
|
69
|
-
narrowerClosure,
|
|
70
|
-
equivalenceSets,
|
|
71
|
-
iriToKind,
|
|
72
|
-
disjointPairs,
|
|
73
|
-
partOfClosure,
|
|
74
|
-
hasPartClosure,
|
|
75
|
-
edgeInverses,
|
|
76
|
-
edgeImplicationsClosure,
|
|
77
|
-
edgeImplyingClosure
|
|
78
|
-
});
|
|
79
|
-
chunkK4FB2RMO_cjs.validateImpliesEndpointCompatibility(
|
|
80
|
-
buildEdgeEndpointKinds(schema.edges),
|
|
81
|
-
registry
|
|
82
|
-
);
|
|
83
|
-
return registry;
|
|
84
|
-
}
|
|
85
|
-
function buildEdgeEndpointKinds(edges) {
|
|
86
|
-
const result = /* @__PURE__ */ new Map();
|
|
87
|
-
for (const [kind, def] of Object.entries(edges)) {
|
|
88
|
-
result.set(kind, { from: def.fromKinds, to: def.toKinds });
|
|
89
|
-
}
|
|
90
|
-
return result;
|
|
91
|
-
}
|
|
92
|
-
function recordToMap(record) {
|
|
93
|
-
const result = /* @__PURE__ */ new Map();
|
|
94
|
-
for (const [key, values] of Object.entries(record)) {
|
|
95
|
-
result.set(key, new Set(values));
|
|
96
|
-
}
|
|
97
|
-
return result;
|
|
98
|
-
}
|
|
99
|
-
function simpleRecordToMap(record) {
|
|
100
|
-
return new Map(Object.entries(record));
|
|
101
|
-
}
|
|
102
28
|
|
|
29
|
+
|
|
30
|
+
Object.defineProperty(exports, "deserializeSchema", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkQCKD3RCI_cjs.deserializeSchema; }
|
|
33
|
+
});
|
|
103
34
|
Object.defineProperty(exports, "applyDeprecatedKinds", {
|
|
104
35
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkJP5EICR6_cjs.applyDeprecatedKinds; }
|
|
106
37
|
});
|
|
107
38
|
Object.defineProperty(exports, "assertSchemaCurrent", {
|
|
108
39
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkJP5EICR6_cjs.assertSchemaCurrent; }
|
|
110
41
|
});
|
|
111
42
|
Object.defineProperty(exports, "computeSchemaDiff", {
|
|
112
43
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkJP5EICR6_cjs.computeSchemaDiff; }
|
|
114
45
|
});
|
|
115
46
|
Object.defineProperty(exports, "computeSchemaHash", {
|
|
116
47
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkJP5EICR6_cjs.computeSchemaHash; }
|
|
118
49
|
});
|
|
119
50
|
Object.defineProperty(exports, "deserializeWherePredicate", {
|
|
120
51
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkJP5EICR6_cjs.deserializeWherePredicate; }
|
|
122
53
|
});
|
|
123
54
|
Object.defineProperty(exports, "ensureSchema", {
|
|
124
55
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkJP5EICR6_cjs.ensureSchema; }
|
|
126
57
|
});
|
|
127
58
|
Object.defineProperty(exports, "getActiveSchema", {
|
|
128
59
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkJP5EICR6_cjs.getActiveSchema; }
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "getCommittedSchemaVersion", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () { return chunkJP5EICR6_cjs.getCommittedSchemaVersion; }
|
|
130
65
|
});
|
|
131
66
|
Object.defineProperty(exports, "getMigrationActions", {
|
|
132
67
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkJP5EICR6_cjs.getMigrationActions; }
|
|
134
69
|
});
|
|
135
70
|
Object.defineProperty(exports, "getSchemaChanges", {
|
|
136
71
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkJP5EICR6_cjs.getSchemaChanges; }
|
|
138
73
|
});
|
|
139
74
|
Object.defineProperty(exports, "initializeSchema", {
|
|
140
75
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkJP5EICR6_cjs.initializeSchema; }
|
|
142
77
|
});
|
|
143
78
|
Object.defineProperty(exports, "isBackwardsCompatible", {
|
|
144
79
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkJP5EICR6_cjs.isBackwardsCompatible; }
|
|
146
81
|
});
|
|
147
82
|
Object.defineProperty(exports, "isSchemaInitialized", {
|
|
148
83
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkJP5EICR6_cjs.isSchemaInitialized; }
|
|
150
85
|
});
|
|
151
86
|
Object.defineProperty(exports, "loadActiveSchemaWithBootstrap", {
|
|
152
87
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkJP5EICR6_cjs.loadActiveSchemaWithBootstrap; }
|
|
154
89
|
});
|
|
155
90
|
Object.defineProperty(exports, "loadAndMergeGraphExtensionDocument", {
|
|
156
91
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
92
|
+
get: function () { return chunkJP5EICR6_cjs.loadAndMergeGraphExtensionDocument; }
|
|
158
93
|
});
|
|
159
94
|
Object.defineProperty(exports, "migrateSchema", {
|
|
160
95
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
96
|
+
get: function () { return chunkJP5EICR6_cjs.migrateSchema; }
|
|
162
97
|
});
|
|
163
98
|
Object.defineProperty(exports, "parseSerializedSchema", {
|
|
164
99
|
enumerable: true,
|
|
165
|
-
get: function () { return
|
|
100
|
+
get: function () { return chunkJP5EICR6_cjs.parseSerializedSchema; }
|
|
166
101
|
});
|
|
167
102
|
Object.defineProperty(exports, "rollbackSchema", {
|
|
168
103
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
104
|
+
get: function () { return chunkJP5EICR6_cjs.rollbackSchema; }
|
|
170
105
|
});
|
|
171
106
|
Object.defineProperty(exports, "serializeSchema", {
|
|
172
107
|
enumerable: true,
|
|
173
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkJP5EICR6_cjs.serializeSchema; }
|
|
174
109
|
});
|
|
175
110
|
Object.defineProperty(exports, "createValidationError", {
|
|
176
111
|
enumerable: true,
|
|
@@ -192,6 +127,5 @@ Object.defineProperty(exports, "wrapZodError", {
|
|
|
192
127
|
enumerable: true,
|
|
193
128
|
get: function () { return chunkX4PVHAZ6_cjs.wrapZodError; }
|
|
194
129
|
});
|
|
195
|
-
exports.deserializeSchema = deserializeSchema;
|
|
196
130
|
//# sourceMappingURL=index.cjs.map
|
|
197
131
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/schema/index.d.cts
CHANGED
|
@@ -1,13 +1,63 @@
|
|
|
1
|
-
import { K as KindRegistry } from '../manager-
|
|
2
|
-
export { C as ChangeSeverity, a as ChangeType, D as DeprecatedKindsChange, E as EdgeChange, b as ExtensionChange, I as IndexChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, c as SchemaDiff, S as SchemaManagerOptions, d as SchemaValidationResult, e as applyDeprecatedKinds, f as assertSchemaCurrent, g as computeSchemaDiff, h as ensureSchema, i as getActiveSchema, j as
|
|
3
|
-
import { q as
|
|
4
|
-
export { x as JsonSchema, y as SerializedOntology, z as SerializedUniqueConstraint } from '../types-
|
|
5
|
-
import { G as GraphDef } from '../define-graph-
|
|
1
|
+
import { K as KindRegistry } from '../manager-Dm6MCYO7.cjs';
|
|
2
|
+
export { C as ChangeSeverity, a as ChangeType, D as DeprecatedKindsChange, E as EdgeChange, b as ExtensionChange, I as IndexChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, c as SchemaDiff, S as SchemaManagerOptions, d as SchemaValidationResult, e as applyDeprecatedKinds, f as assertSchemaCurrent, g as computeSchemaDiff, h as ensureSchema, i as getActiveSchema, j as getCommittedSchemaVersion, k as getMigrationActions, l as getSchemaChanges, m as initializeSchema, n as isBackwardsCompatible, o as isSchemaInitialized, p as loadActiveSchemaWithBootstrap, q as loadAndMergeGraphExtensionDocument, r as migrateSchema, s as parseSerializedSchema, t as rollbackSchema } from '../manager-Dm6MCYO7.cjs';
|
|
3
|
+
import { q as SerializedNodeDef, r as SerializedEdgeDef, s as SerializedMetaEdge, t as SerializedOntologyRelation, u as SerializedClosures, v as SerializedSchema, w as SchemaHash } from '../types-ho4DJJb_.cjs';
|
|
4
|
+
export { x as JsonSchema, y as SerializedOntology, z as SerializedUniqueConstraint } from '../types-ho4DJJb_.cjs';
|
|
5
|
+
import { G as GraphDef } from '../define-graph-XyJheaFm.cjs';
|
|
6
6
|
import { c as NullCheckOp, K as KindEntity } from '../extension-types-BLEVH4SG.cjs';
|
|
7
7
|
import { ZodType, ZodError } from 'zod';
|
|
8
8
|
import { V as ValidationIssue, a as ValidationError } from '../index-BihFPsPu.cjs';
|
|
9
9
|
import '../materialize-indexes-ExQ6OrAh.cjs';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Schema deserializer for loading stored schemas.
|
|
13
|
+
*
|
|
14
|
+
* Reconstructs runtime objects from SerializedSchema.
|
|
15
|
+
* Note: Zod schemas cannot be fully reconstructed from JSON Schema,
|
|
16
|
+
* so this provides access to the serialized data for introspection.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A deserialized schema provides read-only access to schema metadata.
|
|
21
|
+
*
|
|
22
|
+
* Note: Unlike the original GraphDef, this does not include Zod schemas
|
|
23
|
+
* since those cannot be reconstructed from JSON Schema. Use this for
|
|
24
|
+
* introspection and metadata access only.
|
|
25
|
+
*/
|
|
26
|
+
type DeserializedSchema = Readonly<{
|
|
27
|
+
graphId: string;
|
|
28
|
+
version: number;
|
|
29
|
+
generatedAt: string;
|
|
30
|
+
/** Get node definition by name */
|
|
31
|
+
getNode: (name: string) => SerializedNodeDef | undefined;
|
|
32
|
+
/** Get all node names */
|
|
33
|
+
getNodeNames: () => readonly string[];
|
|
34
|
+
/** Get edge definition by name */
|
|
35
|
+
getEdge: (name: string) => SerializedEdgeDef | undefined;
|
|
36
|
+
/** Get all edge names */
|
|
37
|
+
getEdgeNames: () => readonly string[];
|
|
38
|
+
/** Get meta-edge definition by name */
|
|
39
|
+
getMetaEdge: (name: string) => SerializedMetaEdge | undefined;
|
|
40
|
+
/** Get all meta-edge names */
|
|
41
|
+
getMetaEdgeNames: () => readonly string[];
|
|
42
|
+
/** Get all ontology relations */
|
|
43
|
+
getRelations: () => readonly SerializedOntologyRelation[];
|
|
44
|
+
/** Get precomputed closures */
|
|
45
|
+
getClosures: () => SerializedClosures;
|
|
46
|
+
/** Get graph defaults */
|
|
47
|
+
getDefaults: () => SerializedSchema["defaults"];
|
|
48
|
+
/** Get the raw serialized schema */
|
|
49
|
+
getRaw: () => SerializedSchema;
|
|
50
|
+
/** Build a KindRegistry from the closures */
|
|
51
|
+
buildRegistry: () => KindRegistry;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Deserializes a SerializedSchema into a DeserializedSchema.
|
|
55
|
+
*
|
|
56
|
+
* @param schema - The serialized schema to deserialize
|
|
57
|
+
* @returns A deserialized schema with accessor methods
|
|
58
|
+
*/
|
|
59
|
+
declare function deserializeSchema(schema: SerializedSchema): DeserializedSchema;
|
|
60
|
+
|
|
11
61
|
/**
|
|
12
62
|
* Schema serializer for homoiconic storage.
|
|
13
63
|
*
|
|
@@ -67,56 +117,6 @@ declare function deserializeWherePredicate(serialized: string): (builder: Predic
|
|
|
67
117
|
*/
|
|
68
118
|
declare function computeSchemaHash(schema: SerializedSchema): Promise<SchemaHash>;
|
|
69
119
|
|
|
70
|
-
/**
|
|
71
|
-
* Schema deserializer for loading stored schemas.
|
|
72
|
-
*
|
|
73
|
-
* Reconstructs runtime objects from SerializedSchema.
|
|
74
|
-
* Note: Zod schemas cannot be fully reconstructed from JSON Schema,
|
|
75
|
-
* so this provides access to the serialized data for introspection.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* A deserialized schema provides read-only access to schema metadata.
|
|
80
|
-
*
|
|
81
|
-
* Note: Unlike the original GraphDef, this does not include Zod schemas
|
|
82
|
-
* since those cannot be reconstructed from JSON Schema. Use this for
|
|
83
|
-
* introspection and metadata access only.
|
|
84
|
-
*/
|
|
85
|
-
type DeserializedSchema = Readonly<{
|
|
86
|
-
graphId: string;
|
|
87
|
-
version: number;
|
|
88
|
-
generatedAt: string;
|
|
89
|
-
/** Get node definition by name */
|
|
90
|
-
getNode: (name: string) => SerializedNodeDef | undefined;
|
|
91
|
-
/** Get all node names */
|
|
92
|
-
getNodeNames: () => readonly string[];
|
|
93
|
-
/** Get edge definition by name */
|
|
94
|
-
getEdge: (name: string) => SerializedEdgeDef | undefined;
|
|
95
|
-
/** Get all edge names */
|
|
96
|
-
getEdgeNames: () => readonly string[];
|
|
97
|
-
/** Get meta-edge definition by name */
|
|
98
|
-
getMetaEdge: (name: string) => SerializedMetaEdge | undefined;
|
|
99
|
-
/** Get all meta-edge names */
|
|
100
|
-
getMetaEdgeNames: () => readonly string[];
|
|
101
|
-
/** Get all ontology relations */
|
|
102
|
-
getRelations: () => readonly SerializedOntologyRelation[];
|
|
103
|
-
/** Get precomputed closures */
|
|
104
|
-
getClosures: () => SerializedClosures;
|
|
105
|
-
/** Get graph defaults */
|
|
106
|
-
getDefaults: () => SerializedSchema["defaults"];
|
|
107
|
-
/** Get the raw serialized schema */
|
|
108
|
-
getRaw: () => SerializedSchema;
|
|
109
|
-
/** Build a KindRegistry from the closures */
|
|
110
|
-
buildRegistry: () => KindRegistry;
|
|
111
|
-
}>;
|
|
112
|
-
/**
|
|
113
|
-
* Deserializes a SerializedSchema into a DeserializedSchema.
|
|
114
|
-
*
|
|
115
|
-
* @param schema - The serialized schema to deserialize
|
|
116
|
-
* @returns A deserialized schema with accessor methods
|
|
117
|
-
*/
|
|
118
|
-
declare function deserializeSchema(schema: SerializedSchema): DeserializedSchema;
|
|
119
|
-
|
|
120
120
|
/**
|
|
121
121
|
* Contextual Validation Utilities
|
|
122
122
|
*
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,13 +1,63 @@
|
|
|
1
|
-
import { K as KindRegistry } from '../manager-
|
|
2
|
-
export { C as ChangeSeverity, a as ChangeType, D as DeprecatedKindsChange, E as EdgeChange, b as ExtensionChange, I as IndexChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, c as SchemaDiff, S as SchemaManagerOptions, d as SchemaValidationResult, e as applyDeprecatedKinds, f as assertSchemaCurrent, g as computeSchemaDiff, h as ensureSchema, i as getActiveSchema, j as
|
|
3
|
-
import { q as
|
|
4
|
-
export { x as JsonSchema, y as SerializedOntology, z as SerializedUniqueConstraint } from '../types-
|
|
5
|
-
import { G as GraphDef } from '../define-graph-
|
|
1
|
+
import { K as KindRegistry } from '../manager-C7iC5bk_.js';
|
|
2
|
+
export { C as ChangeSeverity, a as ChangeType, D as DeprecatedKindsChange, E as EdgeChange, b as ExtensionChange, I as IndexChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, c as SchemaDiff, S as SchemaManagerOptions, d as SchemaValidationResult, e as applyDeprecatedKinds, f as assertSchemaCurrent, g as computeSchemaDiff, h as ensureSchema, i as getActiveSchema, j as getCommittedSchemaVersion, k as getMigrationActions, l as getSchemaChanges, m as initializeSchema, n as isBackwardsCompatible, o as isSchemaInitialized, p as loadActiveSchemaWithBootstrap, q as loadAndMergeGraphExtensionDocument, r as migrateSchema, s as parseSerializedSchema, t as rollbackSchema } from '../manager-C7iC5bk_.js';
|
|
3
|
+
import { q as SerializedNodeDef, r as SerializedEdgeDef, s as SerializedMetaEdge, t as SerializedOntologyRelation, u as SerializedClosures, v as SerializedSchema, w as SchemaHash } from '../types-D-vOo_pM.js';
|
|
4
|
+
export { x as JsonSchema, y as SerializedOntology, z as SerializedUniqueConstraint } from '../types-D-vOo_pM.js';
|
|
5
|
+
import { G as GraphDef } from '../define-graph-BSviZubs.js';
|
|
6
6
|
import { c as NullCheckOp, K as KindEntity } from '../extension-types-BLEVH4SG.js';
|
|
7
7
|
import { ZodType, ZodError } from 'zod';
|
|
8
8
|
import { V as ValidationIssue, a as ValidationError } from '../index-BD_3TCgh.js';
|
|
9
9
|
import '../materialize-indexes-D4iei4Kp.js';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Schema deserializer for loading stored schemas.
|
|
13
|
+
*
|
|
14
|
+
* Reconstructs runtime objects from SerializedSchema.
|
|
15
|
+
* Note: Zod schemas cannot be fully reconstructed from JSON Schema,
|
|
16
|
+
* so this provides access to the serialized data for introspection.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A deserialized schema provides read-only access to schema metadata.
|
|
21
|
+
*
|
|
22
|
+
* Note: Unlike the original GraphDef, this does not include Zod schemas
|
|
23
|
+
* since those cannot be reconstructed from JSON Schema. Use this for
|
|
24
|
+
* introspection and metadata access only.
|
|
25
|
+
*/
|
|
26
|
+
type DeserializedSchema = Readonly<{
|
|
27
|
+
graphId: string;
|
|
28
|
+
version: number;
|
|
29
|
+
generatedAt: string;
|
|
30
|
+
/** Get node definition by name */
|
|
31
|
+
getNode: (name: string) => SerializedNodeDef | undefined;
|
|
32
|
+
/** Get all node names */
|
|
33
|
+
getNodeNames: () => readonly string[];
|
|
34
|
+
/** Get edge definition by name */
|
|
35
|
+
getEdge: (name: string) => SerializedEdgeDef | undefined;
|
|
36
|
+
/** Get all edge names */
|
|
37
|
+
getEdgeNames: () => readonly string[];
|
|
38
|
+
/** Get meta-edge definition by name */
|
|
39
|
+
getMetaEdge: (name: string) => SerializedMetaEdge | undefined;
|
|
40
|
+
/** Get all meta-edge names */
|
|
41
|
+
getMetaEdgeNames: () => readonly string[];
|
|
42
|
+
/** Get all ontology relations */
|
|
43
|
+
getRelations: () => readonly SerializedOntologyRelation[];
|
|
44
|
+
/** Get precomputed closures */
|
|
45
|
+
getClosures: () => SerializedClosures;
|
|
46
|
+
/** Get graph defaults */
|
|
47
|
+
getDefaults: () => SerializedSchema["defaults"];
|
|
48
|
+
/** Get the raw serialized schema */
|
|
49
|
+
getRaw: () => SerializedSchema;
|
|
50
|
+
/** Build a KindRegistry from the closures */
|
|
51
|
+
buildRegistry: () => KindRegistry;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Deserializes a SerializedSchema into a DeserializedSchema.
|
|
55
|
+
*
|
|
56
|
+
* @param schema - The serialized schema to deserialize
|
|
57
|
+
* @returns A deserialized schema with accessor methods
|
|
58
|
+
*/
|
|
59
|
+
declare function deserializeSchema(schema: SerializedSchema): DeserializedSchema;
|
|
60
|
+
|
|
11
61
|
/**
|
|
12
62
|
* Schema serializer for homoiconic storage.
|
|
13
63
|
*
|
|
@@ -67,56 +117,6 @@ declare function deserializeWherePredicate(serialized: string): (builder: Predic
|
|
|
67
117
|
*/
|
|
68
118
|
declare function computeSchemaHash(schema: SerializedSchema): Promise<SchemaHash>;
|
|
69
119
|
|
|
70
|
-
/**
|
|
71
|
-
* Schema deserializer for loading stored schemas.
|
|
72
|
-
*
|
|
73
|
-
* Reconstructs runtime objects from SerializedSchema.
|
|
74
|
-
* Note: Zod schemas cannot be fully reconstructed from JSON Schema,
|
|
75
|
-
* so this provides access to the serialized data for introspection.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* A deserialized schema provides read-only access to schema metadata.
|
|
80
|
-
*
|
|
81
|
-
* Note: Unlike the original GraphDef, this does not include Zod schemas
|
|
82
|
-
* since those cannot be reconstructed from JSON Schema. Use this for
|
|
83
|
-
* introspection and metadata access only.
|
|
84
|
-
*/
|
|
85
|
-
type DeserializedSchema = Readonly<{
|
|
86
|
-
graphId: string;
|
|
87
|
-
version: number;
|
|
88
|
-
generatedAt: string;
|
|
89
|
-
/** Get node definition by name */
|
|
90
|
-
getNode: (name: string) => SerializedNodeDef | undefined;
|
|
91
|
-
/** Get all node names */
|
|
92
|
-
getNodeNames: () => readonly string[];
|
|
93
|
-
/** Get edge definition by name */
|
|
94
|
-
getEdge: (name: string) => SerializedEdgeDef | undefined;
|
|
95
|
-
/** Get all edge names */
|
|
96
|
-
getEdgeNames: () => readonly string[];
|
|
97
|
-
/** Get meta-edge definition by name */
|
|
98
|
-
getMetaEdge: (name: string) => SerializedMetaEdge | undefined;
|
|
99
|
-
/** Get all meta-edge names */
|
|
100
|
-
getMetaEdgeNames: () => readonly string[];
|
|
101
|
-
/** Get all ontology relations */
|
|
102
|
-
getRelations: () => readonly SerializedOntologyRelation[];
|
|
103
|
-
/** Get precomputed closures */
|
|
104
|
-
getClosures: () => SerializedClosures;
|
|
105
|
-
/** Get graph defaults */
|
|
106
|
-
getDefaults: () => SerializedSchema["defaults"];
|
|
107
|
-
/** Get the raw serialized schema */
|
|
108
|
-
getRaw: () => SerializedSchema;
|
|
109
|
-
/** Build a KindRegistry from the closures */
|
|
110
|
-
buildRegistry: () => KindRegistry;
|
|
111
|
-
}>;
|
|
112
|
-
/**
|
|
113
|
-
* Deserializes a SerializedSchema into a DeserializedSchema.
|
|
114
|
-
*
|
|
115
|
-
* @param schema - The serialized schema to deserialize
|
|
116
|
-
* @returns A deserialized schema with accessor methods
|
|
117
|
-
*/
|
|
118
|
-
declare function deserializeSchema(schema: SerializedSchema): DeserializedSchema;
|
|
119
|
-
|
|
120
120
|
/**
|
|
121
121
|
* Contextual Validation Utilities
|
|
122
122
|
*
|
package/dist/schema/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export { applyDeprecatedKinds, assertSchemaCurrent, computeSchemaDiff, computeSchemaHash, deserializeWherePredicate, ensureSchema, getActiveSchema, getMigrationActions, getSchemaChanges, initializeSchema, isBackwardsCompatible, isSchemaInitialized, loadActiveSchemaWithBootstrap, loadAndMergeGraphExtensionDocument, migrateSchema, parseSerializedSchema, rollbackSchema, serializeSchema } from '../chunk-
|
|
1
|
+
export { deserializeSchema } from '../chunk-KOI7UEI5.js';
|
|
2
|
+
export { applyDeprecatedKinds, assertSchemaCurrent, computeSchemaDiff, computeSchemaHash, deserializeWherePredicate, ensureSchema, getActiveSchema, getCommittedSchemaVersion, getMigrationActions, getSchemaChanges, initializeSchema, isBackwardsCompatible, isSchemaInitialized, loadActiveSchemaWithBootstrap, loadAndMergeGraphExtensionDocument, migrateSchema, parseSerializedSchema, rollbackSchema, serializeSchema } from '../chunk-V3S74J44.js';
|
|
3
3
|
import '../chunk-76HE7DJP.js';
|
|
4
4
|
export { createValidationError, validateEdgeProps, validateNodeProps, validateProps, wrapZodError } from '../chunk-ZE6NVENI.js';
|
|
5
5
|
import '../chunk-UR7W5YQK.js';
|
|
@@ -22,83 +22,5 @@ import '../chunk-ITE4IXAK.js';
|
|
|
22
22
|
import '../chunk-XZA3Y4YH.js';
|
|
23
23
|
import '../chunk-DPNA466P.js';
|
|
24
24
|
import '../chunk-G6Q5UM7U.js';
|
|
25
|
-
|
|
26
|
-
// src/schema/deserializer.ts
|
|
27
|
-
function deserializeSchema(schema) {
|
|
28
|
-
const nodeNames = Object.keys(schema.nodes);
|
|
29
|
-
const edgeNames = Object.keys(schema.edges);
|
|
30
|
-
const metaEdgeNames = Object.keys(schema.ontology.metaEdges);
|
|
31
|
-
return {
|
|
32
|
-
graphId: schema.graphId,
|
|
33
|
-
version: schema.version,
|
|
34
|
-
generatedAt: schema.generatedAt,
|
|
35
|
-
getNode: (name) => schema.nodes[name],
|
|
36
|
-
getNodeNames: () => nodeNames,
|
|
37
|
-
getEdge: (name) => schema.edges[name],
|
|
38
|
-
getEdgeNames: () => edgeNames,
|
|
39
|
-
getMetaEdge: (name) => schema.ontology.metaEdges[name],
|
|
40
|
-
getMetaEdgeNames: () => metaEdgeNames,
|
|
41
|
-
getRelations: () => schema.ontology.relations,
|
|
42
|
-
getClosures: () => schema.ontology.closures,
|
|
43
|
-
getDefaults: () => schema.defaults,
|
|
44
|
-
getRaw: () => schema,
|
|
45
|
-
buildRegistry: () => buildRegistryFromClosures(schema)
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function buildRegistryFromClosures(schema) {
|
|
49
|
-
const { closures } = schema.ontology;
|
|
50
|
-
const subClassAncestors = recordToMap(closures.subClassAncestors);
|
|
51
|
-
const subClassDescendants = recordToMap(closures.subClassDescendants);
|
|
52
|
-
const broaderClosure = recordToMap(closures.broaderClosure);
|
|
53
|
-
const narrowerClosure = recordToMap(closures.narrowerClosure);
|
|
54
|
-
const equivalenceSets = recordToMap(closures.equivalenceSets);
|
|
55
|
-
const partOfClosure = recordToMap(closures.partOfClosure);
|
|
56
|
-
const hasPartClosure = recordToMap(closures.hasPartClosure);
|
|
57
|
-
const iriToKind = simpleRecordToMap(closures.iriToKind);
|
|
58
|
-
const disjointPairs = new Set(closures.disjointPairs);
|
|
59
|
-
const edgeInverses = simpleRecordToMap(closures.edgeInverses);
|
|
60
|
-
const edgeImplicationsClosure = recordToMap(closures.edgeImplicationsClosure);
|
|
61
|
-
const edgeImplyingClosure = recordToMap(closures.edgeImplyingClosure);
|
|
62
|
-
const nodeKinds = /* @__PURE__ */ new Map();
|
|
63
|
-
const edgeKinds = /* @__PURE__ */ new Map();
|
|
64
|
-
const registry = new KindRegistry(nodeKinds, edgeKinds, {
|
|
65
|
-
subClassAncestors,
|
|
66
|
-
subClassDescendants,
|
|
67
|
-
broaderClosure,
|
|
68
|
-
narrowerClosure,
|
|
69
|
-
equivalenceSets,
|
|
70
|
-
iriToKind,
|
|
71
|
-
disjointPairs,
|
|
72
|
-
partOfClosure,
|
|
73
|
-
hasPartClosure,
|
|
74
|
-
edgeInverses,
|
|
75
|
-
edgeImplicationsClosure,
|
|
76
|
-
edgeImplyingClosure
|
|
77
|
-
});
|
|
78
|
-
validateImpliesEndpointCompatibility(
|
|
79
|
-
buildEdgeEndpointKinds(schema.edges),
|
|
80
|
-
registry
|
|
81
|
-
);
|
|
82
|
-
return registry;
|
|
83
|
-
}
|
|
84
|
-
function buildEdgeEndpointKinds(edges) {
|
|
85
|
-
const result = /* @__PURE__ */ new Map();
|
|
86
|
-
for (const [kind, def] of Object.entries(edges)) {
|
|
87
|
-
result.set(kind, { from: def.fromKinds, to: def.toKinds });
|
|
88
|
-
}
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
91
|
-
function recordToMap(record) {
|
|
92
|
-
const result = /* @__PURE__ */ new Map();
|
|
93
|
-
for (const [key, values] of Object.entries(record)) {
|
|
94
|
-
result.set(key, new Set(values));
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
97
|
-
}
|
|
98
|
-
function simpleRecordToMap(record) {
|
|
99
|
-
return new Map(Object.entries(record));
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export { deserializeSchema };
|
|
103
25
|
//# sourceMappingURL=index.js.map
|
|
104
26
|
//# sourceMappingURL=index.js.map
|
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { p as VectorSlot } from './types-
|
|
3
|
-
import { G as GraphDef } from './define-graph-
|
|
2
|
+
import { p as VectorSlot } from './types-D-vOo_pM.js';
|
|
3
|
+
import { G as GraphDef } from './define-graph-BSviZubs.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Embedding type for vector search.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { p as VectorSlot } from './types-
|
|
3
|
-
import { G as GraphDef } from './define-graph-
|
|
2
|
+
import { p as VectorSlot } from './types-ho4DJJb_.cjs';
|
|
3
|
+
import { G as GraphDef } from './define-graph-XyJheaFm.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Embedding type for vector search.
|