@nicia-ai/typegraph 0.33.0 → 0.34.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/README.md +20 -0
- package/dist/backend/postgres/index.cjs +26 -22
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/index.js +13 -9
- package/dist/backend/postgres/pglite.cjs +17 -13
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +2 -2
- package/dist/backend/postgres/pglite.d.ts +2 -2
- package/dist/backend/postgres/pglite.js +13 -9
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +24 -20
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +12 -8
- package/dist/backend/sqlite/libsql.cjs +18 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +11 -4
- package/dist/backend/sqlite/libsql.d.ts +11 -4
- package/dist/backend/sqlite/libsql.js +14 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +18 -14
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +2 -2
- package/dist/backend/sqlite/local.d.ts +2 -2
- package/dist/backend/sqlite/local.js +13 -9
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-2EBMPJBO.js +16 -0
- package/dist/chunk-2EBMPJBO.js.map +1 -0
- package/dist/{chunk-CFNT3ITG.cjs → chunk-2JXB3NYJ.cjs} +15 -35
- package/dist/chunk-2JXB3NYJ.cjs.map +1 -0
- package/dist/{chunk-GYVBEZAO.js → chunk-2MRAX3UE.js} +3 -18
- package/dist/chunk-2MRAX3UE.js.map +1 -0
- package/dist/{chunk-D3EWZ67S.cjs → chunk-3BRVBQQD.cjs} +999 -2675
- package/dist/chunk-3BRVBQQD.cjs.map +1 -0
- package/dist/{chunk-FDN43KXV.cjs → chunk-3Z6TW3CT.cjs} +20 -19
- package/dist/chunk-3Z6TW3CT.cjs.map +1 -0
- package/dist/{chunk-6NRFUHMS.js → chunk-4DIBPQNJ.js} +5 -4
- package/dist/chunk-4DIBPQNJ.js.map +1 -0
- package/dist/chunk-4S2FXGBJ.js +9 -0
- package/dist/chunk-4S2FXGBJ.js.map +1 -0
- package/dist/chunk-5IQIX7LU.cjs +2070 -0
- package/dist/chunk-5IQIX7LU.cjs.map +1 -0
- package/dist/{chunk-CWFPJ3RC.js → chunk-6GNSY7AV.js} +3 -3
- package/dist/{chunk-CWFPJ3RC.js.map → chunk-6GNSY7AV.js.map} +1 -1
- package/dist/{chunk-NG5N7R45.cjs → chunk-6HVOHZHS.cjs} +184 -117
- package/dist/chunk-6HVOHZHS.cjs.map +1 -0
- package/dist/chunk-6SCVW4AS.js +20 -0
- package/dist/chunk-6SCVW4AS.js.map +1 -0
- package/dist/chunk-A7SZZFAG.js +2010 -0
- package/dist/chunk-A7SZZFAG.js.map +1 -0
- package/dist/chunk-ACSVZPK7.cjs +21 -0
- package/dist/chunk-ACSVZPK7.cjs.map +1 -0
- package/dist/{chunk-IZ4PCL47.js → chunk-BVTWD66D.js} +4 -66
- package/dist/chunk-BVTWD66D.js.map +1 -0
- package/dist/{chunk-QBYTJSAY.js → chunk-CHXTTSC6.js} +5 -39
- package/dist/chunk-CHXTTSC6.js.map +1 -0
- package/dist/{chunk-DJYRRDHA.js → chunk-CYX2JTDG.js} +3 -3
- package/dist/{chunk-DJYRRDHA.js.map → chunk-CYX2JTDG.js.map} +1 -1
- package/dist/{chunk-PRMKPFN5.js → chunk-DEQFL35G.js} +4 -3
- package/dist/chunk-DEQFL35G.js.map +1 -0
- package/dist/chunk-DI74SMXS.cjs +29 -0
- package/dist/chunk-DI74SMXS.cjs.map +1 -0
- package/dist/{chunk-WWVV44DY.cjs → chunk-G6SOJEDI.cjs} +11 -11
- package/dist/{chunk-WWVV44DY.cjs.map → chunk-G6SOJEDI.cjs.map} +1 -1
- package/dist/{chunk-LM2IC4ZJ.cjs → chunk-GQANNXXT.cjs} +15 -14
- package/dist/chunk-GQANNXXT.cjs.map +1 -0
- package/dist/chunk-GZCNZ7QW.js +24 -0
- package/dist/chunk-GZCNZ7QW.js.map +1 -0
- package/dist/{chunk-KTIEB7VH.cjs → chunk-HK5SATYM.cjs} +35 -58
- package/dist/chunk-HK5SATYM.cjs.map +1 -0
- package/dist/chunk-HMFK4BXR.cjs +12 -0
- package/dist/{chunk-6ZR4QC3O.cjs.map → chunk-HMFK4BXR.cjs.map} +1 -1
- package/dist/chunk-ITE4IXAK.js +25 -0
- package/dist/chunk-ITE4IXAK.js.map +1 -0
- package/dist/chunk-JJRCLAUN.cjs +155 -0
- package/dist/chunk-JJRCLAUN.cjs.map +1 -0
- package/dist/{chunk-ZFWNO3GE.cjs → chunk-JQGIPGVL.cjs} +66 -2
- package/dist/chunk-JQGIPGVL.cjs.map +1 -0
- package/dist/{chunk-XVUJY72M.js → chunk-K2TGS3EN.js} +105 -38
- package/dist/chunk-K2TGS3EN.js.map +1 -0
- package/dist/chunk-K34OPSJK.js +29 -0
- package/dist/chunk-K34OPSJK.js.map +1 -0
- package/dist/{chunk-YW7GHMF4.cjs → chunk-KGC4LY5T.cjs} +18 -17
- package/dist/chunk-KGC4LY5T.cjs.map +1 -0
- package/dist/{chunk-SST7XDY6.cjs → chunk-KNHYNQQ3.cjs} +111 -72
- package/dist/chunk-KNHYNQQ3.cjs.map +1 -0
- package/dist/{chunk-C4C4Q7A6.js → chunk-KUTNI6SI.js} +6 -21
- package/dist/chunk-KUTNI6SI.js.map +1 -0
- package/dist/{chunk-OS6KS3HV.js → chunk-LANHCOXB.js} +8 -7
- package/dist/chunk-LANHCOXB.js.map +1 -0
- package/dist/chunk-N6WTUSBV.cjs +23 -0
- package/dist/chunk-N6WTUSBV.cjs.map +1 -0
- package/dist/{chunk-73KASJGO.cjs → chunk-NAUA4PW5.cjs} +4 -28
- package/dist/chunk-NAUA4PW5.cjs.map +1 -0
- package/dist/chunk-QV245VMN.js +145 -0
- package/dist/chunk-QV245VMN.js.map +1 -0
- package/dist/{chunk-CEF2QOTO.js → chunk-RBV7YCQD.js} +4 -3
- package/dist/chunk-RBV7YCQD.js.map +1 -0
- package/dist/{chunk-OIE2UPVG.cjs → chunk-RHZWOJVA.cjs} +2 -19
- package/dist/chunk-RHZWOJVA.cjs.map +1 -0
- package/dist/{chunk-3IR2GEMJ.cjs → chunk-RRKQAKD6.cjs} +10 -9
- package/dist/chunk-RRKQAKD6.cjs.map +1 -0
- package/dist/{chunk-UPDMJEW6.js → chunk-RY2VIWAM.js} +11 -8
- package/dist/chunk-RY2VIWAM.js.map +1 -0
- package/dist/{chunk-PIHXFF73.js → chunk-SHLY4MCM.js} +3 -3
- package/dist/{chunk-PIHXFF73.js.map → chunk-SHLY4MCM.js.map} +1 -1
- package/dist/{chunk-SPT5JMME.js → chunk-T2DWPQNE.js} +103 -64
- package/dist/chunk-T2DWPQNE.js.map +1 -0
- package/dist/{chunk-WYTUF3QO.js → chunk-T46GR2VY.js} +3 -3
- package/dist/{chunk-WYTUF3QO.js.map → chunk-T46GR2VY.js.map} +1 -1
- package/dist/{chunk-MBLXCV2Y.cjs → chunk-T6SPUYLX.cjs} +5 -43
- package/dist/chunk-T6SPUYLX.cjs.map +1 -0
- package/dist/{chunk-3QRBXYT5.cjs → chunk-TGJE22RM.cjs} +6 -6
- package/dist/{chunk-3QRBXYT5.cjs.map → chunk-TGJE22RM.cjs.map} +1 -1
- package/dist/{chunk-BF3ZDEUE.cjs → chunk-TOTPVGOG.cjs} +70 -69
- package/dist/chunk-TOTPVGOG.cjs.map +1 -0
- package/dist/{chunk-KY5SDVA7.cjs → chunk-UJLOZYKT.cjs} +90 -87
- package/dist/chunk-UJLOZYKT.cjs.map +1 -0
- package/dist/{chunk-I4W7MKVG.cjs → chunk-UNNPKQUG.cjs} +19 -155
- package/dist/chunk-UNNPKQUG.cjs.map +1 -0
- package/dist/chunk-UR7W5YQK.js +18 -0
- package/dist/chunk-UR7W5YQK.js.map +1 -0
- package/dist/{chunk-PYD3UCDU.js → chunk-V3QNTB7Z.js} +19 -148
- package/dist/chunk-V3QNTB7Z.js.map +1 -0
- package/dist/{chunk-XKNAK27R.js → chunk-VCGO4V26.js} +4 -3
- package/dist/chunk-VCGO4V26.js.map +1 -0
- package/dist/{chunk-EF3Z645U.cjs → chunk-WL2SG7ZV.cjs} +6 -72
- package/dist/chunk-WL2SG7ZV.cjs.map +1 -0
- package/dist/{chunk-WLP6TKFB.js → chunk-WLRIWYHQ.js} +640 -2307
- package/dist/chunk-WLRIWYHQ.js.map +1 -0
- package/dist/{chunk-4RBAJVEC.cjs → chunk-WVC2Q2FD.cjs} +5 -5
- package/dist/{chunk-4RBAJVEC.cjs.map → chunk-WVC2Q2FD.cjs.map} +1 -1
- package/dist/chunk-XXVEULWX.js +39 -0
- package/dist/chunk-XXVEULWX.js.map +1 -0
- package/dist/chunk-YAZE7QZR.cjs +32 -0
- package/dist/chunk-YAZE7QZR.cjs.map +1 -0
- package/dist/chunk-YC6PWTHY.cjs +44 -0
- package/dist/chunk-YC6PWTHY.cjs.map +1 -0
- package/dist/chunk-Z5HBYM7U.cjs +11 -0
- package/dist/chunk-Z5HBYM7U.cjs.map +1 -0
- package/dist/{chunk-454I6GDF.js → chunk-Z5XBMDXU.js} +63 -3
- package/dist/chunk-Z5XBMDXU.js.map +1 -0
- package/dist/{chunk-3642VBVC.cjs → chunk-ZP5WHI4C.cjs} +106 -80
- package/dist/chunk-ZP5WHI4C.cjs.map +1 -0
- package/dist/{chunk-YCV72E6L.js → chunk-ZURTTSCM.js} +4 -25
- package/dist/chunk-ZURTTSCM.js.map +1 -0
- package/dist/{chunk-JHOBXD7O.js → chunk-ZV5N4DBG.js} +46 -20
- package/dist/chunk-ZV5N4DBG.js.map +1 -0
- package/dist/chunk-ZY4GXIVN.cjs +32 -0
- package/dist/chunk-ZY4GXIVN.cjs.map +1 -0
- package/dist/{ddl-CVnHJcar.d.ts → ddl-BrmPg61z.d.ts} +3 -3
- package/dist/{ddl-Dxt_fBHr.d.cts → ddl-j1-sH6lE.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +18 -17
- package/dist/graph-extension/index.js +3 -2
- package/dist/graph-merge/index.cjs +294 -146
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +3 -3
- package/dist/graph-merge/index.d.ts +3 -3
- package/dist/graph-merge/index.js +172 -24
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +181 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +30 -22
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +27 -25
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +9 -7
- package/dist/interchange/index.cjs +25 -16
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/interchange/index.js +12 -3
- package/dist/{manager-C0_r0ALf.d.ts → manager-BZUeN_BU.d.ts} +1 -1
- package/dist/{manager-BYl_zyZR.d.cts → manager-ms9cKdc6.d.cts} +1 -1
- package/dist/{postgres-MzBPkYzq.d.ts → postgres-BhpxGMC5.d.cts} +1 -1
- package/dist/{postgres-_9psmVGm.d.cts → postgres-CWHLwNl1.d.ts} +1 -1
- package/dist/profiler/index.cjs +3 -3
- package/dist/profiler/index.d.cts +5 -5
- package/dist/profiler/index.d.ts +5 -5
- package/dist/profiler/index.js +2 -2
- package/dist/provenance/index.cjs +591 -0
- package/dist/provenance/index.cjs.map +1 -0
- package/dist/provenance/index.d.cts +73 -0
- package/dist/provenance/index.d.ts +73 -0
- package/dist/provenance/index.js +589 -0
- package/dist/provenance/index.js.map +1 -0
- package/dist/schema/index.cjs +36 -32
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +4 -4
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +13 -9
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-gm44dShb.d.ts → sqlite-CGu5SLsw.d.ts} +1 -1
- package/dist/{sqlite-BfksSb45.d.cts → sqlite-XrDxNaa7.d.cts} +1 -1
- package/dist/{store-view-FfE5_7eo.d.ts → store-view-BlgnhEYf.d.ts} +33 -5
- package/dist/{store-view-9jQ2rPum.d.cts → store-view-D09po4H6.d.cts} +33 -5
- package/dist/{types-CdWxK-nD.d.ts → types-B1TbZJYS.d.ts} +1 -1
- package/dist/{types-DGylBhWo.d.ts → types-D1Sqeyxy.d.ts} +7 -3
- package/dist/{types-B6mhrcLv.d.cts → types-DiE1AO7p.d.cts} +1 -1
- package/dist/{types-C_UnQOQp.d.cts → types-DkNnF-7K.d.cts} +7 -3
- package/dist/{where-Bpp2ul_z.d.cts → where-DKjuofPr.d.cts} +1 -1
- package/dist/{where-BsEXraKW.d.ts → where-DrUIIWHb.d.ts} +1 -1
- package/package.json +8 -2
- package/dist/chunk-2YMGNYXY.js +0 -40
- package/dist/chunk-2YMGNYXY.js.map +0 -1
- package/dist/chunk-3642VBVC.cjs.map +0 -1
- package/dist/chunk-3IR2GEMJ.cjs.map +0 -1
- package/dist/chunk-454I6GDF.js.map +0 -1
- package/dist/chunk-6NRFUHMS.js.map +0 -1
- package/dist/chunk-6ZR4QC3O.cjs +0 -12
- package/dist/chunk-73KASJGO.cjs.map +0 -1
- package/dist/chunk-BF3ZDEUE.cjs.map +0 -1
- package/dist/chunk-C4C4Q7A6.js.map +0 -1
- package/dist/chunk-CEF2QOTO.js.map +0 -1
- package/dist/chunk-CFNT3ITG.cjs.map +0 -1
- package/dist/chunk-D3EWZ67S.cjs.map +0 -1
- package/dist/chunk-EF3Z645U.cjs.map +0 -1
- package/dist/chunk-FDN43KXV.cjs.map +0 -1
- package/dist/chunk-GYVBEZAO.js.map +0 -1
- package/dist/chunk-I4W7MKVG.cjs.map +0 -1
- package/dist/chunk-IZ4PCL47.js.map +0 -1
- package/dist/chunk-JHOBXD7O.js.map +0 -1
- package/dist/chunk-KTIEB7VH.cjs.map +0 -1
- package/dist/chunk-KY5SDVA7.cjs.map +0 -1
- package/dist/chunk-LM2IC4ZJ.cjs.map +0 -1
- package/dist/chunk-MBLXCV2Y.cjs.map +0 -1
- package/dist/chunk-NG5N7R45.cjs.map +0 -1
- package/dist/chunk-OIE2UPVG.cjs.map +0 -1
- package/dist/chunk-OS6KS3HV.js.map +0 -1
- package/dist/chunk-PRMKPFN5.js.map +0 -1
- package/dist/chunk-PYD3UCDU.js.map +0 -1
- package/dist/chunk-QBYTJSAY.js.map +0 -1
- package/dist/chunk-SPT5JMME.js.map +0 -1
- package/dist/chunk-SST7XDY6.cjs.map +0 -1
- package/dist/chunk-UPDMJEW6.js.map +0 -1
- package/dist/chunk-WLP6TKFB.js.map +0 -1
- package/dist/chunk-XKNAK27R.js.map +0 -1
- package/dist/chunk-XVUJY72M.js.map +0 -1
- package/dist/chunk-YCV72E6L.js.map +0 -1
- package/dist/chunk-YW7GHMF4.cjs.map +0 -1
- package/dist/chunk-ZFWNO3GE.cjs.map +0 -1
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
3
|
+
var chunkACSVZPK7_cjs = require('./chunk-ACSVZPK7.cjs');
|
|
4
|
+
var chunkT6SPUYLX_cjs = require('./chunk-T6SPUYLX.cjs');
|
|
5
|
+
var chunkRRKQAKD6_cjs = require('./chunk-RRKQAKD6.cjs');
|
|
6
|
+
var chunkZY4GXIVN_cjs = require('./chunk-ZY4GXIVN.cjs');
|
|
7
|
+
var chunkHK5SATYM_cjs = require('./chunk-HK5SATYM.cjs');
|
|
8
|
+
var chunkYC6PWTHY_cjs = require('./chunk-YC6PWTHY.cjs');
|
|
9
|
+
var chunkRHZWOJVA_cjs = require('./chunk-RHZWOJVA.cjs');
|
|
10
|
+
var chunkJQGIPGVL_cjs = require('./chunk-JQGIPGVL.cjs');
|
|
11
|
+
var chunkDI74SMXS_cjs = require('./chunk-DI74SMXS.cjs');
|
|
10
12
|
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
11
13
|
var zod = require('zod');
|
|
12
14
|
|
|
13
15
|
// src/core/node.ts
|
|
14
16
|
function validateSchemaKeys(schema, name) {
|
|
15
|
-
|
|
17
|
+
chunkHK5SATYM_cjs.assertSchemaKeysAreFree(
|
|
16
18
|
"Node",
|
|
17
19
|
name,
|
|
18
20
|
Object.keys(schema.shape),
|
|
19
|
-
|
|
21
|
+
chunkHK5SATYM_cjs.RESERVED_NODE_KEYS
|
|
20
22
|
);
|
|
21
23
|
}
|
|
22
24
|
function defineNode(name, options) {
|
|
23
25
|
validateSchemaKeys(options.schema, name);
|
|
24
26
|
if (options.annotations !== void 0) {
|
|
25
|
-
|
|
27
|
+
chunkHK5SATYM_cjs.assertJsonValue(options.annotations, "annotations", `Node "${name}"`);
|
|
26
28
|
}
|
|
27
29
|
return Object.freeze({
|
|
28
|
-
[
|
|
30
|
+
[chunkT6SPUYLX_cjs.NODE_TYPE_BRAND]: true,
|
|
29
31
|
kind: name,
|
|
30
32
|
schema: options.schema,
|
|
31
33
|
description: options.description,
|
|
@@ -34,21 +36,21 @@ function defineNode(name, options) {
|
|
|
34
36
|
}
|
|
35
37
|
var EMPTY_SCHEMA = zod.z.object({});
|
|
36
38
|
function validateSchemaKeys2(schema, name) {
|
|
37
|
-
|
|
39
|
+
chunkHK5SATYM_cjs.assertSchemaKeysAreFree(
|
|
38
40
|
"Edge",
|
|
39
41
|
name,
|
|
40
42
|
Object.keys(schema.shape),
|
|
41
|
-
|
|
43
|
+
chunkHK5SATYM_cjs.RESERVED_EDGE_KEYS
|
|
42
44
|
);
|
|
43
45
|
}
|
|
44
46
|
function defineEdge(name, options) {
|
|
45
47
|
const schema = options?.schema ?? EMPTY_SCHEMA;
|
|
46
48
|
validateSchemaKeys2(schema, name);
|
|
47
49
|
if (options?.annotations !== void 0) {
|
|
48
|
-
|
|
50
|
+
chunkHK5SATYM_cjs.assertJsonValue(options.annotations, "annotations", `Edge "${name}"`);
|
|
49
51
|
}
|
|
50
52
|
return Object.freeze({
|
|
51
|
-
[
|
|
53
|
+
[chunkT6SPUYLX_cjs.EDGE_TYPE_BRAND]: true,
|
|
52
54
|
kind: name,
|
|
53
55
|
schema,
|
|
54
56
|
description: options?.description,
|
|
@@ -85,7 +87,7 @@ function createMetaEdge(name, properties) {
|
|
|
85
87
|
}
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
|
-
var subClassOfMetaEdge = createMetaEdge(
|
|
90
|
+
var subClassOfMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_SUB_CLASS_OF, {
|
|
89
91
|
transitive: true,
|
|
90
92
|
inference: "subsumption",
|
|
91
93
|
description: "Type inheritance (Podcast subClassOf Media)"
|
|
@@ -97,9 +99,9 @@ function subClassOf(child, parent) {
|
|
|
97
99
|
to: parent
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
|
-
var broaderMetaEdge = createMetaEdge(
|
|
102
|
+
var broaderMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_BROADER, {
|
|
101
103
|
transitive: true,
|
|
102
|
-
inverse:
|
|
104
|
+
inverse: chunkHK5SATYM_cjs.META_EDGE_NARROWER,
|
|
103
105
|
inference: "hierarchy",
|
|
104
106
|
description: "Broader concept (ML broader AI)"
|
|
105
107
|
});
|
|
@@ -110,9 +112,9 @@ function broader(narrowerConcept, broaderConcept) {
|
|
|
110
112
|
to: broaderConcept
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
|
-
var narrowerMetaEdge = createMetaEdge(
|
|
115
|
+
var narrowerMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_NARROWER, {
|
|
114
116
|
transitive: true,
|
|
115
|
-
inverse:
|
|
117
|
+
inverse: chunkHK5SATYM_cjs.META_EDGE_BROADER,
|
|
116
118
|
inference: "hierarchy",
|
|
117
119
|
description: "Narrower concept (AI narrower ML)"
|
|
118
120
|
});
|
|
@@ -123,7 +125,7 @@ function narrower(broaderConcept, narrowerConcept) {
|
|
|
123
125
|
to: narrowerConcept
|
|
124
126
|
};
|
|
125
127
|
}
|
|
126
|
-
var relatedToMetaEdge = createMetaEdge(
|
|
128
|
+
var relatedToMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_RELATED_TO, {
|
|
127
129
|
symmetric: true,
|
|
128
130
|
inference: "association",
|
|
129
131
|
description: "Non-hierarchical association"
|
|
@@ -135,7 +137,7 @@ function relatedTo(conceptA, conceptB) {
|
|
|
135
137
|
to: conceptB
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
|
-
var equivalentToMetaEdge = createMetaEdge(
|
|
140
|
+
var equivalentToMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_EQUIVALENT_TO, {
|
|
139
141
|
symmetric: true,
|
|
140
142
|
transitive: true,
|
|
141
143
|
inference: "substitution",
|
|
@@ -148,7 +150,7 @@ function equivalentTo(kindA, kindBOrIri) {
|
|
|
148
150
|
to: kindBOrIri
|
|
149
151
|
};
|
|
150
152
|
}
|
|
151
|
-
var sameAsMetaEdge = createMetaEdge(
|
|
153
|
+
var sameAsMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_SAME_AS, {
|
|
152
154
|
symmetric: true,
|
|
153
155
|
transitive: true,
|
|
154
156
|
inference: "substitution",
|
|
@@ -161,7 +163,7 @@ function sameAs(kindA, kindBOrIri) {
|
|
|
161
163
|
to: kindBOrIri
|
|
162
164
|
};
|
|
163
165
|
}
|
|
164
|
-
var differentFromMetaEdge = createMetaEdge(
|
|
166
|
+
var differentFromMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_DIFFERENT_FROM, {
|
|
165
167
|
symmetric: true,
|
|
166
168
|
inference: "constraint",
|
|
167
169
|
description: "Explicitly different individuals"
|
|
@@ -173,7 +175,7 @@ function differentFrom(kindA, kindB) {
|
|
|
173
175
|
to: kindB
|
|
174
176
|
};
|
|
175
177
|
}
|
|
176
|
-
var disjointWithMetaEdge = createMetaEdge(
|
|
178
|
+
var disjointWithMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_DISJOINT_WITH, {
|
|
177
179
|
symmetric: true,
|
|
178
180
|
inference: "constraint",
|
|
179
181
|
description: "Mutually exclusive types"
|
|
@@ -185,9 +187,9 @@ function disjointWith(kindA, kindB) {
|
|
|
185
187
|
to: kindB
|
|
186
188
|
};
|
|
187
189
|
}
|
|
188
|
-
var partOfMetaEdge = createMetaEdge(
|
|
190
|
+
var partOfMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_PART_OF, {
|
|
189
191
|
transitive: true,
|
|
190
|
-
inverse:
|
|
192
|
+
inverse: chunkHK5SATYM_cjs.META_EDGE_HAS_PART,
|
|
191
193
|
inference: "composition",
|
|
192
194
|
description: "X is part of Y"
|
|
193
195
|
});
|
|
@@ -198,9 +200,9 @@ function partOf(part, whole) {
|
|
|
198
200
|
to: whole
|
|
199
201
|
};
|
|
200
202
|
}
|
|
201
|
-
var hasPartMetaEdge = createMetaEdge(
|
|
203
|
+
var hasPartMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_HAS_PART, {
|
|
202
204
|
transitive: true,
|
|
203
|
-
inverse:
|
|
205
|
+
inverse: chunkHK5SATYM_cjs.META_EDGE_PART_OF,
|
|
204
206
|
inference: "composition",
|
|
205
207
|
description: "Y has part X"
|
|
206
208
|
});
|
|
@@ -211,12 +213,12 @@ function hasPart(whole, part) {
|
|
|
211
213
|
to: part
|
|
212
214
|
};
|
|
213
215
|
}
|
|
214
|
-
var inverseOfMetaEdge = createMetaEdge(
|
|
216
|
+
var inverseOfMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_INVERSE_OF, {
|
|
215
217
|
symmetric: true,
|
|
216
218
|
inference: "none",
|
|
217
219
|
description: "Edge A is inverse of edge B"
|
|
218
220
|
});
|
|
219
|
-
var impliesMetaEdge = createMetaEdge(
|
|
221
|
+
var impliesMetaEdge = createMetaEdge(chunkHK5SATYM_cjs.META_EDGE_IMPLIES, {
|
|
220
222
|
transitive: true,
|
|
221
223
|
inference: "none",
|
|
222
224
|
description: "Edge A implies edge B exists"
|
|
@@ -346,25 +348,11 @@ function diffNodes(before, after) {
|
|
|
346
348
|
}
|
|
347
349
|
function diffNodeDef(name, before, after) {
|
|
348
350
|
const changes = [];
|
|
349
|
-
if (!
|
|
350
|
-
const
|
|
351
|
-
const afterProps = after.properties.properties ?? {};
|
|
352
|
-
const beforeRequired = new Set(before.properties.required);
|
|
353
|
-
const afterRequired = new Set(after.properties.required);
|
|
354
|
-
const addedProps = Object.keys(afterProps).filter(
|
|
355
|
-
(p) => !(p in beforeProps)
|
|
356
|
-
);
|
|
357
|
-
const removedProps = Object.keys(beforeProps).filter(
|
|
358
|
-
(p) => !(p in afterProps)
|
|
359
|
-
);
|
|
360
|
-
const newRequired = [...afterRequired].filter(
|
|
361
|
-
(p) => !beforeRequired.has(p)
|
|
362
|
-
);
|
|
363
|
-
const { severity, details } = computePropertyChangeSeverity(
|
|
351
|
+
if (!chunkACSVZPK7_cjs.canonicalEqual(before.properties, after.properties)) {
|
|
352
|
+
const { severity, details } = classifyPropertyChanges(
|
|
364
353
|
name,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
newRequired
|
|
354
|
+
before.properties,
|
|
355
|
+
after.properties
|
|
368
356
|
);
|
|
369
357
|
changes.push({
|
|
370
358
|
type: "modified",
|
|
@@ -385,7 +373,7 @@ function diffNodeDef(name, before, after) {
|
|
|
385
373
|
after
|
|
386
374
|
});
|
|
387
375
|
}
|
|
388
|
-
if (!
|
|
376
|
+
if (!chunkACSVZPK7_cjs.canonicalEqual(before.uniqueConstraints, after.uniqueConstraints)) {
|
|
389
377
|
changes.push({
|
|
390
378
|
type: "modified",
|
|
391
379
|
kind: name,
|
|
@@ -407,29 +395,103 @@ function diffNodeDef(name, before, after) {
|
|
|
407
395
|
}
|
|
408
396
|
return changes;
|
|
409
397
|
}
|
|
410
|
-
function
|
|
411
|
-
if (
|
|
398
|
+
function propertyTypeSignature(schema) {
|
|
399
|
+
if (schema.type !== void 0) return JSON.stringify(schema.type);
|
|
400
|
+
if (schema.const !== void 0) return "const";
|
|
401
|
+
if (schema.enum !== void 0) return "enum";
|
|
402
|
+
if (schema.anyOf !== void 0) return "anyOf";
|
|
403
|
+
if (schema.oneOf !== void 0) return "oneOf";
|
|
404
|
+
if (schema.allOf !== void 0) return "allOf";
|
|
405
|
+
return "unknown";
|
|
406
|
+
}
|
|
407
|
+
var NON_CONSTRAINING_KEYWORDS = /* @__PURE__ */ new Set([
|
|
408
|
+
"description",
|
|
409
|
+
"title",
|
|
410
|
+
"default",
|
|
411
|
+
"$schema"
|
|
412
|
+
]);
|
|
413
|
+
function stripSchemaMetadata(schema) {
|
|
414
|
+
const stripped = {};
|
|
415
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
416
|
+
if (!NON_CONSTRAINING_KEYWORDS.has(key)) stripped[key] = value;
|
|
417
|
+
}
|
|
418
|
+
return stripped;
|
|
419
|
+
}
|
|
420
|
+
function isObjectSchema(schema) {
|
|
421
|
+
return schema.type === "object" || schema.properties !== void 0;
|
|
422
|
+
}
|
|
423
|
+
function isBreakingPropertyChange(before, after) {
|
|
424
|
+
if (chunkACSVZPK7_cjs.canonicalEqual(stripSchemaMetadata(before), stripSchemaMetadata(after))) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
if (propertyTypeSignature(before) !== propertyTypeSignature(after)) {
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
if (isObjectSchema(before) && isObjectSchema(after)) {
|
|
431
|
+
return isBreakingObjectSchemaChange(before, after);
|
|
432
|
+
}
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
function isBreakingObjectSchemaChange(before, after) {
|
|
436
|
+
const beforeProps = before.properties ?? {};
|
|
437
|
+
const afterProps = after.properties ?? {};
|
|
438
|
+
const beforeRequired = new Set(before.required);
|
|
439
|
+
const afterRequired = new Set(after.required);
|
|
440
|
+
for (const key of Object.keys(beforeProps)) {
|
|
441
|
+
if (!(key in afterProps)) return true;
|
|
442
|
+
}
|
|
443
|
+
for (const key of afterRequired) {
|
|
444
|
+
if (!beforeRequired.has(key)) return true;
|
|
445
|
+
}
|
|
446
|
+
for (const [key, beforeChild] of Object.entries(beforeProps)) {
|
|
447
|
+
const afterChild = afterProps[key];
|
|
448
|
+
if (afterChild === void 0) continue;
|
|
449
|
+
if (isBreakingPropertyChange(beforeChild, afterChild)) return true;
|
|
450
|
+
}
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
function classifyPropertyChanges(kind, before, after) {
|
|
454
|
+
const beforeProps = before.properties ?? {};
|
|
455
|
+
const afterProps = after.properties ?? {};
|
|
456
|
+
const beforeRequired = new Set(before.required);
|
|
457
|
+
const afterRequired = new Set(after.required);
|
|
458
|
+
const removed = Object.keys(beforeProps).filter((p) => !(p in afterProps));
|
|
459
|
+
const added = Object.keys(afterProps).filter((p) => !(p in beforeProps));
|
|
460
|
+
const newRequired = [...afterRequired].filter((p) => !beforeRequired.has(p));
|
|
461
|
+
const breakingProps = [];
|
|
462
|
+
for (const [property, beforeProperty] of Object.entries(beforeProps)) {
|
|
463
|
+
const afterProperty = afterProps[property];
|
|
464
|
+
if (afterProperty === void 0) continue;
|
|
465
|
+
if (chunkACSVZPK7_cjs.canonicalEqual(beforeProperty, afterProperty)) continue;
|
|
466
|
+
if (isBreakingPropertyChange(beforeProperty, afterProperty)) {
|
|
467
|
+
breakingProps.push(property);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
if (removed.length > 0) {
|
|
471
|
+
return {
|
|
472
|
+
severity: "breaking",
|
|
473
|
+
details: `Properties removed from "${kind}": ${removed.join(", ")}`
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
if (breakingProps.length > 0) {
|
|
412
477
|
return {
|
|
413
478
|
severity: "breaking",
|
|
414
|
-
details: `
|
|
479
|
+
details: `Property schemas changed incompatibly in "${kind}": ${breakingProps.join(", ")}`
|
|
415
480
|
};
|
|
416
481
|
}
|
|
417
482
|
if (newRequired.length > 0) {
|
|
418
483
|
return {
|
|
419
484
|
severity: "breaking",
|
|
420
|
-
details: `New required properties in "${
|
|
485
|
+
details: `New required properties in "${kind}": ${newRequired.join(", ")}`
|
|
421
486
|
};
|
|
422
487
|
}
|
|
423
|
-
if (
|
|
488
|
+
if (added.length > 0) {
|
|
424
489
|
return {
|
|
425
490
|
severity: "safe",
|
|
426
|
-
details: `Properties added to "${
|
|
491
|
+
details: `Properties added to "${kind}": ${added.join(", ")}`
|
|
427
492
|
};
|
|
428
493
|
}
|
|
429
|
-
return {
|
|
430
|
-
severity: "safe",
|
|
431
|
-
details: `Properties changed in "${name}"`
|
|
432
|
-
};
|
|
494
|
+
return { severity: "safe", details: `Properties changed in "${kind}"` };
|
|
433
495
|
}
|
|
434
496
|
function diffEdges(before, after) {
|
|
435
497
|
const changes = [];
|
|
@@ -469,7 +531,7 @@ function diffEdges(before, after) {
|
|
|
469
531
|
}
|
|
470
532
|
function diffEdgeDef(name, before, after) {
|
|
471
533
|
const changes = [];
|
|
472
|
-
if (!
|
|
534
|
+
if (!chunkACSVZPK7_cjs.canonicalEqual(before.fromKinds, after.fromKinds)) {
|
|
473
535
|
changes.push({
|
|
474
536
|
type: "modified",
|
|
475
537
|
kind: name,
|
|
@@ -479,7 +541,7 @@ function diffEdgeDef(name, before, after) {
|
|
|
479
541
|
after
|
|
480
542
|
});
|
|
481
543
|
}
|
|
482
|
-
if (!
|
|
544
|
+
if (!chunkACSVZPK7_cjs.canonicalEqual(before.toKinds, after.toKinds)) {
|
|
483
545
|
changes.push({
|
|
484
546
|
type: "modified",
|
|
485
547
|
kind: name,
|
|
@@ -499,12 +561,17 @@ function diffEdgeDef(name, before, after) {
|
|
|
499
561
|
after
|
|
500
562
|
});
|
|
501
563
|
}
|
|
502
|
-
if (!
|
|
564
|
+
if (!chunkACSVZPK7_cjs.canonicalEqual(before.properties, after.properties)) {
|
|
565
|
+
const { severity, details } = classifyPropertyChanges(
|
|
566
|
+
name,
|
|
567
|
+
before.properties,
|
|
568
|
+
after.properties
|
|
569
|
+
);
|
|
503
570
|
changes.push({
|
|
504
571
|
type: "modified",
|
|
505
572
|
kind: name,
|
|
506
|
-
severity
|
|
507
|
-
details
|
|
573
|
+
severity,
|
|
574
|
+
details,
|
|
508
575
|
before,
|
|
509
576
|
after
|
|
510
577
|
});
|
|
@@ -524,7 +591,7 @@ function diffEdgeDef(name, before, after) {
|
|
|
524
591
|
function annotationsChanged(before, after) {
|
|
525
592
|
if (before === void 0 && after === void 0) return false;
|
|
526
593
|
if (before === void 0 || after === void 0) return true;
|
|
527
|
-
return !
|
|
594
|
+
return !chunkACSVZPK7_cjs.canonicalEqual(before, after);
|
|
528
595
|
}
|
|
529
596
|
function diffOntology(before, after) {
|
|
530
597
|
const changes = [];
|
|
@@ -623,7 +690,7 @@ function diffIndexes(before, after) {
|
|
|
623
690
|
for (const [name, beforeIndex] of beforeByName) {
|
|
624
691
|
const afterIndex = afterByName.get(name);
|
|
625
692
|
if (!afterIndex) continue;
|
|
626
|
-
if (!
|
|
693
|
+
if (!chunkACSVZPK7_cjs.canonicalEqual(beforeIndex, afterIndex)) {
|
|
627
694
|
changes.push({
|
|
628
695
|
type: "modified",
|
|
629
696
|
name,
|
|
@@ -653,7 +720,7 @@ function diffExtension(before, after) {
|
|
|
653
720
|
details: "Graph extension document was removed"
|
|
654
721
|
};
|
|
655
722
|
}
|
|
656
|
-
if (
|
|
723
|
+
if (chunkACSVZPK7_cjs.canonicalEqual(before, after)) return void 0;
|
|
657
724
|
return {
|
|
658
725
|
type: "modified",
|
|
659
726
|
severity: "safe",
|
|
@@ -805,7 +872,7 @@ var KindRegistry = class {
|
|
|
805
872
|
* Checks if child is a subclass of parent (directly or transitively).
|
|
806
873
|
*/
|
|
807
874
|
isSubClassOf(child, parent) {
|
|
808
|
-
return
|
|
875
|
+
return chunkHK5SATYM_cjs.isReachable(this.subClassAncestors, child, parent);
|
|
809
876
|
}
|
|
810
877
|
/**
|
|
811
878
|
* Expands a kind to include all its subclasses.
|
|
@@ -832,13 +899,13 @@ var KindRegistry = class {
|
|
|
832
899
|
* Checks if narrowerConcept is narrower than broaderConcept.
|
|
833
900
|
*/
|
|
834
901
|
isNarrowerThan(narrowerConcept, broaderConcept) {
|
|
835
|
-
return
|
|
902
|
+
return chunkHK5SATYM_cjs.isReachable(this.broaderClosure, narrowerConcept, broaderConcept);
|
|
836
903
|
}
|
|
837
904
|
/**
|
|
838
905
|
* Checks if broaderConcept is broader than narrowerConcept.
|
|
839
906
|
*/
|
|
840
907
|
isBroaderThan(broaderConcept, narrowerConcept) {
|
|
841
|
-
return
|
|
908
|
+
return chunkHK5SATYM_cjs.isReachable(this.narrowerClosure, broaderConcept, narrowerConcept);
|
|
842
909
|
}
|
|
843
910
|
/**
|
|
844
911
|
* Expands to include all narrower concepts.
|
|
@@ -902,7 +969,7 @@ var KindRegistry = class {
|
|
|
902
969
|
* Checks if part is part of whole (directly or transitively).
|
|
903
970
|
*/
|
|
904
971
|
isPartOf(part, whole) {
|
|
905
|
-
return
|
|
972
|
+
return chunkHK5SATYM_cjs.isReachable(this.partOfClosure, part, whole);
|
|
906
973
|
}
|
|
907
974
|
/**
|
|
908
975
|
* Gets all wholes that contain this part.
|
|
@@ -1013,57 +1080,57 @@ function computeClosuresFromOntology(ontology) {
|
|
|
1013
1080
|
const fromName = getKindName(relation.from);
|
|
1014
1081
|
const toName = getKindName(relation.to);
|
|
1015
1082
|
switch (relation.metaEdge.name) {
|
|
1016
|
-
case
|
|
1083
|
+
case chunkHK5SATYM_cjs.META_EDGE_SUB_CLASS_OF: {
|
|
1017
1084
|
subClassRelations.push([fromName, toName]);
|
|
1018
1085
|
break;
|
|
1019
1086
|
}
|
|
1020
|
-
case
|
|
1087
|
+
case chunkHK5SATYM_cjs.META_EDGE_BROADER: {
|
|
1021
1088
|
broaderRelations.push([fromName, toName]);
|
|
1022
1089
|
break;
|
|
1023
1090
|
}
|
|
1024
|
-
case
|
|
1091
|
+
case chunkHK5SATYM_cjs.META_EDGE_NARROWER: {
|
|
1025
1092
|
broaderRelations.push([toName, fromName]);
|
|
1026
1093
|
break;
|
|
1027
1094
|
}
|
|
1028
|
-
case
|
|
1029
|
-
case
|
|
1095
|
+
case chunkHK5SATYM_cjs.META_EDGE_EQUIVALENT_TO:
|
|
1096
|
+
case chunkHK5SATYM_cjs.META_EDGE_SAME_AS: {
|
|
1030
1097
|
equivalentRelations.push([fromName, toName]);
|
|
1031
1098
|
break;
|
|
1032
1099
|
}
|
|
1033
|
-
case
|
|
1100
|
+
case chunkHK5SATYM_cjs.META_EDGE_DISJOINT_WITH: {
|
|
1034
1101
|
disjointRelations.push([fromName, toName]);
|
|
1035
1102
|
break;
|
|
1036
1103
|
}
|
|
1037
|
-
case
|
|
1104
|
+
case chunkHK5SATYM_cjs.META_EDGE_PART_OF: {
|
|
1038
1105
|
partOfRelations.push([fromName, toName]);
|
|
1039
1106
|
break;
|
|
1040
1107
|
}
|
|
1041
|
-
case
|
|
1108
|
+
case chunkHK5SATYM_cjs.META_EDGE_HAS_PART: {
|
|
1042
1109
|
partOfRelations.push([toName, fromName]);
|
|
1043
1110
|
break;
|
|
1044
1111
|
}
|
|
1045
|
-
case
|
|
1112
|
+
case chunkHK5SATYM_cjs.META_EDGE_INVERSE_OF: {
|
|
1046
1113
|
inverseOfRelations.push([fromName, toName]);
|
|
1047
1114
|
break;
|
|
1048
1115
|
}
|
|
1049
|
-
case
|
|
1116
|
+
case chunkHK5SATYM_cjs.META_EDGE_IMPLIES: {
|
|
1050
1117
|
impliesRelations.push([fromName, toName]);
|
|
1051
1118
|
break;
|
|
1052
1119
|
}
|
|
1053
1120
|
}
|
|
1054
1121
|
}
|
|
1055
|
-
const subClassAncestors =
|
|
1056
|
-
const subClassDescendants =
|
|
1057
|
-
const broaderClosure =
|
|
1058
|
-
const narrowerClosure =
|
|
1122
|
+
const subClassAncestors = chunkHK5SATYM_cjs.computeTransitiveClosure(subClassRelations);
|
|
1123
|
+
const subClassDescendants = chunkHK5SATYM_cjs.invertClosure(subClassAncestors);
|
|
1124
|
+
const broaderClosure = chunkHK5SATYM_cjs.computeTransitiveClosure(broaderRelations);
|
|
1125
|
+
const narrowerClosure = chunkHK5SATYM_cjs.invertClosure(broaderClosure);
|
|
1059
1126
|
const equivalenceSets = computeEquivalenceSets(equivalentRelations);
|
|
1060
1127
|
const iriToKind = computeIriMapping(equivalentRelations);
|
|
1061
1128
|
const disjointPairs = computeDisjointPairs(disjointRelations);
|
|
1062
|
-
const partOfClosure =
|
|
1063
|
-
const hasPartClosure =
|
|
1129
|
+
const partOfClosure = chunkHK5SATYM_cjs.computeTransitiveClosure(partOfRelations);
|
|
1130
|
+
const hasPartClosure = chunkHK5SATYM_cjs.invertClosure(partOfClosure);
|
|
1064
1131
|
const edgeInverses = computeEdgeInverses(inverseOfRelations);
|
|
1065
|
-
const edgeImplicationsClosure =
|
|
1066
|
-
const edgeImplyingClosure =
|
|
1132
|
+
const edgeImplicationsClosure = chunkHK5SATYM_cjs.computeTransitiveClosure(impliesRelations);
|
|
1133
|
+
const edgeImplyingClosure = chunkHK5SATYM_cjs.invertClosure(edgeImplicationsClosure);
|
|
1067
1134
|
return {
|
|
1068
1135
|
subClassAncestors,
|
|
1069
1136
|
subClassDescendants,
|
|
@@ -1167,7 +1234,7 @@ function serializeSchema(graph, version) {
|
|
|
1167
1234
|
return {
|
|
1168
1235
|
graphId: graph.id,
|
|
1169
1236
|
version,
|
|
1170
|
-
generatedAt:
|
|
1237
|
+
generatedAt: chunkYC6PWTHY_cjs.nowIso(),
|
|
1171
1238
|
nodes,
|
|
1172
1239
|
edges,
|
|
1173
1240
|
ontology,
|
|
@@ -1198,7 +1265,7 @@ function serializeDeprecatedKinds(set) {
|
|
|
1198
1265
|
function canonicalExtension(document) {
|
|
1199
1266
|
if (document === void 0) return void 0;
|
|
1200
1267
|
if (document.version === void 0) return document;
|
|
1201
|
-
if (document.version !==
|
|
1268
|
+
if (document.version !== chunkHK5SATYM_cjs.LEGACY_GRAPH_EXTENSION_VERSION) return document;
|
|
1202
1269
|
const { version: _omit, ...rest } = document;
|
|
1203
1270
|
return rest;
|
|
1204
1271
|
}
|
|
@@ -1272,7 +1339,7 @@ function serializeEdgeIndexDeclaration(declaration) {
|
|
|
1272
1339
|
}
|
|
1273
1340
|
function serializeNodes(graph) {
|
|
1274
1341
|
const result = {};
|
|
1275
|
-
for (const kindName of
|
|
1342
|
+
for (const kindName of chunkT6SPUYLX_cjs.getNodeKinds(graph)) {
|
|
1276
1343
|
const registration = graph.nodes[kindName];
|
|
1277
1344
|
if (registration === void 0) continue;
|
|
1278
1345
|
result[kindName] = serializeNodeDef(registration);
|
|
@@ -1340,7 +1407,7 @@ function deserializeWherePredicate(serialized) {
|
|
|
1340
1407
|
}
|
|
1341
1408
|
function serializeEdges(graph) {
|
|
1342
1409
|
const result = {};
|
|
1343
|
-
for (const kindName of
|
|
1410
|
+
for (const kindName of chunkT6SPUYLX_cjs.getEdgeKinds(graph)) {
|
|
1344
1411
|
const registration = graph.edges[kindName];
|
|
1345
1412
|
if (registration === void 0) continue;
|
|
1346
1413
|
result[kindName] = serializeEdgeDef(registration);
|
|
@@ -1488,8 +1555,8 @@ async function computeSchemaHash(schema) {
|
|
|
1488
1555
|
...schema.extension === void 0 ? {} : { extension: schema.extension },
|
|
1489
1556
|
...schema.deprecatedKinds === void 0 ? {} : { deprecatedKinds: schema.deprecatedKinds }
|
|
1490
1557
|
};
|
|
1491
|
-
const json = JSON.stringify(hashable,
|
|
1492
|
-
return
|
|
1558
|
+
const json = JSON.stringify(hashable, chunkACSVZPK7_cjs.sortedReplacer);
|
|
1559
|
+
return chunkZY4GXIVN_cjs.sha256Hex(json);
|
|
1493
1560
|
}
|
|
1494
1561
|
var COMPILE_NODE_CACHE = /* @__PURE__ */ new Map();
|
|
1495
1562
|
var COMPILE_EDGE_SCHEMA_CACHE = /* @__PURE__ */ new WeakMap();
|
|
@@ -1537,7 +1604,7 @@ function compileNode(kindName, document) {
|
|
|
1537
1604
|
const schema = buildObjectSchema(document.properties);
|
|
1538
1605
|
const type = defineNode(
|
|
1539
1606
|
kindName,
|
|
1540
|
-
|
|
1607
|
+
chunkDI74SMXS_cjs.compactUndefined({
|
|
1541
1608
|
schema,
|
|
1542
1609
|
description: document.description,
|
|
1543
1610
|
annotations: document.annotations
|
|
@@ -1561,7 +1628,7 @@ function compileEdge(kindName, document, nodeTypeByName) {
|
|
|
1561
1628
|
(name) => nodeTypeByName.get(name) ?? name
|
|
1562
1629
|
);
|
|
1563
1630
|
return Object.freeze(
|
|
1564
|
-
|
|
1631
|
+
chunkDI74SMXS_cjs.compactUndefined({
|
|
1565
1632
|
kindName,
|
|
1566
1633
|
schema,
|
|
1567
1634
|
description: document.description,
|
|
@@ -1605,7 +1672,7 @@ function compileProperty(property) {
|
|
|
1605
1672
|
}
|
|
1606
1673
|
function compileStringProperty(property) {
|
|
1607
1674
|
if (property.searchable !== void 0) {
|
|
1608
|
-
return applyStringRefinements(
|
|
1675
|
+
return applyStringRefinements(chunkJQGIPGVL_cjs.searchable(property.searchable), property);
|
|
1609
1676
|
}
|
|
1610
1677
|
if (property.format === void 0) {
|
|
1611
1678
|
return applyStringRefinements(zod.z.string(), property);
|
|
@@ -1655,7 +1722,7 @@ function compileEnumProperty(property) {
|
|
|
1655
1722
|
}
|
|
1656
1723
|
function compileArrayProperty(property) {
|
|
1657
1724
|
if (property.embedding !== void 0) {
|
|
1658
|
-
return
|
|
1725
|
+
return chunkJQGIPGVL_cjs.embedding(property.embedding.dimensions);
|
|
1659
1726
|
}
|
|
1660
1727
|
const inner = compilePropertyForArrayItem(property.items);
|
|
1661
1728
|
return zod.z.array(inner);
|
|
@@ -1695,7 +1762,7 @@ function makeWherePredicate(field, op) {
|
|
|
1695
1762
|
};
|
|
1696
1763
|
}
|
|
1697
1764
|
var META_EDGE_BY_NAME = Object.fromEntries(
|
|
1698
|
-
|
|
1765
|
+
chunkHK5SATYM_cjs.ALL_META_EDGE_NAMES.map((name) => [name, core[`${name}MetaEdge`]])
|
|
1699
1766
|
);
|
|
1700
1767
|
function compileOntologyRelation(relation, nodeTypeByName) {
|
|
1701
1768
|
const metaEdge = META_EDGE_BY_NAME[relation.metaEdge];
|
|
@@ -1731,10 +1798,10 @@ function extensionKindNames(document) {
|
|
|
1731
1798
|
function mergeGraphExtension(graph, document) {
|
|
1732
1799
|
const existingDocument = graph.extension ?? Object.freeze({});
|
|
1733
1800
|
const unionDocument = unionDocuments(existingDocument, document);
|
|
1734
|
-
if (graph.extension !== void 0 &&
|
|
1801
|
+
if (graph.extension !== void 0 && chunkACSVZPK7_cjs.canonicalEqual(unionDocument, existingDocument)) {
|
|
1735
1802
|
return graph;
|
|
1736
1803
|
}
|
|
1737
|
-
const validatedUnion =
|
|
1804
|
+
const validatedUnion = chunkHK5SATYM_cjs.unwrap(chunkHK5SATYM_cjs.validateGraphExtension(unionDocument));
|
|
1738
1805
|
const compiled = compileGraphExtension(validatedUnion);
|
|
1739
1806
|
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(existingDocument);
|
|
1740
1807
|
const nodeKinds = /* @__PURE__ */ new Map();
|
|
@@ -1786,7 +1853,7 @@ function mergeGraphExtension(graph, document) {
|
|
|
1786
1853
|
});
|
|
1787
1854
|
const type = defineEdge(
|
|
1788
1855
|
edge.kindName,
|
|
1789
|
-
|
|
1856
|
+
chunkDI74SMXS_cjs.compactUndefined({
|
|
1790
1857
|
schema: edge.schema,
|
|
1791
1858
|
description: edge.description,
|
|
1792
1859
|
annotations: edge.annotations,
|
|
@@ -1836,7 +1903,7 @@ function deriveGraphExtensionVectorIndexes(compiledNodes) {
|
|
|
1836
1903
|
...compiled.unique.length === 0 ? {} : { unique: [...compiled.unique] }
|
|
1837
1904
|
};
|
|
1838
1905
|
}
|
|
1839
|
-
return
|
|
1906
|
+
return chunkT6SPUYLX_cjs.autoDeriveVectorIndexes(registrations).map(
|
|
1840
1907
|
(index) => Object.freeze({ ...index, origin: "runtime" })
|
|
1841
1908
|
);
|
|
1842
1909
|
}
|
|
@@ -1854,7 +1921,7 @@ function mergeIndexesWithGraphExtension(existing, runtimeIndexes, graphId) {
|
|
|
1854
1921
|
const runtimeRelational = runtimeIndexes.filter(
|
|
1855
1922
|
(index) => index.entity !== "vector"
|
|
1856
1923
|
);
|
|
1857
|
-
const vectorMerged =
|
|
1924
|
+
const vectorMerged = chunkT6SPUYLX_cjs.mergeVectorIndexes(compileTimeIndexes, runtimeVectors);
|
|
1858
1925
|
const merged = [...vectorMerged, ...runtimeRelational];
|
|
1859
1926
|
assertUniqueIndexNames(merged, graphId);
|
|
1860
1927
|
return merged;
|
|
@@ -1887,7 +1954,7 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
1887
1954
|
suggestion: "Declare the kind under `nodes` in this graph extension, or remove the index from `indexes`."
|
|
1888
1955
|
});
|
|
1889
1956
|
}
|
|
1890
|
-
const declaration2 =
|
|
1957
|
+
const declaration2 = chunkRRKQAKD6_cjs.defineNodeIndex(
|
|
1891
1958
|
node,
|
|
1892
1959
|
toNodeIndexConfig(document)
|
|
1893
1960
|
);
|
|
@@ -1901,7 +1968,7 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
1901
1968
|
suggestion: "Declare the edge under `edges` in this graph extension, or remove the index from `indexes`."
|
|
1902
1969
|
});
|
|
1903
1970
|
}
|
|
1904
|
-
const declaration =
|
|
1971
|
+
const declaration = chunkRRKQAKD6_cjs.defineEdgeIndex(
|
|
1905
1972
|
edgeRegistration.type,
|
|
1906
1973
|
toEdgeIndexConfig(document)
|
|
1907
1974
|
);
|
|
@@ -1922,7 +1989,7 @@ function buildWhereCallback(where) {
|
|
|
1922
1989
|
};
|
|
1923
1990
|
}
|
|
1924
1991
|
function toNodeIndexConfig(document) {
|
|
1925
|
-
return
|
|
1992
|
+
return chunkDI74SMXS_cjs.compactUndefined({
|
|
1926
1993
|
fields: document.fields,
|
|
1927
1994
|
coveringFields: document.coveringFields,
|
|
1928
1995
|
unique: document.unique,
|
|
@@ -1932,7 +1999,7 @@ function toNodeIndexConfig(document) {
|
|
|
1932
1999
|
});
|
|
1933
2000
|
}
|
|
1934
2001
|
function toEdgeIndexConfig(document) {
|
|
1935
|
-
return
|
|
2002
|
+
return chunkDI74SMXS_cjs.compactUndefined({
|
|
1936
2003
|
fields: document.fields,
|
|
1937
2004
|
coveringFields: document.coveringFields,
|
|
1938
2005
|
unique: document.unique,
|
|
@@ -1988,14 +2055,14 @@ function isEmptyExtension(extension) {
|
|
|
1988
2055
|
}
|
|
1989
2056
|
function assertNoCollision(kindName, entity, collides, graphId) {
|
|
1990
2057
|
if (!collides) return;
|
|
1991
|
-
throw new
|
|
2058
|
+
throw new chunkHK5SATYM_cjs.KindCollisionError(kindName, entity, graphId);
|
|
1992
2059
|
}
|
|
1993
2060
|
function resolveEndpoints(entries, nodeKinds, context) {
|
|
1994
2061
|
return entries.map((entry) => {
|
|
1995
2062
|
if (typeof entry !== "string") return entry;
|
|
1996
2063
|
const resolved = nodeKinds.get(entry);
|
|
1997
2064
|
if (resolved === void 0) {
|
|
1998
|
-
throw new
|
|
2065
|
+
throw new chunkHK5SATYM_cjs.GraphExtensionUnresolvedEndpointError(
|
|
1999
2066
|
context.edgeKind,
|
|
2000
2067
|
context.side,
|
|
2001
2068
|
entry,
|
|
@@ -2353,7 +2420,7 @@ function parseSerializedSchema(json) {
|
|
|
2353
2420
|
{ operation: "select", entity: "schema" }
|
|
2354
2421
|
);
|
|
2355
2422
|
}
|
|
2356
|
-
const validated =
|
|
2423
|
+
const validated = chunkDI74SMXS_cjs.freezeDeep(result.data);
|
|
2357
2424
|
if (PARSE_CACHE.size >= PARSE_CACHE_LIMIT) {
|
|
2358
2425
|
const oldest = PARSE_CACHE.keys().next().value;
|
|
2359
2426
|
if (oldest !== void 0) PARSE_CACHE.delete(oldest);
|
|
@@ -2365,7 +2432,7 @@ async function loadActiveSchemaWithBootstrap(backend, graphId) {
|
|
|
2365
2432
|
try {
|
|
2366
2433
|
return await backend.getActiveSchema(graphId);
|
|
2367
2434
|
} catch (error) {
|
|
2368
|
-
if (backend.bootstrapTables &&
|
|
2435
|
+
if (backend.bootstrapTables && chunkRHZWOJVA_cjs.isMissingTableError(error)) {
|
|
2369
2436
|
await backend.bootstrapTables();
|
|
2370
2437
|
return await backend.getActiveSchema(graphId);
|
|
2371
2438
|
}
|
|
@@ -2513,7 +2580,7 @@ async function readActiveSchemaPure(backend, graphId) {
|
|
|
2513
2580
|
try {
|
|
2514
2581
|
activeRow = await backend.getActiveSchema(graphId);
|
|
2515
2582
|
} catch (error) {
|
|
2516
|
-
if (
|
|
2583
|
+
if (chunkRHZWOJVA_cjs.isMissingTableError(error)) {
|
|
2517
2584
|
throw schemaNotInitializedError(graphId, error);
|
|
2518
2585
|
}
|
|
2519
2586
|
throw error;
|
|
@@ -2718,5 +2785,5 @@ exports.validateEdgeProps = validateEdgeProps;
|
|
|
2718
2785
|
exports.validateNodeProps = validateNodeProps;
|
|
2719
2786
|
exports.validateProps = validateProps;
|
|
2720
2787
|
exports.wrapZodError = wrapZodError;
|
|
2721
|
-
//# sourceMappingURL=chunk-
|
|
2722
|
-
//# sourceMappingURL=chunk-
|
|
2788
|
+
//# sourceMappingURL=chunk-6HVOHZHS.cjs.map
|
|
2789
|
+
//# sourceMappingURL=chunk-6HVOHZHS.cjs.map
|