@nicia-ai/typegraph 0.44.0 → 0.46.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.cjs +11 -11
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +7 -7
- package/dist/backend/index.cjs +53 -54
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +13 -14
- package/dist/backend/postgres/index.cjs +29 -30
- package/dist/backend/postgres/index.d.cts +7 -7
- package/dist/backend/postgres/index.d.ts +7 -7
- package/dist/backend/postgres/index.js +16 -17
- package/dist/backend/postgres/pglite-store.cjs +48 -43
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +15 -9
- package/dist/backend/postgres/pglite-store.d.ts +15 -9
- package/dist/backend/postgres/pglite-store.js +44 -39
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +18 -19
- package/dist/backend/postgres/pglite.d.cts +4 -4
- package/dist/backend/postgres/pglite.d.ts +4 -4
- package/dist/backend/postgres/pglite.js +17 -18
- package/dist/backend/sqlite/index.cjs +26 -27
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +14 -15
- package/dist/backend/sqlite/libsql.cjs +21 -22
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +15 -8
- package/dist/backend/sqlite/libsql.d.ts +15 -8
- package/dist/backend/sqlite/libsql.js +17 -18
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +49 -44
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +15 -10
- package/dist/backend/sqlite/local-store.d.ts +15 -10
- package/dist/backend/sqlite/local-store.js +45 -40
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +19 -20
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +17 -18
- package/dist/{chunk-XMYJY7NI.js → chunk-2LG2XB2M.js} +3 -3
- package/dist/{chunk-XMYJY7NI.js.map → chunk-2LG2XB2M.js.map} +1 -1
- package/dist/{chunk-QGKILWGZ.cjs → chunk-2NA5DYLO.cjs} +4 -4
- package/dist/{chunk-QGKILWGZ.cjs.map → chunk-2NA5DYLO.cjs.map} +1 -1
- package/dist/{chunk-5MUSU4ZP.cjs → chunk-3DHZCOT7.cjs} +20 -20
- package/dist/chunk-3DHZCOT7.cjs.map +1 -0
- package/dist/{chunk-OVUUTCPJ.cjs → chunk-4UGOKMI5.cjs} +268 -150
- package/dist/chunk-4UGOKMI5.cjs.map +1 -0
- package/dist/{chunk-FRHHDHKH.js → chunk-5262ZMTR.js} +26 -5
- package/dist/chunk-5262ZMTR.js.map +1 -0
- package/dist/{chunk-HOIFFY4M.js → chunk-5763DULU.js} +248 -76
- package/dist/chunk-5763DULU.js.map +1 -0
- package/dist/{chunk-7G32LIQM.js → chunk-5UVRGXD3.js} +277 -7
- package/dist/chunk-5UVRGXD3.js.map +1 -0
- package/dist/{chunk-IIT5K7SK.cjs → chunk-62ZP23AW.cjs} +15 -15
- package/dist/{chunk-IIT5K7SK.cjs.map → chunk-62ZP23AW.cjs.map} +1 -1
- package/dist/{chunk-S4KQ5LV4.js → chunk-775A4ZMN.js} +40 -6
- package/dist/chunk-775A4ZMN.js.map +1 -0
- package/dist/{chunk-QYWINYEA.cjs → chunk-7BQXPCGN.cjs} +830 -170
- package/dist/chunk-7BQXPCGN.cjs.map +1 -0
- package/dist/{chunk-FJMPR3OH.cjs → chunk-7EO3TCQB.cjs} +33 -7
- package/dist/chunk-7EO3TCQB.cjs.map +1 -0
- package/dist/chunk-7GT72YHH.cjs +1979 -0
- package/dist/chunk-7GT72YHH.cjs.map +1 -0
- package/dist/{chunk-SQRD2CYF.js → chunk-7VQXLT5O.js} +717 -76
- package/dist/chunk-7VQXLT5O.js.map +1 -0
- package/dist/{chunk-BCP7LLOY.js → chunk-7Z5OR7KO.js} +2706 -625
- package/dist/chunk-7Z5OR7KO.js.map +1 -0
- package/dist/chunk-A4OC4DVN.cjs +12 -0
- package/dist/{chunk-4SZ6XPTG.cjs.map → chunk-A4OC4DVN.cjs.map} +1 -1
- package/dist/{chunk-TDXIBCGY.cjs → chunk-A7J2YDDI.cjs} +5 -3
- package/dist/chunk-A7J2YDDI.cjs.map +1 -0
- package/dist/{chunk-FMMIX6N4.js → chunk-AKLS3BYZ.js} +56 -5
- package/dist/chunk-AKLS3BYZ.js.map +1 -0
- package/dist/{chunk-D7PG5D5K.js → chunk-AMKPPFUO.js} +32 -6
- package/dist/chunk-AMKPPFUO.js.map +1 -0
- package/dist/{chunk-PAW2XUZN.js → chunk-ASTI57H3.js} +3 -3
- package/dist/{chunk-PAW2XUZN.js.map → chunk-ASTI57H3.js.map} +1 -1
- package/dist/{chunk-FMGEZBAQ.js → chunk-BKCUOV7A.js} +27 -5
- package/dist/chunk-BKCUOV7A.js.map +1 -0
- package/dist/chunk-BSFJMMV3.cjs +268 -0
- package/dist/chunk-BSFJMMV3.cjs.map +1 -0
- package/dist/{chunk-63KCKSSH.js → chunk-C23WSN5E.js} +209 -24
- package/dist/chunk-C23WSN5E.js.map +1 -0
- package/dist/{chunk-JRP3VGHS.js → chunk-CBTIUB76.js} +3 -3
- package/dist/{chunk-JRP3VGHS.js.map → chunk-CBTIUB76.js.map} +1 -1
- package/dist/chunk-CNV4TXJG.js +58 -0
- package/dist/chunk-CNV4TXJG.js.map +1 -0
- package/dist/{chunk-QB6VMOJ2.cjs → chunk-CXBHOOIQ.cjs} +45 -10
- package/dist/chunk-CXBHOOIQ.cjs.map +1 -0
- package/dist/{chunk-46GDII45.js → chunk-DCQVHAYQ.js} +5 -5
- package/dist/{chunk-46GDII45.js.map → chunk-DCQVHAYQ.js.map} +1 -1
- package/dist/chunk-DLNROMQ7.js +306 -0
- package/dist/chunk-DLNROMQ7.js.map +1 -0
- package/dist/chunk-DYATYRY4.js +47 -0
- package/dist/chunk-DYATYRY4.js.map +1 -0
- package/dist/chunk-E4WNQBEF.cjs +217 -0
- package/dist/chunk-E4WNQBEF.cjs.map +1 -0
- package/dist/{chunk-G6Q5UM7U.js → chunk-FWJKWH6U.js} +5 -3
- package/dist/chunk-FWJKWH6U.js.map +1 -0
- package/dist/{chunk-BNUFUFAU.js → chunk-HFHTMECK.js} +7 -7
- package/dist/chunk-HFHTMECK.js.map +1 -0
- package/dist/{chunk-TFMVL4QH.js → chunk-I5MOXA4H.js} +20 -14
- package/dist/chunk-I5MOXA4H.js.map +1 -0
- package/dist/{chunk-4MB3AQAQ.js → chunk-J3WZ3FA2.js} +77 -3
- package/dist/chunk-J3WZ3FA2.js.map +1 -0
- package/dist/{chunk-UR7W5YQK.js → chunk-JBQQ7THH.js} +5 -3
- package/dist/chunk-JBQQ7THH.js.map +1 -0
- package/dist/chunk-JIVMTW7W.js +3393 -0
- package/dist/chunk-JIVMTW7W.js.map +1 -0
- package/dist/{chunk-2Y4IFKW7.js → chunk-JXA2ZP2Q.js} +6 -17
- package/dist/chunk-JXA2ZP2Q.js.map +1 -0
- package/dist/{chunk-GYA4JRP5.js → chunk-JXXDZTMN.js} +2 -2
- package/dist/chunk-JXXDZTMN.js.map +1 -0
- package/dist/chunk-JZUR7ZWE.js +254 -0
- package/dist/chunk-JZUR7ZWE.js.map +1 -0
- package/dist/chunk-K5ELX2GT.js +248 -0
- package/dist/chunk-K5ELX2GT.js.map +1 -0
- package/dist/chunk-LBJKZXDE.cjs +257 -0
- package/dist/chunk-LBJKZXDE.cjs.map +1 -0
- package/dist/{chunk-FGO5JFVJ.cjs → chunk-M4BDU5RX.cjs} +12 -12
- package/dist/{chunk-FGO5JFVJ.cjs.map → chunk-M4BDU5RX.cjs.map} +1 -1
- package/dist/{chunk-MIJKEVV7.js → chunk-MSY7FSX4.js} +37 -4
- package/dist/chunk-MSY7FSX4.js.map +1 -0
- package/dist/{chunk-ST3LPB2V.cjs → chunk-MUK4BU7K.cjs} +788 -146
- package/dist/chunk-MUK4BU7K.cjs.map +1 -0
- package/dist/{chunk-MCHP7RHZ.cjs → chunk-MXJDTH5B.cjs} +64 -41
- package/dist/chunk-MXJDTH5B.cjs.map +1 -0
- package/dist/{chunk-2VLBGQBY.cjs → chunk-N3257XE6.cjs} +724 -577
- package/dist/chunk-N3257XE6.cjs.map +1 -0
- package/dist/chunk-N66HCGCY.cjs +57 -0
- package/dist/chunk-N66HCGCY.cjs.map +1 -0
- package/dist/{chunk-CPEL3YIR.cjs → chunk-NFCVHQ5P.cjs} +55 -22
- package/dist/chunk-NFCVHQ5P.cjs.map +1 -0
- package/dist/{chunk-C4F7VJ5D.cjs → chunk-NI72YOJB.cjs} +84 -2
- package/dist/chunk-NI72YOJB.cjs.map +1 -0
- package/dist/{chunk-EE7N5XXQ.cjs → chunk-NK5Q7UNE.cjs} +10 -21
- package/dist/chunk-NK5Q7UNE.cjs.map +1 -0
- package/dist/{chunk-PHXITZE4.js → chunk-NMWDXFPH.js} +4 -4
- package/dist/{chunk-PHXITZE4.js.map → chunk-NMWDXFPH.js.map} +1 -1
- package/dist/{chunk-FSXTPBRN.js → chunk-NQ6BRJBE.js} +416 -850
- package/dist/chunk-NQ6BRJBE.js.map +1 -0
- package/dist/chunk-OH5E5KIO.js +2057 -0
- package/dist/chunk-OH5E5KIO.js.map +1 -0
- package/dist/chunk-ONU3HIED.cjs +2082 -0
- package/dist/chunk-ONU3HIED.cjs.map +1 -0
- package/dist/{chunk-STQ3BSED.cjs → chunk-PNN7RHVR.cjs} +66 -44
- package/dist/chunk-PNN7RHVR.cjs.map +1 -0
- package/dist/{chunk-6DCB664D.js → chunk-PQBQG7IM.js} +3 -3
- package/dist/{chunk-6DCB664D.js.map → chunk-PQBQG7IM.js.map} +1 -1
- package/dist/{chunk-ACSVZPK7.cjs → chunk-PWLJ77UV.cjs} +5 -3
- package/dist/chunk-PWLJ77UV.cjs.map +1 -0
- package/dist/chunk-Q7Q4WSLJ.cjs +328 -0
- package/dist/chunk-Q7Q4WSLJ.cjs.map +1 -0
- package/dist/{chunk-BEFM74L2.js → chunk-QLRESYPU.js} +637 -493
- package/dist/chunk-QLRESYPU.js.map +1 -0
- package/dist/{chunk-SBPC5IP3.js → chunk-QWX5YA3K.js} +784 -202
- package/dist/chunk-QWX5YA3K.js.map +1 -0
- package/dist/{chunk-TCRIQMBU.js → chunk-RJS7DECT.js} +8 -9
- package/dist/chunk-RJS7DECT.js.map +1 -0
- package/dist/{chunk-6JZUSDY2.cjs → chunk-RMQLSPA2.cjs} +297 -27
- package/dist/chunk-RMQLSPA2.cjs.map +1 -0
- package/dist/{chunk-SJDMVITW.cjs → chunk-RT5ZY4XA.cjs} +6 -5
- package/dist/chunk-RT5ZY4XA.cjs.map +1 -0
- package/dist/{chunk-IJTLXNGJ.js → chunk-T4XNKYXB.js} +780 -127
- package/dist/chunk-T4XNKYXB.js.map +1 -0
- package/dist/{chunk-PDGEXGS6.cjs → chunk-TQR4KBY2.cjs} +354 -182
- package/dist/chunk-TQR4KBY2.cjs.map +1 -0
- package/dist/chunk-TTAITEPJ.cjs +755 -0
- package/dist/chunk-TTAITEPJ.cjs.map +1 -0
- package/dist/{chunk-NN3QSOVS.cjs → chunk-U5SON7R2.cjs} +27 -27
- package/dist/{chunk-NN3QSOVS.cjs.map → chunk-U5SON7R2.cjs.map} +1 -1
- package/dist/{chunk-A2I2XO52.cjs → chunk-U63GDNRC.cjs} +32 -26
- package/dist/chunk-U63GDNRC.cjs.map +1 -0
- package/dist/{chunk-YNULOIR5.cjs → chunk-UDISNXDL.cjs} +64 -43
- package/dist/chunk-UDISNXDL.cjs.map +1 -0
- package/dist/{chunk-GWEDD3DH.js → chunk-UV3SN74I.js} +5 -5
- package/dist/{chunk-GWEDD3DH.js.map → chunk-UV3SN74I.js.map} +1 -1
- package/dist/{chunk-U5W4LKZV.cjs → chunk-VCRRKBLN.cjs} +9 -9
- package/dist/{chunk-U5W4LKZV.cjs.map → chunk-VCRRKBLN.cjs.map} +1 -1
- package/dist/{chunk-EFELJVLA.js → chunk-VGTJPTIC.js} +28 -5
- package/dist/chunk-VGTJPTIC.js.map +1 -0
- package/dist/chunk-VQH4VAWD.cjs +12 -0
- package/dist/{chunk-EPTSMFH7.cjs.map → chunk-VQH4VAWD.cjs.map} +1 -1
- package/dist/{chunk-SNXVDZAJ.js → chunk-W6OG3HDG.js} +5 -4
- package/dist/chunk-W6OG3HDG.js.map +1 -0
- package/dist/chunk-WDGA7IYB.js +207 -0
- package/dist/chunk-WDGA7IYB.js.map +1 -0
- package/dist/chunk-WEVQJ5LH.js +736 -0
- package/dist/chunk-WEVQJ5LH.js.map +1 -0
- package/dist/{chunk-3PRKZW6D.cjs → chunk-XBYVV3MP.cjs} +60 -5
- package/dist/chunk-XBYVV3MP.cjs.map +1 -0
- package/dist/{chunk-GFRGG2US.cjs → chunk-XCAGZAKP.cjs} +7 -7
- package/dist/{chunk-GFRGG2US.cjs.map → chunk-XCAGZAKP.cjs.map} +1 -1
- package/dist/{chunk-XR4YZFKW.cjs → chunk-XDF2UPEQ.cjs} +3864 -1783
- package/dist/chunk-XDF2UPEQ.cjs.map +1 -0
- package/dist/{chunk-7V2FGGI2.cjs → chunk-XMQSEJCF.cjs} +632 -1080
- package/dist/chunk-XMQSEJCF.cjs.map +1 -0
- package/dist/chunk-XNLIZYRZ.cjs +3432 -0
- package/dist/chunk-XNLIZYRZ.cjs.map +1 -0
- package/dist/{chunk-66UVLHQA.cjs → chunk-XNSI2FJO.cjs} +99 -100
- package/dist/chunk-XNSI2FJO.cjs.map +1 -0
- package/dist/chunk-XQSCL77R.cjs +60 -0
- package/dist/chunk-XQSCL77R.cjs.map +1 -0
- package/dist/{chunk-SVJ5GEXW.cjs → chunk-XUO3KQFO.cjs} +2 -2
- package/dist/chunk-XUO3KQFO.cjs.map +1 -0
- package/dist/{chunk-HJH3RMXG.cjs → chunk-YAAM3M2S.cjs} +10 -10
- package/dist/{chunk-HJH3RMXG.cjs.map → chunk-YAAM3M2S.cjs.map} +1 -1
- package/dist/{chunk-ATLN63JA.js → chunk-YBFHZUXX.js} +6 -6
- package/dist/{chunk-ATLN63JA.js.map → chunk-YBFHZUXX.js.map} +1 -1
- package/dist/{chunk-K3BUWSFR.js → chunk-YDFDBE6D.js} +119 -6
- package/dist/chunk-YDFDBE6D.js.map +1 -0
- package/dist/{chunk-OSZPLZIV.cjs → chunk-YVWGEQJE.cjs} +318 -132
- package/dist/chunk-YVWGEQJE.cjs.map +1 -0
- package/dist/{chunk-QT6V3YRH.js → chunk-YWGVVALJ.js} +3 -3
- package/dist/{chunk-QT6V3YRH.js.map → chunk-YWGVVALJ.js.map} +1 -1
- package/dist/core/index.cjs +40 -41
- package/dist/core/index.d.cts +4 -5
- package/dist/core/index.d.ts +4 -5
- package/dist/core/index.js +8 -9
- package/dist/{ddl-eWg7hx6R.d.cts → ddl-BJcOp4WZ.d.cts} +3 -3
- package/dist/{ddl-D5369kOY.d.ts → ddl-BXfGHbPN.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +26 -23
- package/dist/graph-extension/index.d.cts +16 -6
- package/dist/graph-extension/index.d.ts +16 -6
- package/dist/graph-extension/index.js +7 -8
- package/dist/graph-merge/index.cjs +2459 -655
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +170 -33
- package/dist/graph-merge/index.d.ts +170 -33
- package/dist/graph-merge/index.js +2269 -468
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-By89Sezh.d.ts → index-BSHvKfok.d.ts} +221 -10
- package/dist/{index-DcQ3Sxs-.d.cts → index-DxaYCv8Y.d.cts} +221 -10
- package/dist/index.cjs +330 -269
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +590 -576
- package/dist/index.d.ts +590 -576
- package/dist/index.js +73 -50
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +17 -17
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +10 -10
- package/dist/interchange/index.cjs +165 -50
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +261 -16
- package/dist/interchange/index.d.ts +261 -16
- package/dist/interchange/index.js +128 -24
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-B0KjKE93.d.ts → manager-CfZAimti.d.ts} +36 -5
- package/dist/{manager-Cn0NFIhN.d.cts → manager-HGk6E_HW.d.cts} +36 -5
- package/dist/{materialize-indexes-BD4V3svD.d.ts → materialize-indexes-6A7dWGtb.d.cts} +10 -2
- package/dist/{materialize-indexes-DVRhd5h4.d.cts → materialize-indexes-BMJP6Tms.d.ts} +10 -2
- package/dist/{postgres-DaEWvN4x.d.cts → postgres-DFYWENdR.d.cts} +1961 -439
- package/dist/{postgres-u0a0HN2D.d.ts → postgres-e7a9TdvR.d.ts} +1961 -439
- package/dist/profiler/index.cjs +15 -15
- package/dist/profiler/index.d.cts +9 -10
- package/dist/profiler/index.d.ts +9 -10
- package/dist/profiler/index.js +4 -4
- package/dist/provenance/index.cjs +46 -48
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +12 -14
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +50 -49
- package/dist/schema/index.d.cts +9 -16
- package/dist/schema/index.d.ts +9 -16
- package/dist/schema/index.js +23 -22
- package/dist/{searchable-CnYEancP.d.ts → searchable-9OQoPuRs.d.ts} +1 -2
- package/dist/{searchable-BT7j9_IK.d.cts → searchable-CIje5XYD.d.cts} +1 -2
- package/dist/{sqlite-BrMoSsI7.d.cts → sqlite-DerU5tc7.d.ts} +2029 -347
- package/dist/{sqlite-CHhZUyO5.d.ts → sqlite-DitnISa9.d.cts} +2029 -347
- package/dist/{store-view-Bvdku0Ht.d.ts → store-DawaWWjJ.d.ts} +3145 -2556
- package/dist/{store-view-w-md0nQ4.d.cts → store-RwTJx8LX.d.cts} +3145 -2556
- package/dist/{temporal-BCORwUau.d.cts → temporal-Bn-Fi8FJ.d.cts} +1 -1
- package/dist/{temporal--x9T8K4S.d.ts → temporal-BtM4UALv.d.ts} +1 -1
- package/dist/{types-6-WJmSD4.d.cts → types-CoIx8HX5.d.cts} +1 -1
- package/dist/{types-Cjvkj0jA.d.ts → types-HkveCCx0.d.cts} +866 -21
- package/dist/{types-Cjvkj0jA.d.cts → types-HkveCCx0.d.ts} +866 -21
- package/dist/{types-COODtTJU.d.ts → types-KFfk-8Ah.d.ts} +1 -1
- package/dist/{where-CUQmCR6d.d.cts → where--fk7_0kv.d.cts} +1 -1
- package/dist/{where-5xVawAwL.d.ts → where-ws5hf-Ov.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2BIG7U6E.cjs +0 -83
- package/dist/chunk-2BIG7U6E.cjs.map +0 -1
- package/dist/chunk-2L54C2C2.js +0 -144
- package/dist/chunk-2L54C2C2.js.map +0 -1
- package/dist/chunk-2VLBGQBY.cjs.map +0 -1
- package/dist/chunk-2WDD2NO3.js +0 -59
- package/dist/chunk-2WDD2NO3.js.map +0 -1
- package/dist/chunk-2Y4IFKW7.js.map +0 -1
- package/dist/chunk-35S6P5ZU.js +0 -27
- package/dist/chunk-35S6P5ZU.js.map +0 -1
- package/dist/chunk-3PRKZW6D.cjs.map +0 -1
- package/dist/chunk-4MB3AQAQ.js.map +0 -1
- package/dist/chunk-4SZ6XPTG.cjs +0 -12
- package/dist/chunk-5MUSU4ZP.cjs.map +0 -1
- package/dist/chunk-63KCKSSH.js.map +0 -1
- package/dist/chunk-66UVLHQA.cjs.map +0 -1
- package/dist/chunk-6JZUSDY2.cjs.map +0 -1
- package/dist/chunk-764JHTLT.cjs +0 -15
- package/dist/chunk-764JHTLT.cjs.map +0 -1
- package/dist/chunk-7G32LIQM.js.map +0 -1
- package/dist/chunk-7V2FGGI2.cjs.map +0 -1
- package/dist/chunk-A2I2XO52.cjs.map +0 -1
- package/dist/chunk-A4PBRX4C.cjs +0 -100
- package/dist/chunk-A4PBRX4C.cjs.map +0 -1
- package/dist/chunk-ACSVZPK7.cjs.map +0 -1
- package/dist/chunk-ALFUGRYB.cjs +0 -1282
- package/dist/chunk-ALFUGRYB.cjs.map +0 -1
- package/dist/chunk-B75XRV3O.js +0 -125
- package/dist/chunk-B75XRV3O.js.map +0 -1
- package/dist/chunk-BCP7LLOY.js.map +0 -1
- package/dist/chunk-BEFM74L2.js.map +0 -1
- package/dist/chunk-BNUFUFAU.js.map +0 -1
- package/dist/chunk-C4F7VJ5D.cjs.map +0 -1
- package/dist/chunk-CPEL3YIR.cjs.map +0 -1
- package/dist/chunk-D7PG5D5K.js.map +0 -1
- package/dist/chunk-DI74SMXS.cjs +0 -29
- package/dist/chunk-DI74SMXS.cjs.map +0 -1
- package/dist/chunk-DK2S42XB.js +0 -77
- package/dist/chunk-DK2S42XB.js.map +0 -1
- package/dist/chunk-DRACN6XG.js +0 -27
- package/dist/chunk-DRACN6XG.js.map +0 -1
- package/dist/chunk-EE7N5XXQ.cjs.map +0 -1
- package/dist/chunk-EFELJVLA.js.map +0 -1
- package/dist/chunk-EPTSMFH7.cjs +0 -12
- package/dist/chunk-EQ7JKLZO.cjs +0 -157
- package/dist/chunk-EQ7JKLZO.cjs.map +0 -1
- package/dist/chunk-FJMPR3OH.cjs.map +0 -1
- package/dist/chunk-FMGEZBAQ.js.map +0 -1
- package/dist/chunk-FMMIX6N4.js.map +0 -1
- package/dist/chunk-FRHHDHKH.js.map +0 -1
- package/dist/chunk-FSXTPBRN.js.map +0 -1
- package/dist/chunk-G6Q5UM7U.js.map +0 -1
- package/dist/chunk-GYA4JRP5.js.map +0 -1
- package/dist/chunk-HOHAJ2NR.cjs +0 -61
- package/dist/chunk-HOHAJ2NR.cjs.map +0 -1
- package/dist/chunk-HOIFFY4M.js.map +0 -1
- package/dist/chunk-IIMQJYAM.js +0 -81
- package/dist/chunk-IIMQJYAM.js.map +0 -1
- package/dist/chunk-IJTLXNGJ.js.map +0 -1
- package/dist/chunk-ITE4IXAK.js +0 -25
- package/dist/chunk-ITE4IXAK.js.map +0 -1
- package/dist/chunk-K3BUWSFR.js.map +0 -1
- package/dist/chunk-KCO5EFJU.js +0 -79
- package/dist/chunk-KCO5EFJU.js.map +0 -1
- package/dist/chunk-KKYELPZ2.cjs +0 -83
- package/dist/chunk-KKYELPZ2.cjs.map +0 -1
- package/dist/chunk-MCHP7RHZ.cjs.map +0 -1
- package/dist/chunk-MIJKEVV7.js.map +0 -1
- package/dist/chunk-NCX65HBY.cjs +0 -1396
- package/dist/chunk-NCX65HBY.cjs.map +0 -1
- package/dist/chunk-OSZPLZIV.cjs.map +0 -1
- package/dist/chunk-OVUUTCPJ.cjs.map +0 -1
- package/dist/chunk-PDGEXGS6.cjs.map +0 -1
- package/dist/chunk-QB6VMOJ2.cjs.map +0 -1
- package/dist/chunk-QMQLUA66.js +0 -12
- package/dist/chunk-QMQLUA66.js.map +0 -1
- package/dist/chunk-QYWINYEA.cjs.map +0 -1
- package/dist/chunk-S4KQ5LV4.js.map +0 -1
- package/dist/chunk-SBPC5IP3.js.map +0 -1
- package/dist/chunk-SJDMVITW.cjs.map +0 -1
- package/dist/chunk-SNXVDZAJ.js.map +0 -1
- package/dist/chunk-SQRD2CYF.js.map +0 -1
- package/dist/chunk-ST3LPB2V.cjs.map +0 -1
- package/dist/chunk-STQ3BSED.cjs.map +0 -1
- package/dist/chunk-SVJ5GEXW.cjs.map +0 -1
- package/dist/chunk-TCRIQMBU.js.map +0 -1
- package/dist/chunk-TDXIBCGY.cjs.map +0 -1
- package/dist/chunk-TFMVL4QH.js.map +0 -1
- package/dist/chunk-TRF4EBJT.cjs +0 -30
- package/dist/chunk-TRF4EBJT.cjs.map +0 -1
- package/dist/chunk-TVLKA4AY.js +0 -94
- package/dist/chunk-TVLKA4AY.js.map +0 -1
- package/dist/chunk-UR7W5YQK.js.map +0 -1
- package/dist/chunk-VITTKBWF.js +0 -1263
- package/dist/chunk-VITTKBWF.js.map +0 -1
- package/dist/chunk-WBUFJ7BS.cjs +0 -131
- package/dist/chunk-WBUFJ7BS.cjs.map +0 -1
- package/dist/chunk-XR4YZFKW.cjs.map +0 -1
- package/dist/chunk-YNULOIR5.cjs.map +0 -1
- package/dist/chunk-ZDH3DX3C.cjs +0 -30
- package/dist/chunk-ZDH3DX3C.cjs.map +0 -1
- package/dist/chunk-ZTAJL4DT.cjs +0 -85
- package/dist/chunk-ZTAJL4DT.cjs.map +0 -1
- package/dist/define-graph-DVF-oN1i.d.cts +0 -173
- package/dist/define-graph-SvYXOl78.d.ts +0 -173
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var chunkTDXIBCGY_cjs = require('./chunk-TDXIBCGY.cjs');
|
|
3
|
+
var chunkXUO3KQFO_cjs = require('./chunk-XUO3KQFO.cjs');
|
|
4
|
+
var chunkLBJKZXDE_cjs = require('./chunk-LBJKZXDE.cjs');
|
|
5
|
+
var chunkNI72YOJB_cjs = require('./chunk-NI72YOJB.cjs');
|
|
6
|
+
var chunkA7J2YDDI_cjs = require('./chunk-A7J2YDDI.cjs');
|
|
7
|
+
var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
|
|
9
8
|
|
|
10
9
|
// src/ontology/closures.ts
|
|
11
10
|
function computeTransitiveClosure(relations) {
|
|
@@ -78,6 +77,7 @@ var GRAPH_EXTENSION_ISSUE_CODES = [
|
|
|
78
77
|
"ONTOLOGY_CYCLE",
|
|
79
78
|
"ONTOLOGY_SELF_LOOP",
|
|
80
79
|
"ONTOLOGY_DISJOINT_CONFLICT",
|
|
80
|
+
"ONTOLOGY_INVERSE_MULTIPLE_PARTNERS",
|
|
81
81
|
"DUPLICATE_ONTOLOGY_RELATION",
|
|
82
82
|
"INVALID_DOCUMENT_SHAPE",
|
|
83
83
|
"UNKNOWN_DOCUMENT_KEY",
|
|
@@ -87,7 +87,7 @@ var GRAPH_EXTENSION_ISSUE_CODES = [
|
|
|
87
87
|
"EMPTY_INDEX_FIELDS",
|
|
88
88
|
"UNKNOWN_PROPERTY_KEY"
|
|
89
89
|
];
|
|
90
|
-
var GraphExtensionError = class extends
|
|
90
|
+
var GraphExtensionError = class extends chunkNI72YOJB_cjs.TypeGraphError {
|
|
91
91
|
constructor(spec) {
|
|
92
92
|
super(spec.message, spec.code, {
|
|
93
93
|
details: spec.details,
|
|
@@ -198,6 +198,21 @@ var GraphExtensionUnresolvedEndpointError = class extends GraphExtensionError {
|
|
|
198
198
|
this.endpoint = endpoint;
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
+
var GraphExtensionUnresolvedOntologyEndpointError = class extends GraphExtensionError {
|
|
202
|
+
code = "GRAPH_EXTENSION_UNRESOLVED_ONTOLOGY_ENDPOINT";
|
|
203
|
+
metaEdge;
|
|
204
|
+
endpoint;
|
|
205
|
+
constructor(metaEdge, endpoint, graphId) {
|
|
206
|
+
super({
|
|
207
|
+
message: `Graph-extension ${metaEdge} endpoint "${endpoint}" does not resolve to a registered edge kind on graph "${graphId}".`,
|
|
208
|
+
code: "GRAPH_EXTENSION_UNRESOLVED_ONTOLOGY_ENDPOINT",
|
|
209
|
+
details: { metaEdge, endpoint, graphId },
|
|
210
|
+
suggestion: "Correct the local edge-kind name, register that edge, or use an absolute http:// or https:// IRI for a deliberate inert external reference."
|
|
211
|
+
});
|
|
212
|
+
this.metaEdge = metaEdge;
|
|
213
|
+
this.endpoint = endpoint;
|
|
214
|
+
}
|
|
215
|
+
};
|
|
201
216
|
var RemoveCompileTimeKindError = class extends GraphExtensionError {
|
|
202
217
|
code = "REMOVE_COMPILE_TIME_KIND";
|
|
203
218
|
kindName;
|
|
@@ -278,8 +293,725 @@ var GRAPH_EXTENSION_TOP_LEVEL_KEYS = [
|
|
|
278
293
|
"indexes"
|
|
279
294
|
];
|
|
280
295
|
|
|
296
|
+
// src/ontology/external-iri.ts
|
|
297
|
+
function isExternalIri(value) {
|
|
298
|
+
return value.startsWith("http://") || value.startsWith("https://");
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// src/registry/kind-registry.ts
|
|
302
|
+
var KindRegistry = class {
|
|
303
|
+
// === Node & Edge Kinds ===
|
|
304
|
+
nodeKinds;
|
|
305
|
+
edgeKinds;
|
|
306
|
+
/**
|
|
307
|
+
* Durable graph identity capability; supplies the identity defaults for
|
|
308
|
+
* every query builder built from this registry (compile-only and
|
|
309
|
+
* store-bound).
|
|
310
|
+
*/
|
|
311
|
+
identity;
|
|
312
|
+
// === Subsumption (subClassOf) ===
|
|
313
|
+
// Transitive closure for inheritance
|
|
314
|
+
subClassAncestors;
|
|
315
|
+
subClassDescendants;
|
|
316
|
+
// === Hierarchy (broader/narrower) ===
|
|
317
|
+
// Transitive closure for concept hierarchy (separate from subClassOf!)
|
|
318
|
+
broaderClosure;
|
|
319
|
+
narrowerClosure;
|
|
320
|
+
// === Equivalence ===
|
|
321
|
+
equivalenceSets;
|
|
322
|
+
iriToKind;
|
|
323
|
+
relatedKinds;
|
|
324
|
+
// === Constraints ===
|
|
325
|
+
disjointPairs;
|
|
326
|
+
// Normalized pairs: "Organization|Person"
|
|
327
|
+
// === Composition ===
|
|
328
|
+
partOfClosure;
|
|
329
|
+
hasPartClosure;
|
|
330
|
+
// === Edge Relationships ===
|
|
331
|
+
edgeInverses;
|
|
332
|
+
edgeImplicationsClosure;
|
|
333
|
+
edgeImplyingClosure;
|
|
334
|
+
constructor(nodeKinds, edgeKinds, closures, identity) {
|
|
335
|
+
this.nodeKinds = nodeKinds;
|
|
336
|
+
this.edgeKinds = edgeKinds;
|
|
337
|
+
this.identity = identity;
|
|
338
|
+
this.subClassAncestors = closures.subClassAncestors;
|
|
339
|
+
this.subClassDescendants = closures.subClassDescendants;
|
|
340
|
+
this.broaderClosure = closures.broaderClosure;
|
|
341
|
+
this.narrowerClosure = closures.narrowerClosure;
|
|
342
|
+
this.equivalenceSets = closures.equivalenceSets;
|
|
343
|
+
this.iriToKind = closures.iriToKind;
|
|
344
|
+
this.relatedKinds = closures.relatedKinds;
|
|
345
|
+
this.disjointPairs = closures.disjointPairs;
|
|
346
|
+
this.partOfClosure = closures.partOfClosure;
|
|
347
|
+
this.hasPartClosure = closures.hasPartClosure;
|
|
348
|
+
this.edgeInverses = closures.edgeInverses;
|
|
349
|
+
this.edgeImplicationsClosure = closures.edgeImplicationsClosure;
|
|
350
|
+
this.edgeImplyingClosure = closures.edgeImplyingClosure;
|
|
351
|
+
}
|
|
352
|
+
// === Subsumption Methods ===
|
|
353
|
+
/**
|
|
354
|
+
* Checks if child is a subclass of parent (directly or transitively).
|
|
355
|
+
*/
|
|
356
|
+
isSubClassOf(child, parent) {
|
|
357
|
+
return isReachable(this.subClassAncestors, child, parent);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Expands a kind to include all its subclasses.
|
|
361
|
+
* Returns [kind, ...subclasses].
|
|
362
|
+
*/
|
|
363
|
+
expandSubClasses(kind) {
|
|
364
|
+
const descendants = this.subClassDescendants.get(kind) ?? /* @__PURE__ */ new Set();
|
|
365
|
+
return [kind, ...descendants];
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Gets all ancestors of a kind (via subClassOf).
|
|
369
|
+
*/
|
|
370
|
+
getAncestors(kind) {
|
|
371
|
+
return this.subClassAncestors.get(kind) ?? /* @__PURE__ */ new Set();
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Gets all descendants of a kind (via subClassOf).
|
|
375
|
+
*/
|
|
376
|
+
getDescendants(kind) {
|
|
377
|
+
return this.subClassDescendants.get(kind) ?? /* @__PURE__ */ new Set();
|
|
378
|
+
}
|
|
379
|
+
// === Hierarchy Methods ===
|
|
380
|
+
/**
|
|
381
|
+
* Checks if narrowerConcept is narrower than broaderConcept.
|
|
382
|
+
*/
|
|
383
|
+
isNarrowerThan(narrowerConcept, broaderConcept) {
|
|
384
|
+
return isReachable(this.broaderClosure, narrowerConcept, broaderConcept);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Checks if broaderConcept is broader than narrowerConcept.
|
|
388
|
+
*/
|
|
389
|
+
isBroaderThan(broaderConcept, narrowerConcept) {
|
|
390
|
+
return isReachable(this.narrowerClosure, broaderConcept, narrowerConcept);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Expands to include all narrower concepts.
|
|
394
|
+
*/
|
|
395
|
+
expandNarrower(kind) {
|
|
396
|
+
const narrower = this.narrowerClosure.get(kind) ?? /* @__PURE__ */ new Set();
|
|
397
|
+
return [kind, ...narrower];
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Expands to include all broader concepts.
|
|
401
|
+
*/
|
|
402
|
+
expandBroader(kind) {
|
|
403
|
+
const broader = this.broaderClosure.get(kind) ?? /* @__PURE__ */ new Set();
|
|
404
|
+
return [kind, ...broader];
|
|
405
|
+
}
|
|
406
|
+
// === Equivalence Methods ===
|
|
407
|
+
/**
|
|
408
|
+
* Checks if two kinds are equivalent.
|
|
409
|
+
*/
|
|
410
|
+
areEquivalent(a, b) {
|
|
411
|
+
const equivalents = this.equivalenceSets.get(a);
|
|
412
|
+
return equivalents?.has(b) ?? false;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Gets all equivalents of a kind (including external IRIs).
|
|
416
|
+
*/
|
|
417
|
+
getEquivalents(kind) {
|
|
418
|
+
const equivalents = this.equivalenceSets.get(kind);
|
|
419
|
+
return equivalents ? [...equivalents] : [];
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Resolves an external IRI to an internal kind name.
|
|
423
|
+
*/
|
|
424
|
+
resolveIri(iri) {
|
|
425
|
+
return this.iriToKind.get(iri);
|
|
426
|
+
}
|
|
427
|
+
/** Gets directly associated kinds declared through symmetric `relatedTo`. */
|
|
428
|
+
getRelatedKinds(kind) {
|
|
429
|
+
const related = this.relatedKinds.get(kind);
|
|
430
|
+
return related === void 0 ? [] : [...related];
|
|
431
|
+
}
|
|
432
|
+
// === Constraint Methods ===
|
|
433
|
+
/**
|
|
434
|
+
* Checks if two kinds are disjoint.
|
|
435
|
+
*/
|
|
436
|
+
areDisjoint(a, b) {
|
|
437
|
+
const normalizedPair = a < b ? `${a}|${b}` : `${b}|${a}`;
|
|
438
|
+
return this.disjointPairs.has(normalizedPair);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Gets all kinds that are disjoint with the given kind.
|
|
442
|
+
*/
|
|
443
|
+
getDisjointKinds(kind) {
|
|
444
|
+
const result = [];
|
|
445
|
+
for (const pair of this.disjointPairs) {
|
|
446
|
+
const parts = pair.split("|");
|
|
447
|
+
const firstKind = chunkN66HCGCY_cjs.requireDefined(parts[0]);
|
|
448
|
+
const secondKind = chunkN66HCGCY_cjs.requireDefined(parts[1]);
|
|
449
|
+
if (firstKind === kind) result.push(secondKind);
|
|
450
|
+
else if (secondKind === kind) result.push(firstKind);
|
|
451
|
+
}
|
|
452
|
+
return result;
|
|
453
|
+
}
|
|
454
|
+
// === Composition Methods ===
|
|
455
|
+
/**
|
|
456
|
+
* Checks if part is part of whole (directly or transitively).
|
|
457
|
+
*/
|
|
458
|
+
isPartOf(part, whole) {
|
|
459
|
+
return isReachable(this.partOfClosure, part, whole);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Gets all wholes that contain this part.
|
|
463
|
+
*/
|
|
464
|
+
getWholes(part) {
|
|
465
|
+
const wholes = this.partOfClosure.get(part);
|
|
466
|
+
return wholes ? [...wholes] : [];
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Gets all parts of this whole.
|
|
470
|
+
*/
|
|
471
|
+
getParts(whole) {
|
|
472
|
+
const parts = this.hasPartClosure.get(whole);
|
|
473
|
+
return parts ? [...parts] : [];
|
|
474
|
+
}
|
|
475
|
+
// === Edge Relationship Methods ===
|
|
476
|
+
/**
|
|
477
|
+
* Gets the inverse edge kind for a given edge kind.
|
|
478
|
+
* If edgeA inverseOf edgeB, then getInverseEdge("edgeA") returns "edgeB".
|
|
479
|
+
*/
|
|
480
|
+
getInverseEdge(edgeKind) {
|
|
481
|
+
return this.edgeInverses.get(edgeKind);
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Gets all edges implied by a given edge (transitively).
|
|
485
|
+
* If A implies B and B implies C, then getImpliedEdges("A") returns ["B", "C"].
|
|
486
|
+
*/
|
|
487
|
+
getImpliedEdges(edgeKind) {
|
|
488
|
+
const implied = this.edgeImplicationsClosure.get(edgeKind);
|
|
489
|
+
return implied ? [...implied] : [];
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Gets all edges that imply a given edge (transitively).
|
|
493
|
+
* If A implies B and B implies C, then getImplyingEdges("C") returns ["A", "B"].
|
|
494
|
+
* Used for query-time expansion: when querying for C, also include A and B edges.
|
|
495
|
+
*/
|
|
496
|
+
getImplyingEdges(edgeKind) {
|
|
497
|
+
const implying = this.edgeImplyingClosure.get(edgeKind);
|
|
498
|
+
return implying ? [...implying] : [];
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Expands an edge kind to include all edges that imply it.
|
|
502
|
+
* Returns [edgeKind, ...implyingEdges].
|
|
503
|
+
*/
|
|
504
|
+
expandImplyingEdges(edgeKind) {
|
|
505
|
+
const implying = this.edgeImplyingClosure.get(edgeKind) ?? /* @__PURE__ */ new Set();
|
|
506
|
+
return [edgeKind, ...implying];
|
|
507
|
+
}
|
|
508
|
+
// === Edge Endpoint Validation ===
|
|
509
|
+
/**
|
|
510
|
+
* Checks if a concrete kind is assignable to a target kind.
|
|
511
|
+
* Uses subsumption: Company is assignable to Organization if Company subClassOf Organization.
|
|
512
|
+
*/
|
|
513
|
+
isAssignableTo(concreteKind, targetKind) {
|
|
514
|
+
if (concreteKind === targetKind) return true;
|
|
515
|
+
return this.isSubClassOf(concreteKind, targetKind);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Checks if a concrete kind is assignable to at least one of the given
|
|
519
|
+
* target kinds. Shared by every "is this kind usable where one of these
|
|
520
|
+
* kinds is expected" check (edge endpoint validation, ontology relation
|
|
521
|
+
* endpoint compatibility) so they can't independently drift.
|
|
522
|
+
*/
|
|
523
|
+
isAssignableToAny(concreteKind, targetKinds) {
|
|
524
|
+
return targetKinds.some(
|
|
525
|
+
(targetKind) => this.isAssignableTo(concreteKind, targetKind)
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Validates that a kind exists in the registry.
|
|
530
|
+
*/
|
|
531
|
+
hasNodeType(name) {
|
|
532
|
+
return this.nodeKinds.has(name);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Validates that an edge kind exists in the registry.
|
|
536
|
+
*/
|
|
537
|
+
hasEdgeType(name) {
|
|
538
|
+
return this.edgeKinds.has(name);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Gets a node kind by name.
|
|
542
|
+
*/
|
|
543
|
+
getNodeType(name) {
|
|
544
|
+
return this.nodeKinds.get(name);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Gets an edge kind by name.
|
|
548
|
+
*/
|
|
549
|
+
getEdgeType(name) {
|
|
550
|
+
return this.edgeKinds.get(name);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
function createEmptyClosures() {
|
|
554
|
+
return {
|
|
555
|
+
subClassAncestors: /* @__PURE__ */ new Map(),
|
|
556
|
+
subClassDescendants: /* @__PURE__ */ new Map(),
|
|
557
|
+
broaderClosure: /* @__PURE__ */ new Map(),
|
|
558
|
+
narrowerClosure: /* @__PURE__ */ new Map(),
|
|
559
|
+
equivalenceSets: /* @__PURE__ */ new Map(),
|
|
560
|
+
iriToKind: /* @__PURE__ */ new Map(),
|
|
561
|
+
relatedKinds: /* @__PURE__ */ new Map(),
|
|
562
|
+
disjointPairs: /* @__PURE__ */ new Set(),
|
|
563
|
+
partOfClosure: /* @__PURE__ */ new Map(),
|
|
564
|
+
hasPartClosure: /* @__PURE__ */ new Map(),
|
|
565
|
+
edgeInverses: /* @__PURE__ */ new Map(),
|
|
566
|
+
edgeImplicationsClosure: /* @__PURE__ */ new Map(),
|
|
567
|
+
edgeImplyingClosure: /* @__PURE__ */ new Map()
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
function computeClosuresFromOntology(ontology) {
|
|
571
|
+
return computeClosuresFromNamedOntology(
|
|
572
|
+
ontology.map((relation) => ({
|
|
573
|
+
metaEdge: relation.metaEdge.name,
|
|
574
|
+
from: getKindName(relation.from),
|
|
575
|
+
to: getKindName(relation.to)
|
|
576
|
+
}))
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
function collectOntologyRelations(ontology) {
|
|
580
|
+
const subClass = [];
|
|
581
|
+
const broader = [];
|
|
582
|
+
const equivalent = [];
|
|
583
|
+
const related = [];
|
|
584
|
+
const disjoint = [];
|
|
585
|
+
const partOf = [];
|
|
586
|
+
const inverseOf = [];
|
|
587
|
+
const implies = [];
|
|
588
|
+
for (const relation of ontology) {
|
|
589
|
+
const fromName = relation.from;
|
|
590
|
+
const toName = relation.to;
|
|
591
|
+
switch (relation.metaEdge) {
|
|
592
|
+
case chunkXUO3KQFO_cjs.META_EDGE_SUB_CLASS_OF: {
|
|
593
|
+
subClass.push([fromName, toName]);
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
case chunkXUO3KQFO_cjs.META_EDGE_BROADER: {
|
|
597
|
+
broader.push([fromName, toName]);
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
case chunkXUO3KQFO_cjs.META_EDGE_NARROWER: {
|
|
601
|
+
broader.push([toName, fromName]);
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
case chunkXUO3KQFO_cjs.META_EDGE_EQUIVALENT_TO:
|
|
605
|
+
case chunkXUO3KQFO_cjs.META_EDGE_SAME_AS: {
|
|
606
|
+
equivalent.push([fromName, toName]);
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
case chunkXUO3KQFO_cjs.META_EDGE_RELATED_TO: {
|
|
610
|
+
related.push([fromName, toName]);
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
case chunkXUO3KQFO_cjs.META_EDGE_DISJOINT_WITH: {
|
|
614
|
+
disjoint.push([fromName, toName]);
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
case chunkXUO3KQFO_cjs.META_EDGE_PART_OF: {
|
|
618
|
+
partOf.push([fromName, toName]);
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
case chunkXUO3KQFO_cjs.META_EDGE_HAS_PART: {
|
|
622
|
+
partOf.push([toName, fromName]);
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
case chunkXUO3KQFO_cjs.META_EDGE_INVERSE_OF: {
|
|
626
|
+
inverseOf.push([fromName, toName]);
|
|
627
|
+
break;
|
|
628
|
+
}
|
|
629
|
+
case chunkXUO3KQFO_cjs.META_EDGE_IMPLIES: {
|
|
630
|
+
implies.push([fromName, toName]);
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return {
|
|
636
|
+
subClass,
|
|
637
|
+
broader,
|
|
638
|
+
equivalent,
|
|
639
|
+
related,
|
|
640
|
+
disjoint,
|
|
641
|
+
partOf,
|
|
642
|
+
inverseOf,
|
|
643
|
+
implies
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function computeSubsumptionAndEquivalenceClosures(collected) {
|
|
647
|
+
const subClassAncestors = computeTransitiveClosure(collected.subClass);
|
|
648
|
+
return {
|
|
649
|
+
subClassAncestors,
|
|
650
|
+
subClassDescendants: invertClosure(subClassAncestors),
|
|
651
|
+
equivalenceSets: computeEquivalenceSets(collected.equivalent)
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
function computeDisjointExpansionClosures(ontology) {
|
|
655
|
+
return computeSubsumptionAndEquivalenceClosures(
|
|
656
|
+
collectOntologyRelations(ontology)
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
function computeClosuresFromNamedOntology(ontology) {
|
|
660
|
+
const collected = collectOntologyRelations(ontology);
|
|
661
|
+
const { subClassAncestors, subClassDescendants, equivalenceSets } = computeSubsumptionAndEquivalenceClosures(collected);
|
|
662
|
+
const broaderClosure = computeTransitiveClosure(collected.broader);
|
|
663
|
+
const narrowerClosure = invertClosure(broaderClosure);
|
|
664
|
+
const iriToKind = computeIriMapping(collected.equivalent);
|
|
665
|
+
const relatedKinds = computeSymmetricRelations(collected.related);
|
|
666
|
+
const disjointPairs = computeDisjointPairs(collected.disjoint, {
|
|
667
|
+
subClassDescendants,
|
|
668
|
+
equivalenceSets
|
|
669
|
+
});
|
|
670
|
+
const partOfClosure = computeTransitiveClosure(collected.partOf);
|
|
671
|
+
const hasPartClosure = invertClosure(partOfClosure);
|
|
672
|
+
const edgeInverses = computeEdgeInverses(collected.inverseOf);
|
|
673
|
+
const edgeImplicationsClosure = computeTransitiveClosure(collected.implies);
|
|
674
|
+
const edgeImplyingClosure = invertClosure(edgeImplicationsClosure);
|
|
675
|
+
return {
|
|
676
|
+
subClassAncestors,
|
|
677
|
+
subClassDescendants,
|
|
678
|
+
broaderClosure,
|
|
679
|
+
narrowerClosure,
|
|
680
|
+
equivalenceSets,
|
|
681
|
+
iriToKind,
|
|
682
|
+
relatedKinds,
|
|
683
|
+
disjointPairs,
|
|
684
|
+
partOfClosure,
|
|
685
|
+
hasPartClosure,
|
|
686
|
+
edgeInverses,
|
|
687
|
+
edgeImplicationsClosure,
|
|
688
|
+
edgeImplyingClosure
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
function getKindName(kindOrIri) {
|
|
692
|
+
if (typeof kindOrIri === "string") {
|
|
693
|
+
return kindOrIri;
|
|
694
|
+
}
|
|
695
|
+
return kindOrIri.kind;
|
|
696
|
+
}
|
|
697
|
+
function computeEquivalenceSets(relations) {
|
|
698
|
+
const parent = /* @__PURE__ */ new Map();
|
|
699
|
+
const size = /* @__PURE__ */ new Map();
|
|
700
|
+
function find(x) {
|
|
701
|
+
if (!parent.has(x)) {
|
|
702
|
+
parent.set(x, x);
|
|
703
|
+
size.set(x, 1);
|
|
704
|
+
return x;
|
|
705
|
+
}
|
|
706
|
+
let root = x;
|
|
707
|
+
while (chunkN66HCGCY_cjs.requireDefined(parent.get(root)) !== root) {
|
|
708
|
+
root = chunkN66HCGCY_cjs.requireDefined(parent.get(root));
|
|
709
|
+
}
|
|
710
|
+
let cursor = x;
|
|
711
|
+
while (cursor !== root) {
|
|
712
|
+
const next = chunkN66HCGCY_cjs.requireDefined(parent.get(cursor));
|
|
713
|
+
parent.set(cursor, root);
|
|
714
|
+
cursor = next;
|
|
715
|
+
}
|
|
716
|
+
return root;
|
|
717
|
+
}
|
|
718
|
+
function union(a, b) {
|
|
719
|
+
const rootA = find(a);
|
|
720
|
+
const rootB = find(b);
|
|
721
|
+
if (rootA === rootB) return;
|
|
722
|
+
const sizeA = chunkN66HCGCY_cjs.requireDefined(size.get(rootA));
|
|
723
|
+
const sizeB = chunkN66HCGCY_cjs.requireDefined(size.get(rootB));
|
|
724
|
+
const [root, child] = sizeA >= sizeB ? [rootA, rootB] : [rootB, rootA];
|
|
725
|
+
parent.set(child, root);
|
|
726
|
+
size.set(root, sizeA + sizeB);
|
|
727
|
+
}
|
|
728
|
+
for (const [a, b] of relations) {
|
|
729
|
+
union(a, b);
|
|
730
|
+
}
|
|
731
|
+
const classes = /* @__PURE__ */ new Map();
|
|
732
|
+
for (const key of parent.keys()) {
|
|
733
|
+
const root = find(key);
|
|
734
|
+
const existing = classes.get(root) ?? /* @__PURE__ */ new Set();
|
|
735
|
+
existing.add(key);
|
|
736
|
+
classes.set(root, existing);
|
|
737
|
+
}
|
|
738
|
+
const result = /* @__PURE__ */ new Map();
|
|
739
|
+
for (const members of classes.values()) {
|
|
740
|
+
for (const member of members) {
|
|
741
|
+
result.set(member, new ExcludingReadonlySet(members, member));
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return result;
|
|
745
|
+
}
|
|
746
|
+
var ExcludingReadonlySet = class {
|
|
747
|
+
#members;
|
|
748
|
+
#excludedMember;
|
|
749
|
+
[Symbol.toStringTag] = "Set";
|
|
750
|
+
constructor(members, excludedMember) {
|
|
751
|
+
this.#members = members;
|
|
752
|
+
this.#excludedMember = excludedMember;
|
|
753
|
+
}
|
|
754
|
+
get size() {
|
|
755
|
+
return this.#members.size - (this.#members.has(this.#excludedMember) ? 1 : 0);
|
|
756
|
+
}
|
|
757
|
+
has(value) {
|
|
758
|
+
return value !== this.#excludedMember && this.#members.has(value);
|
|
759
|
+
}
|
|
760
|
+
*entries() {
|
|
761
|
+
for (const value of this) yield [value, value];
|
|
762
|
+
}
|
|
763
|
+
keys() {
|
|
764
|
+
return this.values();
|
|
765
|
+
}
|
|
766
|
+
*values() {
|
|
767
|
+
for (const value of this.#members) {
|
|
768
|
+
if (value !== this.#excludedMember) yield value;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
forEach(callbackFunction, thisArgument) {
|
|
772
|
+
for (const value of this) {
|
|
773
|
+
callbackFunction.call(thisArgument, value, value, this);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
[Symbol.iterator]() {
|
|
777
|
+
return this.values();
|
|
778
|
+
}
|
|
779
|
+
union(other) {
|
|
780
|
+
return this.materialize().union(other);
|
|
781
|
+
}
|
|
782
|
+
intersection(other) {
|
|
783
|
+
return this.materialize().intersection(other);
|
|
784
|
+
}
|
|
785
|
+
difference(other) {
|
|
786
|
+
return this.materialize().difference(other);
|
|
787
|
+
}
|
|
788
|
+
symmetricDifference(other) {
|
|
789
|
+
return this.materialize().symmetricDifference(other);
|
|
790
|
+
}
|
|
791
|
+
isSubsetOf(other) {
|
|
792
|
+
return this.materialize().isSubsetOf(other);
|
|
793
|
+
}
|
|
794
|
+
isSupersetOf(other) {
|
|
795
|
+
return this.materialize().isSupersetOf(other);
|
|
796
|
+
}
|
|
797
|
+
isDisjointFrom(other) {
|
|
798
|
+
return this.materialize().isDisjointFrom(other);
|
|
799
|
+
}
|
|
800
|
+
materialize() {
|
|
801
|
+
return new Set(this);
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
function computeIriMapping(relations) {
|
|
805
|
+
const result = /* @__PURE__ */ new Map();
|
|
806
|
+
for (const [a, b] of relations) {
|
|
807
|
+
if (isExternalIri(a) && !isExternalIri(b)) {
|
|
808
|
+
result.set(a, b);
|
|
809
|
+
} else if (isExternalIri(b) && !isExternalIri(a)) {
|
|
810
|
+
result.set(b, a);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
return result;
|
|
814
|
+
}
|
|
815
|
+
function computeDisjointPairs(relations, closures) {
|
|
816
|
+
const result = /* @__PURE__ */ new Set();
|
|
817
|
+
for (const [a, b] of relations) {
|
|
818
|
+
const leftKinds = expandDisjointSide(a, closures);
|
|
819
|
+
const rightKinds = expandDisjointSide(b, closures);
|
|
820
|
+
for (const left of leftKinds) {
|
|
821
|
+
for (const right of rightKinds) {
|
|
822
|
+
if (left === right) continue;
|
|
823
|
+
const normalized = left < right ? `${left}|${right}` : `${right}|${left}`;
|
|
824
|
+
result.add(normalized);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return result;
|
|
829
|
+
}
|
|
830
|
+
function expandDisjointSide(kind, closures) {
|
|
831
|
+
const expanded = /* @__PURE__ */ new Set();
|
|
832
|
+
const consumedEquivalenceClasses = /* @__PURE__ */ new Set();
|
|
833
|
+
const pending = [kind];
|
|
834
|
+
while (pending.length > 0) {
|
|
835
|
+
const current = chunkN66HCGCY_cjs.requireDefined(pending.pop());
|
|
836
|
+
if (expanded.has(current) || isExternalIri(current)) continue;
|
|
837
|
+
expanded.add(current);
|
|
838
|
+
if (!consumedEquivalenceClasses.has(current)) {
|
|
839
|
+
consumedEquivalenceClasses.add(current);
|
|
840
|
+
for (const equivalent of closures.equivalenceSets.get(current) ?? []) {
|
|
841
|
+
consumedEquivalenceClasses.add(equivalent);
|
|
842
|
+
pending.push(equivalent);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
for (const descendant of closures.subClassDescendants.get(current) ?? []) {
|
|
846
|
+
pending.push(descendant);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
return [...expanded];
|
|
850
|
+
}
|
|
851
|
+
function computeSymmetricRelations(relations) {
|
|
852
|
+
const result = /* @__PURE__ */ new Map();
|
|
853
|
+
for (const [a, b] of relations) {
|
|
854
|
+
const relatedToA = result.get(a) ?? /* @__PURE__ */ new Set();
|
|
855
|
+
relatedToA.add(b);
|
|
856
|
+
result.set(a, relatedToA);
|
|
857
|
+
const relatedToB = result.get(b) ?? /* @__PURE__ */ new Set();
|
|
858
|
+
relatedToB.add(a);
|
|
859
|
+
result.set(b, relatedToB);
|
|
860
|
+
}
|
|
861
|
+
return result;
|
|
862
|
+
}
|
|
863
|
+
function computeEdgeInverses(relations) {
|
|
864
|
+
const result = /* @__PURE__ */ new Map();
|
|
865
|
+
for (const [a, b] of relations) {
|
|
866
|
+
result.set(a, b);
|
|
867
|
+
result.set(b, a);
|
|
868
|
+
}
|
|
869
|
+
return result;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// src/ontology/validation.ts
|
|
873
|
+
var STRICTLY_HIERARCHICAL = /* @__PURE__ */ new Set([
|
|
874
|
+
chunkXUO3KQFO_cjs.META_EDGE_SUB_CLASS_OF,
|
|
875
|
+
chunkXUO3KQFO_cjs.META_EDGE_BROADER,
|
|
876
|
+
chunkXUO3KQFO_cjs.META_EDGE_NARROWER,
|
|
877
|
+
chunkXUO3KQFO_cjs.META_EDGE_PART_OF,
|
|
878
|
+
chunkXUO3KQFO_cjs.META_EDGE_HAS_PART
|
|
879
|
+
]);
|
|
880
|
+
var HIERARCHICAL_NORMALIZATION = /* @__PURE__ */ new Map([
|
|
881
|
+
[chunkXUO3KQFO_cjs.META_EDGE_SUB_CLASS_OF, { canonical: chunkXUO3KQFO_cjs.META_EDGE_SUB_CLASS_OF, flip: false }],
|
|
882
|
+
[chunkXUO3KQFO_cjs.META_EDGE_BROADER, { canonical: chunkXUO3KQFO_cjs.META_EDGE_BROADER, flip: false }],
|
|
883
|
+
[chunkXUO3KQFO_cjs.META_EDGE_NARROWER, { canonical: chunkXUO3KQFO_cjs.META_EDGE_BROADER, flip: true }],
|
|
884
|
+
[chunkXUO3KQFO_cjs.META_EDGE_PART_OF, { canonical: chunkXUO3KQFO_cjs.META_EDGE_PART_OF, flip: false }],
|
|
885
|
+
[chunkXUO3KQFO_cjs.META_EDGE_HAS_PART, { canonical: chunkXUO3KQFO_cjs.META_EDGE_PART_OF, flip: true }]
|
|
886
|
+
]);
|
|
887
|
+
function validateOntologyRelations(ontology) {
|
|
888
|
+
const issues = [];
|
|
889
|
+
validateSelfLoopsAndDuplicates(ontology, issues);
|
|
890
|
+
detectHierarchicalCycles(ontology, issues);
|
|
891
|
+
detectDisjointExpansionConflicts(ontology, issues);
|
|
892
|
+
detectMultipleInversePartners(ontology, issues);
|
|
893
|
+
return issues;
|
|
894
|
+
}
|
|
895
|
+
function validateSelfLoopsAndDuplicates(ontology, issues) {
|
|
896
|
+
const seenKeys = /* @__PURE__ */ new Set();
|
|
897
|
+
for (const [index, relation] of ontology.entries()) {
|
|
898
|
+
if (relation.from === relation.to) {
|
|
899
|
+
if (STRICTLY_HIERARCHICAL.has(relation.metaEdge)) {
|
|
900
|
+
issues.push({
|
|
901
|
+
relationIndex: index,
|
|
902
|
+
message: `Hierarchical meta-edge "${relation.metaEdge}" cannot be a self-loop ("${relation.from}" \u2192 "${relation.to}").`,
|
|
903
|
+
code: "ONTOLOGY_SELF_LOOP",
|
|
904
|
+
details: { metaEdge: relation.metaEdge, kind: relation.from }
|
|
905
|
+
});
|
|
906
|
+
} else if (relation.metaEdge === chunkXUO3KQFO_cjs.META_EDGE_DISJOINT_WITH) {
|
|
907
|
+
issues.push({
|
|
908
|
+
relationIndex: index,
|
|
909
|
+
message: `Contradiction: kind "${relation.from}" cannot be declared disjointWith itself.`,
|
|
910
|
+
code: "ONTOLOGY_DISJOINT_CONFLICT",
|
|
911
|
+
details: { from: relation.from, to: relation.to }
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
const key = `${relation.metaEdge}::${relation.from}->${relation.to}`;
|
|
916
|
+
if (seenKeys.has(key)) {
|
|
917
|
+
issues.push({
|
|
918
|
+
relationIndex: index,
|
|
919
|
+
message: `Duplicate ontology relation "${relation.metaEdge}" (${relation.from} \u2192 ${relation.to}).`,
|
|
920
|
+
code: "DUPLICATE_ONTOLOGY_RELATION",
|
|
921
|
+
details: { ...relation }
|
|
922
|
+
});
|
|
923
|
+
continue;
|
|
924
|
+
}
|
|
925
|
+
seenKeys.add(key);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
function buildHierarchicalGroups(ontology) {
|
|
929
|
+
const groups = /* @__PURE__ */ new Map();
|
|
930
|
+
for (const [index, relation] of ontology.entries()) {
|
|
931
|
+
const normalization = HIERARCHICAL_NORMALIZATION.get(relation.metaEdge);
|
|
932
|
+
if (normalization === void 0) continue;
|
|
933
|
+
if (relation.from === relation.to) continue;
|
|
934
|
+
const from = normalization.flip ? relation.to : relation.from;
|
|
935
|
+
const to = normalization.flip ? relation.from : relation.to;
|
|
936
|
+
const edges = groups.get(normalization.canonical) ?? [];
|
|
937
|
+
edges.push({ from, to, originalIndex: index });
|
|
938
|
+
groups.set(normalization.canonical, edges);
|
|
939
|
+
}
|
|
940
|
+
return groups;
|
|
941
|
+
}
|
|
942
|
+
function detectHierarchicalCycles(ontology, issues) {
|
|
943
|
+
const groups = buildHierarchicalGroups(ontology);
|
|
944
|
+
for (const [name, edges] of groups) {
|
|
945
|
+
const closure = computeTransitiveClosure(
|
|
946
|
+
edges.map((edge) => [edge.from, edge.to])
|
|
947
|
+
);
|
|
948
|
+
const reportedNodes = /* @__PURE__ */ new Set();
|
|
949
|
+
for (const [from, reachable] of closure) {
|
|
950
|
+
if (!reachable.has(from) || reportedNodes.has(from)) continue;
|
|
951
|
+
reportedNodes.add(from);
|
|
952
|
+
const offendingEdge = edges.find((edge) => edge.from === from);
|
|
953
|
+
issues.push({
|
|
954
|
+
...offendingEdge === void 0 ? {} : { relationIndex: offendingEdge.originalIndex },
|
|
955
|
+
message: `Cycle detected in "${name}" relations involving "${from}".`,
|
|
956
|
+
code: "ONTOLOGY_CYCLE",
|
|
957
|
+
details: { metaEdge: name, kind: from }
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
function collectDisjointDeclarations(ontology) {
|
|
963
|
+
const declarations = [];
|
|
964
|
+
for (const [index, relation] of ontology.entries()) {
|
|
965
|
+
if (relation.metaEdge !== chunkXUO3KQFO_cjs.META_EDGE_DISJOINT_WITH) continue;
|
|
966
|
+
if (relation.from === relation.to) continue;
|
|
967
|
+
declarations.push({ a: relation.from, b: relation.to, index });
|
|
968
|
+
}
|
|
969
|
+
return declarations;
|
|
970
|
+
}
|
|
971
|
+
function detectDisjointExpansionConflicts(ontology, issues) {
|
|
972
|
+
const declarations = collectDisjointDeclarations(ontology);
|
|
973
|
+
if (declarations.length === 0) return;
|
|
974
|
+
const closures = computeDisjointExpansionClosures(ontology);
|
|
975
|
+
for (const { a, b, index } of declarations) {
|
|
976
|
+
const left = expandDisjointSide(a, closures);
|
|
977
|
+
const right = new Set(expandDisjointSide(b, closures));
|
|
978
|
+
const overlappingKind = [...left].filter((kind) => right.has(kind)).toSorted()[0];
|
|
979
|
+
if (overlappingKind === void 0) continue;
|
|
980
|
+
issues.push({
|
|
981
|
+
relationIndex: index,
|
|
982
|
+
message: `Contradiction: the propagated disjointWith sides "${a}" and "${b}" both contain kind "${overlappingKind}".`,
|
|
983
|
+
code: "ONTOLOGY_DISJOINT_CONFLICT",
|
|
984
|
+
details: { kind: overlappingKind, from: a, to: b }
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function detectMultipleInversePartners(ontology, issues) {
|
|
989
|
+
const partners = /* @__PURE__ */ new Map();
|
|
990
|
+
for (const [index, relation] of ontology.entries()) {
|
|
991
|
+
if (relation.metaEdge !== chunkXUO3KQFO_cjs.META_EDGE_INVERSE_OF) continue;
|
|
992
|
+
recordInversePartner(relation.from, relation.to, index, partners, issues);
|
|
993
|
+
if (relation.from !== relation.to) {
|
|
994
|
+
recordInversePartner(relation.to, relation.from, index, partners, issues);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
function recordInversePartner(edgeKind, partnerKind, relationIndex, partners, issues) {
|
|
999
|
+
const existingPartner = partners.get(edgeKind);
|
|
1000
|
+
if (existingPartner === void 0) {
|
|
1001
|
+
partners.set(edgeKind, partnerKind);
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
if (existingPartner === partnerKind) return;
|
|
1005
|
+
issues.push({
|
|
1006
|
+
relationIndex,
|
|
1007
|
+
message: `Edge kind "${edgeKind}" has multiple distinct inverseOf partners ("${existingPartner}" and "${partnerKind}").`,
|
|
1008
|
+
code: "ONTOLOGY_INVERSE_MULTIPLE_PARTNERS",
|
|
1009
|
+
details: { edgeKind, existingPartner, conflictingPartner: partnerKind }
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
|
|
281
1013
|
// src/graph-extension/validation.ts
|
|
282
|
-
var META_EDGE_NAME_SET = new Set(
|
|
1014
|
+
var META_EDGE_NAME_SET = new Set(chunkXUO3KQFO_cjs.ALL_META_EDGE_NAMES);
|
|
283
1015
|
var SUPPORTED_PROPERTY_TYPES = /* @__PURE__ */ new Set([
|
|
284
1016
|
"string",
|
|
285
1017
|
"number",
|
|
@@ -316,7 +1048,7 @@ function rejectUnknownPropertyKeys(raw, type, path, issues) {
|
|
|
316
1048
|
for (const key of Object.keys(raw)) {
|
|
317
1049
|
if (COMMON_PROPERTY_KEYS.has(key) || typeKeys.has(key)) continue;
|
|
318
1050
|
issues.push({
|
|
319
|
-
path: `${path}/${
|
|
1051
|
+
path: `${path}/${chunkA7J2YDDI_cjs.encodeJsonPointerSegment(key)}`,
|
|
320
1052
|
message: `Unknown property key "${key}" for type "${type}". Recognized keys: ${recognized.join(", ")}.`,
|
|
321
1053
|
code: "UNKNOWN_PROPERTY_KEY"
|
|
322
1054
|
});
|
|
@@ -326,7 +1058,7 @@ function rejectUnknownObjectKeys(raw, allowed, label, path, code, issues) {
|
|
|
326
1058
|
for (const key of Object.keys(raw)) {
|
|
327
1059
|
if (allowed.has(key)) continue;
|
|
328
1060
|
issues.push({
|
|
329
|
-
path: `${path}/${
|
|
1061
|
+
path: `${path}/${chunkA7J2YDDI_cjs.encodeJsonPointerSegment(key)}`,
|
|
330
1062
|
message: `Unknown ${label} key "${key}". Allowed: ${[...allowed].join(", ")}.`,
|
|
331
1063
|
code
|
|
332
1064
|
});
|
|
@@ -385,7 +1117,7 @@ var EDGE_INDEX_KEYS = /* @__PURE__ */ new Set([
|
|
|
385
1117
|
function validateGraphExtension(input, options = {}) {
|
|
386
1118
|
const issues = [];
|
|
387
1119
|
const strict = options.strict === true;
|
|
388
|
-
if (!
|
|
1120
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(input)) {
|
|
389
1121
|
issues.push({
|
|
390
1122
|
path: "",
|
|
391
1123
|
message: "Document must be a plain object.",
|
|
@@ -398,7 +1130,7 @@ function validateGraphExtension(input, options = {}) {
|
|
|
398
1130
|
for (const key of Object.keys(documentRecord)) {
|
|
399
1131
|
if (!KNOWN_DOCUMENT_KEYS.has(key)) {
|
|
400
1132
|
issues.push({
|
|
401
|
-
path: `/${
|
|
1133
|
+
path: `/${chunkA7J2YDDI_cjs.encodeJsonPointerSegment(key)}`,
|
|
402
1134
|
message: `Unknown top-level key "${key}". Did you mean one of: ${[...KNOWN_DOCUMENT_KEYS].join(", ")}?`,
|
|
403
1135
|
code: "UNKNOWN_DOCUMENT_KEY"
|
|
404
1136
|
});
|
|
@@ -414,7 +1146,7 @@ function validateGraphExtension(input, options = {}) {
|
|
|
414
1146
|
strict
|
|
415
1147
|
);
|
|
416
1148
|
if (ontology !== void 0) {
|
|
417
|
-
validateOntology(ontology,
|
|
1149
|
+
validateOntology(ontology, issues);
|
|
418
1150
|
}
|
|
419
1151
|
const indexes = validateIndexesSection(
|
|
420
1152
|
documentRecord["indexes"],
|
|
@@ -446,7 +1178,7 @@ function validateVersion(raw, issues) {
|
|
|
446
1178
|
}
|
|
447
1179
|
function validateNodesSection(rawNodes, issues, strict) {
|
|
448
1180
|
if (rawNodes === void 0) return void 0;
|
|
449
|
-
if (!
|
|
1181
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(rawNodes)) {
|
|
450
1182
|
issues.push({
|
|
451
1183
|
path: "/nodes",
|
|
452
1184
|
message: "`nodes` must be a plain object keyed by node-kind name.",
|
|
@@ -454,10 +1186,10 @@ function validateNodesSection(rawNodes, issues, strict) {
|
|
|
454
1186
|
});
|
|
455
1187
|
return void 0;
|
|
456
1188
|
}
|
|
457
|
-
const result =
|
|
1189
|
+
const result = chunkN66HCGCY_cjs.createDataKeyedBag();
|
|
458
1190
|
const recorded = /* @__PURE__ */ new Set();
|
|
459
1191
|
for (const [kindName, rawNode] of Object.entries(rawNodes)) {
|
|
460
|
-
const path = `/nodes/${
|
|
1192
|
+
const path = `/nodes/${chunkA7J2YDDI_cjs.encodeJsonPointerSegment(kindName)}`;
|
|
461
1193
|
if (!isValidKindName(kindName)) {
|
|
462
1194
|
issues.push({
|
|
463
1195
|
path,
|
|
@@ -479,10 +1211,10 @@ function validateNodesSection(rawNodes, issues, strict) {
|
|
|
479
1211
|
result[kindName] = node;
|
|
480
1212
|
recorded.add(kindName);
|
|
481
1213
|
}
|
|
482
|
-
return result;
|
|
1214
|
+
return { ...result };
|
|
483
1215
|
}
|
|
484
1216
|
function validateNodeDocument(kindName, raw, path, issues, strict) {
|
|
485
|
-
if (!
|
|
1217
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
486
1218
|
issues.push({
|
|
487
1219
|
path,
|
|
488
1220
|
message: `Node "${kindName}" must be a plain object.`,
|
|
@@ -531,7 +1263,7 @@ function validateNodeDocument(kindName, raw, path, issues, strict) {
|
|
|
531
1263
|
issues,
|
|
532
1264
|
strict
|
|
533
1265
|
);
|
|
534
|
-
return
|
|
1266
|
+
return chunkN66HCGCY_cjs.compactUndefined({
|
|
535
1267
|
description,
|
|
536
1268
|
annotations,
|
|
537
1269
|
properties,
|
|
@@ -540,7 +1272,7 @@ function validateNodeDocument(kindName, raw, path, issues, strict) {
|
|
|
540
1272
|
}
|
|
541
1273
|
function validateEdgesSection(rawEdges, issues, strict) {
|
|
542
1274
|
if (rawEdges === void 0) return void 0;
|
|
543
|
-
if (!
|
|
1275
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(rawEdges)) {
|
|
544
1276
|
issues.push({
|
|
545
1277
|
path: "/edges",
|
|
546
1278
|
message: "`edges` must be a plain object keyed by edge-kind name.",
|
|
@@ -548,10 +1280,10 @@ function validateEdgesSection(rawEdges, issues, strict) {
|
|
|
548
1280
|
});
|
|
549
1281
|
return void 0;
|
|
550
1282
|
}
|
|
551
|
-
const result =
|
|
1283
|
+
const result = chunkN66HCGCY_cjs.createDataKeyedBag();
|
|
552
1284
|
const recorded = /* @__PURE__ */ new Set();
|
|
553
1285
|
for (const [kindName, rawEdge] of Object.entries(rawEdges)) {
|
|
554
|
-
const path = `/edges/${
|
|
1286
|
+
const path = `/edges/${chunkA7J2YDDI_cjs.encodeJsonPointerSegment(kindName)}`;
|
|
555
1287
|
if (!isValidKindName(kindName)) {
|
|
556
1288
|
issues.push({
|
|
557
1289
|
path,
|
|
@@ -573,10 +1305,10 @@ function validateEdgesSection(rawEdges, issues, strict) {
|
|
|
573
1305
|
result[kindName] = edge;
|
|
574
1306
|
recorded.add(kindName);
|
|
575
1307
|
}
|
|
576
|
-
return result;
|
|
1308
|
+
return { ...result };
|
|
577
1309
|
}
|
|
578
1310
|
function validateEdgeDocument(kindName, raw, path, issues, strict) {
|
|
579
|
-
if (!
|
|
1311
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
580
1312
|
issues.push({
|
|
581
1313
|
path,
|
|
582
1314
|
message: `Edge "${kindName}" must be a plain object.`,
|
|
@@ -620,7 +1352,7 @@ function validateEdgeDocument(kindName, raw, path, issues, strict) {
|
|
|
620
1352
|
strict
|
|
621
1353
|
);
|
|
622
1354
|
if (properties === void 0) return void 0;
|
|
623
|
-
return
|
|
1355
|
+
return chunkN66HCGCY_cjs.compactUndefined({
|
|
624
1356
|
description,
|
|
625
1357
|
annotations,
|
|
626
1358
|
from,
|
|
@@ -672,7 +1404,7 @@ function validateOntologySection(raw, issues, strict) {
|
|
|
672
1404
|
const result = [];
|
|
673
1405
|
for (const [index, entry] of raw.entries()) {
|
|
674
1406
|
const path = `/ontology/${index}`;
|
|
675
|
-
if (!
|
|
1407
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(entry)) {
|
|
676
1408
|
issues.push({
|
|
677
1409
|
path,
|
|
678
1410
|
message: "Ontology entry must be a plain object.",
|
|
@@ -696,7 +1428,7 @@ function validateOntologySection(raw, issues, strict) {
|
|
|
696
1428
|
if (typeof metaEdge !== "string" || !META_EDGE_NAME_SET.has(metaEdge)) {
|
|
697
1429
|
issues.push({
|
|
698
1430
|
path: `${path}/metaEdge`,
|
|
699
|
-
message: `Unknown meta-edge ${describeUnknownValue(metaEdge)}. Allowed: ${[...
|
|
1431
|
+
message: `Unknown meta-edge ${describeUnknownValue(metaEdge)}. Allowed: ${[...chunkXUO3KQFO_cjs.ALL_META_EDGE_NAMES].join(", ")}.`,
|
|
700
1432
|
code: "UNKNOWN_META_EDGE"
|
|
701
1433
|
});
|
|
702
1434
|
continue;
|
|
@@ -721,113 +1453,14 @@ function validateOntologySection(raw, issues, strict) {
|
|
|
721
1453
|
}
|
|
722
1454
|
return result;
|
|
723
1455
|
}
|
|
724
|
-
function validateOntology(ontology,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
code: "ONTOLOGY_SELF_LOOP"
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
const key = `${relation.metaEdge}::${relation.from}->${relation.to}`;
|
|
736
|
-
if (seenKey.has(key)) {
|
|
737
|
-
issues.push({
|
|
738
|
-
path,
|
|
739
|
-
message: `Duplicate ontology relation "${relation.metaEdge}" (${relation.from} \u2192 ${relation.to}).`,
|
|
740
|
-
code: "DUPLICATE_ONTOLOGY_RELATION"
|
|
741
|
-
});
|
|
742
|
-
continue;
|
|
743
|
-
}
|
|
744
|
-
seenKey.add(key);
|
|
745
|
-
}
|
|
746
|
-
detectHierarchicalCycles(ontology, issues);
|
|
747
|
-
detectDisjointHierarchyContradictions(ontology, issues);
|
|
748
|
-
}
|
|
749
|
-
var STRICTLY_HIERARCHICAL = /* @__PURE__ */ new Set([
|
|
750
|
-
"subClassOf",
|
|
751
|
-
"broader",
|
|
752
|
-
"narrower",
|
|
753
|
-
"partOf",
|
|
754
|
-
"hasPart"
|
|
755
|
-
]);
|
|
756
|
-
function isStrictlyHierarchicalMetaEdge(name) {
|
|
757
|
-
return STRICTLY_HIERARCHICAL.has(name);
|
|
758
|
-
}
|
|
759
|
-
var HIERARCHICAL_NORMALIZATION = /* @__PURE__ */ new Map([
|
|
760
|
-
["subClassOf", { canonical: "subClassOf", flip: false }],
|
|
761
|
-
["broader", { canonical: "broader", flip: false }],
|
|
762
|
-
["narrower", { canonical: "broader", flip: true }],
|
|
763
|
-
["partOf", { canonical: "partOf", flip: false }],
|
|
764
|
-
["hasPart", { canonical: "partOf", flip: true }]
|
|
765
|
-
]);
|
|
766
|
-
function buildHierarchicalGroups(ontology, options) {
|
|
767
|
-
const groups = /* @__PURE__ */ new Map();
|
|
768
|
-
for (const [index, relation] of ontology.entries()) {
|
|
769
|
-
const normalization = HIERARCHICAL_NORMALIZATION.get(relation.metaEdge);
|
|
770
|
-
if (normalization === void 0) continue;
|
|
771
|
-
if (options.skipSelfLoops && relation.from === relation.to) continue;
|
|
772
|
-
const from = normalization.flip ? relation.to : relation.from;
|
|
773
|
-
const to = normalization.flip ? relation.from : relation.to;
|
|
774
|
-
const list = groups.get(normalization.canonical) ?? [];
|
|
775
|
-
list.push({ from, to, originalIndex: index });
|
|
776
|
-
groups.set(normalization.canonical, list);
|
|
777
|
-
}
|
|
778
|
-
return groups;
|
|
779
|
-
}
|
|
780
|
-
function detectHierarchicalCycles(ontology, issues) {
|
|
781
|
-
const groups = buildHierarchicalGroups(ontology, { skipSelfLoops: true });
|
|
782
|
-
for (const [name, edges] of groups) {
|
|
783
|
-
const closure = computeTransitiveClosure(
|
|
784
|
-
edges.map((edge) => [edge.from, edge.to])
|
|
785
|
-
);
|
|
786
|
-
const reportedNodes = /* @__PURE__ */ new Set();
|
|
787
|
-
for (const [from, reachable] of closure) {
|
|
788
|
-
if (!reachable.has(from) || reportedNodes.has(from)) continue;
|
|
789
|
-
reportedNodes.add(from);
|
|
790
|
-
const offendingEdge = edges.find((edge) => edge.from === from);
|
|
791
|
-
const path = offendingEdge === void 0 ? "/ontology" : `/ontology/${offendingEdge.originalIndex}`;
|
|
792
|
-
issues.push({
|
|
793
|
-
path,
|
|
794
|
-
message: `Cycle detected in "${name}" relations involving "${from}".`,
|
|
795
|
-
code: "ONTOLOGY_CYCLE"
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
function detectDisjointHierarchyContradictions(ontology, issues) {
|
|
801
|
-
const disjointPairs = /* @__PURE__ */ new Set();
|
|
802
|
-
const disjointPath = /* @__PURE__ */ new Map();
|
|
803
|
-
for (const [index, relation] of ontology.entries()) {
|
|
804
|
-
if (relation.metaEdge !== "disjointWith") continue;
|
|
805
|
-
disjointPairs.add(`${relation.from}|${relation.to}`);
|
|
806
|
-
disjointPairs.add(`${relation.to}|${relation.from}`);
|
|
807
|
-
disjointPath.set(`${relation.from}|${relation.to}`, `/ontology/${index}`);
|
|
808
|
-
disjointPath.set(`${relation.to}|${relation.from}`, `/ontology/${index}`);
|
|
809
|
-
}
|
|
810
|
-
if (disjointPairs.size === 0) return;
|
|
811
|
-
const groups = buildHierarchicalGroups(ontology, { skipSelfLoops: false });
|
|
812
|
-
const reported = /* @__PURE__ */ new Set();
|
|
813
|
-
for (const [name, edges] of groups) {
|
|
814
|
-
const closure = computeTransitiveClosure(
|
|
815
|
-
edges.map((edge) => [edge.from, edge.to])
|
|
816
|
-
);
|
|
817
|
-
for (const [from, reachable] of closure) {
|
|
818
|
-
for (const to of reachable) {
|
|
819
|
-
const pairKey = `${from}|${to}`;
|
|
820
|
-
if (!disjointPairs.has(pairKey)) continue;
|
|
821
|
-
if (reported.has(pairKey)) continue;
|
|
822
|
-
reported.add(pairKey);
|
|
823
|
-
issues.push({
|
|
824
|
-
path: disjointPath.get(pairKey) ?? "/ontology",
|
|
825
|
-
message: `Contradiction: "${from}" and "${to}" are declared disjointWith but also related by "${name}" (directly or transitively).`,
|
|
826
|
-
code: "ONTOLOGY_DISJOINT_CONFLICT"
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
}
|
|
1456
|
+
function validateOntology(ontology, issues) {
|
|
1457
|
+
issues.push(
|
|
1458
|
+
...validateOntologyRelations(ontology).map((issue) => ({
|
|
1459
|
+
path: issue.relationIndex === void 0 ? "/ontology" : `/ontology/${issue.relationIndex}`,
|
|
1460
|
+
message: issue.message,
|
|
1461
|
+
code: issue.code
|
|
1462
|
+
}))
|
|
1463
|
+
);
|
|
831
1464
|
}
|
|
832
1465
|
var INDEX_SCOPE_VALUES = ["graphAndKind", "graph", "none"];
|
|
833
1466
|
var EDGE_INDEX_DIRECTION_VALUES = ["out", "in", "none"];
|
|
@@ -867,7 +1500,7 @@ function validateIndexesSection(rawIndexes, issues, strict) {
|
|
|
867
1500
|
return result;
|
|
868
1501
|
}
|
|
869
1502
|
function validateIndexEntry(raw, path, issues, strict) {
|
|
870
|
-
if (!
|
|
1503
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
871
1504
|
issues.push({
|
|
872
1505
|
path,
|
|
873
1506
|
message: "Index entry must be a plain object.",
|
|
@@ -951,7 +1584,7 @@ function validateIndexEntry(raw, path, issues, strict) {
|
|
|
951
1584
|
strict
|
|
952
1585
|
);
|
|
953
1586
|
if (entity === "node") {
|
|
954
|
-
return
|
|
1587
|
+
return chunkN66HCGCY_cjs.compactUndefined({
|
|
955
1588
|
entity: "node",
|
|
956
1589
|
kind: raw["kind"],
|
|
957
1590
|
name,
|
|
@@ -972,7 +1605,7 @@ function validateIndexEntry(raw, path, issues, strict) {
|
|
|
972
1605
|
);
|
|
973
1606
|
if (!directionResult.ok) return void 0;
|
|
974
1607
|
const direction = directionResult.value;
|
|
975
|
-
return
|
|
1608
|
+
return chunkN66HCGCY_cjs.compactUndefined({
|
|
976
1609
|
entity: "edge",
|
|
977
1610
|
kind: raw["kind"],
|
|
978
1611
|
name,
|
|
@@ -1036,7 +1669,7 @@ function validateStringList(raw, path, issues, options) {
|
|
|
1036
1669
|
}
|
|
1037
1670
|
function validateGraphExtensionIndexWhere(raw, path, issues, strict) {
|
|
1038
1671
|
if (raw === void 0) return void 0;
|
|
1039
|
-
if (!
|
|
1672
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
1040
1673
|
issues.push({
|
|
1041
1674
|
path,
|
|
1042
1675
|
message: "Index `where` must be a plain object.",
|
|
@@ -1075,8 +1708,17 @@ function validateGraphExtensionIndexWhere(raw, path, issues, strict) {
|
|
|
1075
1708
|
op: raw["op"]
|
|
1076
1709
|
});
|
|
1077
1710
|
}
|
|
1711
|
+
function refuseUnstorablePropertyName(propertyName, propertyPath, owner, issues) {
|
|
1712
|
+
if (!chunkLBJKZXDE_cjs.isUnstorablePropertyName(propertyName)) return false;
|
|
1713
|
+
issues.push({
|
|
1714
|
+
path: propertyPath,
|
|
1715
|
+
message: `Property name "${propertyName}" is not allowed for ${owner}: ${chunkLBJKZXDE_cjs.UNSTORABLE_PROPERTY_NAME_REASON}.`,
|
|
1716
|
+
code: "RESERVED_PROPERTY_NAME"
|
|
1717
|
+
});
|
|
1718
|
+
return true;
|
|
1719
|
+
}
|
|
1078
1720
|
function validatePropertiesMap(raw, path, ownerType, ownerName, issues, strict) {
|
|
1079
|
-
if (!
|
|
1721
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
1080
1722
|
issues.push({
|
|
1081
1723
|
path,
|
|
1082
1724
|
message: `\`properties\` must be a plain object.`,
|
|
@@ -1084,10 +1726,18 @@ function validatePropertiesMap(raw, path, ownerType, ownerName, issues, strict)
|
|
|
1084
1726
|
});
|
|
1085
1727
|
return void 0;
|
|
1086
1728
|
}
|
|
1087
|
-
const reserved = ownerType === "node" ?
|
|
1088
|
-
const result =
|
|
1729
|
+
const reserved = ownerType === "node" ? chunkLBJKZXDE_cjs.RESERVED_NODE_KEYS : chunkLBJKZXDE_cjs.RESERVED_EDGE_KEYS;
|
|
1730
|
+
const result = chunkN66HCGCY_cjs.createDataKeyedBag();
|
|
1089
1731
|
for (const [propertyName, propertyValue] of Object.entries(raw)) {
|
|
1090
|
-
const propertyPath = `${path}/${
|
|
1732
|
+
const propertyPath = `${path}/${chunkA7J2YDDI_cjs.encodeJsonPointerSegment(propertyName)}`;
|
|
1733
|
+
if (refuseUnstorablePropertyName(
|
|
1734
|
+
propertyName,
|
|
1735
|
+
propertyPath,
|
|
1736
|
+
`${ownerType} "${ownerName}"`,
|
|
1737
|
+
issues
|
|
1738
|
+
)) {
|
|
1739
|
+
continue;
|
|
1740
|
+
}
|
|
1091
1741
|
if (reserved.has(propertyName)) {
|
|
1092
1742
|
issues.push({
|
|
1093
1743
|
path: propertyPath,
|
|
@@ -1114,10 +1764,10 @@ function validatePropertiesMap(raw, path, ownerType, ownerName, issues, strict)
|
|
|
1114
1764
|
if (validated === void 0) continue;
|
|
1115
1765
|
result[propertyName] = validated;
|
|
1116
1766
|
}
|
|
1117
|
-
return result;
|
|
1767
|
+
return { ...result };
|
|
1118
1768
|
}
|
|
1119
1769
|
function validateProperty(raw, path, depth, issues, strict) {
|
|
1120
|
-
if (!
|
|
1770
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
1121
1771
|
issues.push({
|
|
1122
1772
|
path,
|
|
1123
1773
|
message: "Property descriptor must be a plain object with a `type` field.",
|
|
@@ -1347,7 +1997,7 @@ function validateArrayProperty(raw, path, depth, issues, strict) {
|
|
|
1347
1997
|
});
|
|
1348
1998
|
return void 0;
|
|
1349
1999
|
}
|
|
1350
|
-
if (!
|
|
2000
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(itemsRaw)) {
|
|
1351
2001
|
issues.push({
|
|
1352
2002
|
path: `${path}/items`,
|
|
1353
2003
|
message: "`array.items` must be a plain property descriptor.",
|
|
@@ -1393,7 +2043,7 @@ function validateObjectProperty(raw, path, depth, issues, strict) {
|
|
|
1393
2043
|
return void 0;
|
|
1394
2044
|
}
|
|
1395
2045
|
const propertiesRaw = raw["properties"];
|
|
1396
|
-
if (!
|
|
2046
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(propertiesRaw)) {
|
|
1397
2047
|
issues.push({
|
|
1398
2048
|
path: `${path}/properties`,
|
|
1399
2049
|
message: "`object.properties` must be a plain object.",
|
|
@@ -1410,10 +2060,13 @@ function validateObjectProperty(raw, path, depth, issues, strict) {
|
|
|
1410
2060
|
});
|
|
1411
2061
|
return void 0;
|
|
1412
2062
|
}
|
|
1413
|
-
const fields =
|
|
2063
|
+
const fields = chunkN66HCGCY_cjs.createDataKeyedBag();
|
|
1414
2064
|
for (const [name, value] of propertiesEntries) {
|
|
1415
|
-
const fieldPath = `${path}/properties/${
|
|
1416
|
-
if (
|
|
2065
|
+
const fieldPath = `${path}/properties/${chunkA7J2YDDI_cjs.encodeJsonPointerSegment(name)}`;
|
|
2066
|
+
if (refuseUnstorablePropertyName(name, fieldPath, "a nested object", issues)) {
|
|
2067
|
+
continue;
|
|
2068
|
+
}
|
|
2069
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(value)) {
|
|
1417
2070
|
issues.push({
|
|
1418
2071
|
path: fieldPath,
|
|
1419
2072
|
message: "Object field descriptor must be a plain object.",
|
|
@@ -1438,12 +2091,12 @@ function validateObjectProperty(raw, path, depth, issues, strict) {
|
|
|
1438
2091
|
if (modifiers === void 0) return void 0;
|
|
1439
2092
|
return finalizeProperty(
|
|
1440
2093
|
"object",
|
|
1441
|
-
{ properties: fields },
|
|
2094
|
+
{ properties: { ...fields } },
|
|
1442
2095
|
modifiers
|
|
1443
2096
|
);
|
|
1444
2097
|
}
|
|
1445
2098
|
function finalizeProperty(type, specific, modifiers) {
|
|
1446
|
-
return
|
|
2099
|
+
return chunkN66HCGCY_cjs.compactUndefined({
|
|
1447
2100
|
type,
|
|
1448
2101
|
...specific,
|
|
1449
2102
|
optional: modifiers.optional,
|
|
@@ -1469,7 +2122,7 @@ function validatePropertyModifiers(raw, path, propertyType, issues) {
|
|
|
1469
2122
|
message: `\`searchable\` is only valid on string properties (got "${propertyType}").`,
|
|
1470
2123
|
code: "INVALID_MODIFIER_TARGET"
|
|
1471
2124
|
});
|
|
1472
|
-
} else if (
|
|
2125
|
+
} else if (chunkN66HCGCY_cjs.isPlainObject(raw["searchable"])) {
|
|
1473
2126
|
const searchableRaw = raw["searchable"];
|
|
1474
2127
|
const language = searchableRaw["language"];
|
|
1475
2128
|
if (language === void 0) {
|
|
@@ -1497,14 +2150,14 @@ function validatePropertyModifiers(raw, path, propertyType, issues) {
|
|
|
1497
2150
|
if (raw["embedding"] !== void 0) {
|
|
1498
2151
|
if (propertyType === "array") {
|
|
1499
2152
|
const itemsRaw = raw["items"];
|
|
1500
|
-
const itemType =
|
|
2153
|
+
const itemType = chunkN66HCGCY_cjs.isPlainObject(itemsRaw) ? itemsRaw["type"] : void 0;
|
|
1501
2154
|
if (itemType !== "number") {
|
|
1502
2155
|
issues.push({
|
|
1503
2156
|
path: `${path}/embedding`,
|
|
1504
2157
|
message: '`embedding` requires `array.items.type === "number"`.',
|
|
1505
2158
|
code: "INVALID_MODIFIER_TARGET"
|
|
1506
2159
|
});
|
|
1507
|
-
} else if (
|
|
2160
|
+
} else if (chunkN66HCGCY_cjs.isPlainObject(raw["embedding"])) {
|
|
1508
2161
|
const dim = raw["embedding"]["dimensions"];
|
|
1509
2162
|
if (typeof dim !== "number" || !Number.isInteger(dim) || dim <= 0) {
|
|
1510
2163
|
issues.push({
|
|
@@ -1513,7 +2166,7 @@ function validatePropertyModifiers(raw, path, propertyType, issues) {
|
|
|
1513
2166
|
code: "INVALID_EMBEDDING_DIMENSIONS"
|
|
1514
2167
|
});
|
|
1515
2168
|
} else {
|
|
1516
|
-
const itemsObject =
|
|
2169
|
+
const itemsObject = chunkN66HCGCY_cjs.isPlainObject(itemsRaw) ? itemsRaw : {};
|
|
1517
2170
|
const extraneous = Object.keys(itemsObject).filter(
|
|
1518
2171
|
(key) => key !== "type"
|
|
1519
2172
|
);
|
|
@@ -1555,7 +2208,7 @@ function validatePropertyModifiers(raw, path, propertyType, issues) {
|
|
|
1555
2208
|
}
|
|
1556
2209
|
}
|
|
1557
2210
|
if (issues.length > issuesAtEntry) return void 0;
|
|
1558
|
-
return
|
|
2211
|
+
return chunkN66HCGCY_cjs.compactUndefined({
|
|
1559
2212
|
optional,
|
|
1560
2213
|
searchable,
|
|
1561
2214
|
embedding,
|
|
@@ -1576,7 +2229,7 @@ function validateUniqueConstraints(raw, path, properties, issues, strict) {
|
|
|
1576
2229
|
const names = /* @__PURE__ */ new Set();
|
|
1577
2230
|
for (const [index, entry] of raw.entries()) {
|
|
1578
2231
|
const constraintPath = `${path}/${index}`;
|
|
1579
|
-
if (!
|
|
2232
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(entry)) {
|
|
1580
2233
|
issues.push({
|
|
1581
2234
|
path: constraintPath,
|
|
1582
2235
|
message: "Unique constraint must be a plain object.",
|
|
@@ -1644,7 +2297,7 @@ function validateUniqueConstraints(raw, path, properties, issues, strict) {
|
|
|
1644
2297
|
fieldsValid = false;
|
|
1645
2298
|
break;
|
|
1646
2299
|
}
|
|
1647
|
-
if (!(field
|
|
2300
|
+
if (!chunkN66HCGCY_cjs.hasOwnKey(properties, field)) {
|
|
1648
2301
|
issues.push({
|
|
1649
2302
|
path: `${constraintPath}/fields/${fieldIndex}`,
|
|
1650
2303
|
message: `Unique constraint field "${field}" is not declared on this kind.`,
|
|
@@ -1686,7 +2339,7 @@ function validateUniqueConstraints(raw, path, properties, issues, strict) {
|
|
|
1686
2339
|
);
|
|
1687
2340
|
if (constraint["where"] !== void 0 && where === void 0) continue;
|
|
1688
2341
|
result.push(
|
|
1689
|
-
|
|
2342
|
+
chunkN66HCGCY_cjs.compactUndefined({
|
|
1690
2343
|
name,
|
|
1691
2344
|
fields,
|
|
1692
2345
|
scope,
|
|
@@ -1698,7 +2351,7 @@ function validateUniqueConstraints(raw, path, properties, issues, strict) {
|
|
|
1698
2351
|
return result;
|
|
1699
2352
|
}
|
|
1700
2353
|
function validateUniqueWhere(raw, path, properties, issues, strict) {
|
|
1701
|
-
if (!
|
|
2354
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
1702
2355
|
issues.push({
|
|
1703
2356
|
path,
|
|
1704
2357
|
message: "Unique constraint `where` must be `{ field, op }`.",
|
|
@@ -1726,7 +2379,7 @@ function validateUniqueWhere(raw, path, properties, issues, strict) {
|
|
|
1726
2379
|
});
|
|
1727
2380
|
return void 0;
|
|
1728
2381
|
}
|
|
1729
|
-
if (!(field
|
|
2382
|
+
if (!chunkN66HCGCY_cjs.hasOwnKey(properties, field)) {
|
|
1730
2383
|
issues.push({
|
|
1731
2384
|
path: `${path}/field`,
|
|
1732
2385
|
message: `Unique \`where.field\` "${field}" is not declared on this kind.`,
|
|
@@ -1746,7 +2399,7 @@ function validateUniqueWhere(raw, path, properties, issues, strict) {
|
|
|
1746
2399
|
}
|
|
1747
2400
|
function validateAnnotations(raw, path, ownerLabel, issues) {
|
|
1748
2401
|
if (raw === void 0) return void 0;
|
|
1749
|
-
if (!
|
|
2402
|
+
if (!chunkN66HCGCY_cjs.isPlainObject(raw)) {
|
|
1750
2403
|
issues.push({
|
|
1751
2404
|
path,
|
|
1752
2405
|
message: `Annotations must be a plain JSON object.`,
|
|
@@ -1755,9 +2408,9 @@ function validateAnnotations(raw, path, ownerLabel, issues) {
|
|
|
1755
2408
|
return void 0;
|
|
1756
2409
|
}
|
|
1757
2410
|
try {
|
|
1758
|
-
|
|
2411
|
+
chunkLBJKZXDE_cjs.assertJsonValue(raw, "annotations", ownerLabel);
|
|
1759
2412
|
} catch (error) {
|
|
1760
|
-
if (error instanceof
|
|
2413
|
+
if (error instanceof chunkNI72YOJB_cjs.ConfigurationError) {
|
|
1761
2414
|
const detailPath = error.details["path"];
|
|
1762
2415
|
const annotationPath = typeof detailPath === "string" ? `${path}/${detailPath.replace(/^annotations\.?/, "").replaceAll(".", "/")}` : path;
|
|
1763
2416
|
issues.push({
|
|
@@ -1832,14 +2485,14 @@ function describeUnknownValue(value) {
|
|
|
1832
2485
|
}
|
|
1833
2486
|
function freezeDocument(input) {
|
|
1834
2487
|
return Object.freeze(
|
|
1835
|
-
|
|
2488
|
+
chunkN66HCGCY_cjs.compactUndefined({
|
|
1836
2489
|
version: input.version,
|
|
1837
|
-
nodes: input.nodes === void 0 ? void 0 :
|
|
1838
|
-
edges: input.edges === void 0 ? void 0 :
|
|
2490
|
+
nodes: input.nodes === void 0 ? void 0 : chunkN66HCGCY_cjs.freezeDeep(input.nodes),
|
|
2491
|
+
edges: input.edges === void 0 ? void 0 : chunkN66HCGCY_cjs.freezeDeep(input.edges),
|
|
1839
2492
|
ontology: input.ontology === void 0 ? void 0 : Object.freeze(
|
|
1840
2493
|
input.ontology.map((entry) => Object.freeze({ ...entry }))
|
|
1841
2494
|
),
|
|
1842
|
-
indexes: input.indexes === void 0 ? void 0 : Object.freeze(input.indexes.map((entry) =>
|
|
2495
|
+
indexes: input.indexes === void 0 ? void 0 : Object.freeze(input.indexes.map((entry) => chunkN66HCGCY_cjs.freezeDeep({ ...entry })))
|
|
1843
2496
|
})
|
|
1844
2497
|
);
|
|
1845
2498
|
}
|
|
@@ -1849,22 +2502,29 @@ exports.GRAPH_EXTENSION_ISSUE_CODES = GRAPH_EXTENSION_ISSUE_CODES;
|
|
|
1849
2502
|
exports.GRAPH_EXTENSION_TOP_LEVEL_KEYS = GRAPH_EXTENSION_TOP_LEVEL_KEYS;
|
|
1850
2503
|
exports.GraphExtensionError = GraphExtensionError;
|
|
1851
2504
|
exports.GraphExtensionUnresolvedEndpointError = GraphExtensionUnresolvedEndpointError;
|
|
2505
|
+
exports.GraphExtensionUnresolvedOntologyEndpointError = GraphExtensionUnresolvedOntologyEndpointError;
|
|
1852
2506
|
exports.GraphExtensionValidationError = GraphExtensionValidationError;
|
|
1853
2507
|
exports.GraphExtensionVersionUnsupportedError = GraphExtensionVersionUnsupportedError;
|
|
1854
2508
|
exports.INCOMPATIBLE_CHANGE_TYPES = INCOMPATIBLE_CHANGE_TYPES;
|
|
1855
2509
|
exports.IncompatibleChangeError = IncompatibleChangeError;
|
|
1856
2510
|
exports.KindCollisionError = KindCollisionError;
|
|
1857
2511
|
exports.KindHasReferentsError = KindHasReferentsError;
|
|
2512
|
+
exports.KindRegistry = KindRegistry;
|
|
1858
2513
|
exports.LEGACY_GRAPH_EXTENSION_VERSION = LEGACY_GRAPH_EXTENSION_VERSION;
|
|
1859
2514
|
exports.RemoveCompileTimeKindError = RemoveCompileTimeKindError;
|
|
2515
|
+
exports.computeClosuresFromNamedOntology = computeClosuresFromNamedOntology;
|
|
2516
|
+
exports.computeClosuresFromOntology = computeClosuresFromOntology;
|
|
1860
2517
|
exports.computeTransitiveClosure = computeTransitiveClosure;
|
|
2518
|
+
exports.createEmptyClosures = createEmptyClosures;
|
|
1861
2519
|
exports.err = err;
|
|
1862
2520
|
exports.invertClosure = invertClosure;
|
|
1863
2521
|
exports.isErr = isErr;
|
|
2522
|
+
exports.isExternalIri = isExternalIri;
|
|
1864
2523
|
exports.isOk = isOk;
|
|
1865
2524
|
exports.isReachable = isReachable;
|
|
1866
2525
|
exports.ok = ok;
|
|
1867
2526
|
exports.unwrap = unwrap;
|
|
1868
2527
|
exports.validateGraphExtension = validateGraphExtension;
|
|
1869
|
-
|
|
1870
|
-
//# sourceMappingURL=chunk-
|
|
2528
|
+
exports.validateOntologyRelations = validateOntologyRelations;
|
|
2529
|
+
//# sourceMappingURL=chunk-7BQXPCGN.cjs.map
|
|
2530
|
+
//# sourceMappingURL=chunk-7BQXPCGN.cjs.map
|