@graphty/graph-io 0.3.40 → 0.3.42

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.
Files changed (210) hide show
  1. package/README.md +2 -0
  2. package/dist/chunks/{children-CL3Cy0ez.js → children-CA4coBi0.js} +36 -27
  3. package/dist/chunks/children-CA4coBi0.js.map +1 -0
  4. package/dist/chunks/{choose-CS3fvGT1.js → choose-DvpbdRuz.js} +2 -2
  5. package/dist/chunks/{choose-CS3fvGT1.js.map → choose-DvpbdRuz.js.map} +1 -1
  6. package/dist/chunks/{constants-DqKZT6cH.js → constants-fT3E8JYY.js} +2 -2
  7. package/dist/chunks/{constants-DqKZT6cH.js.map → constants-fT3E8JYY.js.map} +1 -1
  8. package/dist/chunks/{escape-BJRLd3vJ.js → escape-B62ZGM_a.js} +2 -2
  9. package/dist/chunks/{escape-BJRLd3vJ.js.map → escape-B62ZGM_a.js.map} +1 -1
  10. package/dist/chunks/{export-B-aVCwyG.js → export-rKLeGQMo.js} +404 -243
  11. package/dist/chunks/export-rKLeGQMo.js.map +1 -0
  12. package/dist/chunks/{exporter-6ocL_9x_.js → exporter-8hLNemFk.js} +4 -4
  13. package/dist/chunks/{exporter-6ocL_9x_.js.map → exporter-8hLNemFk.js.map} +1 -1
  14. package/dist/chunks/{exporter-BVXnV9-9.js → exporter-BWwEuOPT.js} +29 -17
  15. package/dist/chunks/exporter-BWwEuOPT.js.map +1 -0
  16. package/dist/chunks/{exporter-Bcp-l4Bo.js → exporter-CpRyHZ3H.js} +574 -475
  17. package/dist/chunks/exporter-CpRyHZ3H.js.map +1 -0
  18. package/dist/chunks/{exporter-SFYkDzD0.js → exporter-yLxKBvLE.js} +23 -20
  19. package/dist/chunks/{exporter-SFYkDzD0.js.map → exporter-yLxKBvLE.js.map} +1 -1
  20. package/dist/chunks/{importer-DcKB97kW.js → importer-BbNb7eNg.js} +111 -71
  21. package/dist/chunks/importer-BbNb7eNg.js.map +1 -0
  22. package/dist/chunks/{importer-D_srHyj6.js → importer-C98dpSH4.js} +5 -5
  23. package/dist/chunks/{importer-D_srHyj6.js.map → importer-C98dpSH4.js.map} +1 -1
  24. package/dist/chunks/{importer-BJlGAOht.js → importer-D794XUTe.js} +3 -3
  25. package/dist/chunks/{importer-BJlGAOht.js.map → importer-D794XUTe.js.map} +1 -1
  26. package/dist/chunks/{importer-AjwOJrn2.js → importer-Dz7tI8Sa.js} +202 -181
  27. package/dist/chunks/importer-Dz7tI8Sa.js.map +1 -0
  28. package/dist/chunks/{importer-DEp_fYjf.js → importer-Ht7LNg8L.js} +92 -64
  29. package/dist/chunks/importer-Ht7LNg8L.js.map +1 -0
  30. package/dist/chunks/{importer-CPqnIY8m.js → importer-WrGRZb0N.js} +42 -29
  31. package/dist/chunks/importer-WrGRZb0N.js.map +1 -0
  32. package/dist/chunks/{importer-BpuS3J8C.js → importer-xZ-3suY1.js} +74 -61
  33. package/dist/chunks/importer-xZ-3suY1.js.map +1 -0
  34. package/dist/chunks/{json-elements-DpO6AXIc.js → json-elements-DKSqpNW1.js} +3 -3
  35. package/dist/chunks/{json-elements-DpO6AXIc.js.map → json-elements-DKSqpNW1.js.map} +1 -1
  36. package/dist/chunks/{ontology-export-50L9DOV4.js → ontology-export-CtRXjg_i.js} +2 -2
  37. package/dist/chunks/{ontology-export-50L9DOV4.js.map → ontology-export-CtRXjg_i.js.map} +1 -1
  38. package/dist/chunks/{records-r3SFHz11.js → records-Cu4bxYOm.js} +69 -36
  39. package/dist/chunks/records-Cu4bxYOm.js.map +1 -0
  40. package/dist/chunks/{text-Bjfa1xYL.js → text-DHOJXnED.js} +20 -11
  41. package/dist/chunks/text-DHOJXnED.js.map +1 -0
  42. package/dist/csv.js +323 -241
  43. package/dist/csv.js.map +1 -1
  44. package/dist/cx.js +1 -1
  45. package/dist/cx2.js +2 -2
  46. package/dist/cys.js +1 -1
  47. package/dist/dot.js +1 -1
  48. package/dist/gexf.js +195 -97
  49. package/dist/gexf.js.map +1 -1
  50. package/dist/gml.js +170 -149
  51. package/dist/gml.js.map +1 -1
  52. package/dist/graph-io.js +27 -27
  53. package/dist/graphml.js +2 -2
  54. package/dist/json.js +1 -1
  55. package/dist/neo4j.js +103 -65
  56. package/dist/neo4j.js.map +1 -1
  57. package/dist/obo.js +1 -1
  58. package/dist/pajek.js +1 -1
  59. package/dist/src/children.d.ts.map +1 -1
  60. package/dist/src/children.js +50 -27
  61. package/dist/src/children.js.map +1 -1
  62. package/dist/src/common/attributes.d.ts.map +1 -1
  63. package/dist/src/common/attributes.js +86 -42
  64. package/dist/src/common/attributes.js.map +1 -1
  65. package/dist/src/common/input.d.ts.map +1 -1
  66. package/dist/src/common/input.js +358 -184
  67. package/dist/src/common/input.js.map +1 -1
  68. package/dist/src/common/lists.js +30 -15
  69. package/dist/src/common/lists.js.map +1 -1
  70. package/dist/src/common/text.d.ts +7 -0
  71. package/dist/src/common/text.d.ts.map +1 -1
  72. package/dist/src/common/text.js +15 -7
  73. package/dist/src/common/text.js.map +1 -1
  74. package/dist/src/common/zip.d.ts.map +1 -1
  75. package/dist/src/common/zip.js +36 -19
  76. package/dist/src/common/zip.js.map +1 -1
  77. package/dist/src/formats/csv/exporter.d.ts.map +1 -1
  78. package/dist/src/formats/csv/exporter.js +288 -146
  79. package/dist/src/formats/csv/exporter.js.map +1 -1
  80. package/dist/src/formats/csv/importer.d.ts.map +1 -1
  81. package/dist/src/formats/csv/importer.js +129 -80
  82. package/dist/src/formats/csv/importer.js.map +1 -1
  83. package/dist/src/formats/csv/records.d.ts.map +1 -1
  84. package/dist/src/formats/csv/records.js +78 -36
  85. package/dist/src/formats/csv/records.js.map +1 -1
  86. package/dist/src/formats/cys/tables.d.ts.map +1 -1
  87. package/dist/src/formats/cys/tables.js +11 -8
  88. package/dist/src/formats/cys/tables.js.map +1 -1
  89. package/dist/src/formats/dot/tokenizer.d.ts +39 -0
  90. package/dist/src/formats/dot/tokenizer.d.ts.map +1 -1
  91. package/dist/src/formats/dot/tokenizer.js +112 -66
  92. package/dist/src/formats/dot/tokenizer.js.map +1 -1
  93. package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
  94. package/dist/src/formats/gexf/exporter.js +65 -37
  95. package/dist/src/formats/gexf/exporter.js.map +1 -1
  96. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  97. package/dist/src/formats/gexf/importer.js +138 -50
  98. package/dist/src/formats/gexf/importer.js.map +1 -1
  99. package/dist/src/formats/gml/exporter.d.ts.map +1 -1
  100. package/dist/src/formats/gml/exporter.js +51 -35
  101. package/dist/src/formats/gml/exporter.js.map +1 -1
  102. package/dist/src/formats/gml/importer.d.ts.map +1 -1
  103. package/dist/src/formats/gml/importer.js +103 -58
  104. package/dist/src/formats/gml/importer.js.map +1 -1
  105. package/dist/src/formats/gml/syntax.d.ts.map +1 -1
  106. package/dist/src/formats/gml/syntax.js +17 -8
  107. package/dist/src/formats/gml/syntax.js.map +1 -1
  108. package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
  109. package/dist/src/formats/graphml/exporter.js +34 -24
  110. package/dist/src/formats/graphml/exporter.js.map +1 -1
  111. package/dist/src/formats/graphml/importer.d.ts.map +1 -1
  112. package/dist/src/formats/graphml/importer.js +17 -13
  113. package/dist/src/formats/graphml/importer.js.map +1 -1
  114. package/dist/src/formats/graphml/tree.js +23 -14
  115. package/dist/src/formats/graphml/tree.js.map +1 -1
  116. package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
  117. package/dist/src/formats/graphml/yfiles.js +22 -10
  118. package/dist/src/formats/graphml/yfiles.js.map +1 -1
  119. package/dist/src/formats/json/dialect.d.ts.map +1 -1
  120. package/dist/src/formats/json/dialect.js +54 -20
  121. package/dist/src/formats/json/dialect.js.map +1 -1
  122. package/dist/src/formats/json/exporter.d.ts.map +1 -1
  123. package/dist/src/formats/json/exporter.js +38 -21
  124. package/dist/src/formats/json/exporter.js.map +1 -1
  125. package/dist/src/formats/json/importer.d.ts.map +1 -1
  126. package/dist/src/formats/json/importer.js +536 -343
  127. package/dist/src/formats/json/importer.js.map +1 -1
  128. package/dist/src/formats/json/obographs.js +29 -17
  129. package/dist/src/formats/json/obographs.js.map +1 -1
  130. package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
  131. package/dist/src/formats/neo4j/exporter.js +73 -43
  132. package/dist/src/formats/neo4j/exporter.js.map +1 -1
  133. package/dist/src/formats/neo4j/header.d.ts.map +1 -1
  134. package/dist/src/formats/neo4j/header.js +37 -16
  135. package/dist/src/formats/neo4j/header.js.map +1 -1
  136. package/dist/src/formats/neo4j/importer.d.ts.map +1 -1
  137. package/dist/src/formats/neo4j/importer.js +21 -11
  138. package/dist/src/formats/neo4j/importer.js.map +1 -1
  139. package/dist/src/formats/obo/exporter.d.ts.map +1 -1
  140. package/dist/src/formats/obo/exporter.js +18 -7
  141. package/dist/src/formats/obo/exporter.js.map +1 -1
  142. package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
  143. package/dist/src/formats/pajek/exporter.js +142 -73
  144. package/dist/src/formats/pajek/exporter.js.map +1 -1
  145. package/dist/src/formats/pajek/importer.d.ts.map +1 -1
  146. package/dist/src/formats/pajek/importer.js +26 -15
  147. package/dist/src/formats/pajek/importer.js.map +1 -1
  148. package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
  149. package/dist/src/formats/pajek/syntax.js +85 -58
  150. package/dist/src/formats/pajek/syntax.js.map +1 -1
  151. package/dist/src/formats/xgmml/emit.d.ts +7 -0
  152. package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
  153. package/dist/src/formats/xgmml/emit.js +79 -40
  154. package/dist/src/formats/xgmml/emit.js.map +1 -1
  155. package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
  156. package/dist/src/formats/xgmml/exporter.js +38 -12
  157. package/dist/src/formats/xgmml/exporter.js.map +1 -1
  158. package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
  159. package/dist/src/formats/xgmml/importer.js +38 -18
  160. package/dist/src/formats/xgmml/importer.js.map +1 -1
  161. package/dist/src/sniff.js +109 -57
  162. package/dist/src/sniff.js.map +1 -1
  163. package/dist/xgmml.js +2 -2
  164. package/package.json +2 -2
  165. package/src/children.ts +54 -27
  166. package/src/common/attributes.ts +118 -49
  167. package/src/common/input.ts +439 -197
  168. package/src/common/lists.ts +29 -15
  169. package/src/common/text.ts +24 -15
  170. package/src/common/zip.ts +47 -18
  171. package/src/formats/csv/exporter.ts +377 -175
  172. package/src/formats/csv/importer.ts +155 -84
  173. package/src/formats/csv/records.ts +90 -35
  174. package/src/formats/cys/tables.ts +11 -10
  175. package/src/formats/dot/tokenizer.ts +118 -68
  176. package/src/formats/gexf/exporter.ts +67 -36
  177. package/src/formats/gexf/importer.ts +173 -63
  178. package/src/formats/gml/exporter.ts +78 -82
  179. package/src/formats/gml/importer.ts +119 -68
  180. package/src/formats/gml/syntax.ts +18 -8
  181. package/src/formats/graphml/exporter.ts +44 -24
  182. package/src/formats/graphml/importer.ts +18 -11
  183. package/src/formats/graphml/tree.ts +22 -12
  184. package/src/formats/graphml/yfiles.ts +23 -10
  185. package/src/formats/json/dialect.ts +61 -22
  186. package/src/formats/json/exporter.ts +40 -21
  187. package/src/formats/json/importer.ts +701 -385
  188. package/src/formats/json/obographs.ts +35 -15
  189. package/src/formats/neo4j/exporter.ts +79 -41
  190. package/src/formats/neo4j/header.ts +50 -16
  191. package/src/formats/neo4j/importer.ts +21 -10
  192. package/src/formats/obo/exporter.ts +34 -17
  193. package/src/formats/pajek/exporter.ts +180 -117
  194. package/src/formats/pajek/importer.ts +27 -15
  195. package/src/formats/pajek/syntax.ts +99 -58
  196. package/src/formats/xgmml/emit.ts +88 -40
  197. package/src/formats/xgmml/exporter.ts +40 -12
  198. package/src/formats/xgmml/importer.ts +45 -23
  199. package/src/sniff.ts +115 -59
  200. package/dist/chunks/children-CL3Cy0ez.js.map +0 -1
  201. package/dist/chunks/export-B-aVCwyG.js.map +0 -1
  202. package/dist/chunks/exporter-BVXnV9-9.js.map +0 -1
  203. package/dist/chunks/exporter-Bcp-l4Bo.js.map +0 -1
  204. package/dist/chunks/importer-AjwOJrn2.js.map +0 -1
  205. package/dist/chunks/importer-BpuS3J8C.js.map +0 -1
  206. package/dist/chunks/importer-CPqnIY8m.js.map +0 -1
  207. package/dist/chunks/importer-DEp_fYjf.js.map +0 -1
  208. package/dist/chunks/importer-DcKB97kW.js.map +0 -1
  209. package/dist/chunks/records-r3SFHz11.js.map +0 -1
  210. package/dist/chunks/text-Bjfa1xYL.js.map +0 -1
package/dist/graph-io.js CHANGED
@@ -1,42 +1,42 @@
1
1
  import { INVALID_INDEX, GraphFormatError, GraphBuilder } from "@graphty/graph-format";
2
2
  import { GraphBuilder as GraphBuilder2, GraphFormatError as GraphFormatError2, INVALID_INDEX as INVALID_INDEX2 } from "@graphty/graph-format";
3
- import { al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, ar as IdCoercer, aq as DirectionResolver, az as LineReader, am as throwIfAborted, aK as parseWeightText, aL as isAbortError, aM as BAD_LINE_CODE, aN as messageOf, aO as describe, b as plural, aP as UNKNOWN_OPTION_CODE, a7 as chooseGraph, aQ as normalizeInput, aR as foreignKind, E as EMPTY_INPUT_CODE, aS as ImportError, aT as FETCH_CODE, $ as agree, aU as EDGES_MERGED_CODE, aV as SELF_LOOPS_DROPPED_CODE, O as OPTION_IGNORED_CODE, aW as WEIGHT_NOT_FOUND_CODE, aX as lockReader, aY as abortable } from "./chunks/export-B-aVCwyG.js";
4
- import { ae, Y, V, B, aZ, a3, at, a_, C, a$, A, b0, k, j, i, b1, b2, b3, D, d, o, b4, m, u, n, F, b5, v, x, b6, b7, aB, af, H, I, b8, J, G, b9, y, z, ba, a2, L, s, t, M, l, W, T, bb, bc, aA, bd, be, N, bf, bg, Q, ai, bh, P, aD, ay, au, K, R, bi, ag, S, Z, _, bj, f, ah, ak, bk, bl, bm, ad, aC, U, g, w, q, bn, h, bo, bp, aj, ax, X, aH, c, a, bq, aI, br, a1, bs, bt, e, bu, aF, aa, ab, bv, aG, ap, bw, bx, by, bz, aJ, bA, p, bB, bC, r, aE, a4 } from "./chunks/export-B-aVCwyG.js";
5
- import { T as TextCellWriter } from "./chunks/text-Bjfa1xYL.js";
6
- import { W as W2, i as i2, a as a5, p as p2 } from "./chunks/text-Bjfa1xYL.js";
7
- import { C as C2, c as c2, a as a6 } from "./chunks/children-CL3Cy0ez.js";
3
+ import { al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, ar as IdCoercer, aq as DirectionResolver, az as LineReader, am as throwIfAborted, aK as parseWeightText, aL as isAbortError, aM as BAD_LINE_CODE, aN as messageOf, aO as describe, b as plural, aP as UNKNOWN_OPTION_CODE, a7 as chooseGraph, aQ as normalizeInput, aR as foreignKind, E as EMPTY_INPUT_CODE, aS as ImportError, aT as FETCH_CODE, $ as agree, aU as EDGES_MERGED_CODE, aV as SELF_LOOPS_DROPPED_CODE, O as OPTION_IGNORED_CODE, aW as WEIGHT_NOT_FOUND_CODE, aX as lockReader, aY as abortable } from "./chunks/export-rKLeGQMo.js";
4
+ import { ae, Y, V, B, aZ, a3, at, a_, C, a$, A, b0, k, j, i, b1, b2, b3, D, d, o, b4, m, u, n, F, b5, v, x, b6, b7, aB, af, H, I, b8, J, G, b9, y, z, ba, a2, L, s, t, M, l, W, T, bb, bc, aA, bd, be, N, bf, bg, Q, ai, bh, P, aD, ay, au, K, R, bi, ag, S, Z, _, bj, f, ah, ak, bk, bl, bm, ad, aC, U, g, w, q, bn, h, bo, bp, aj, ax, X, aH, c, a, bq, aI, br, a1, bs, bt, e, bu, aF, aa, ab, bv, aG, ap, bw, bx, by, bz, aJ, bA, p, bB, bC, r, aE, a4 } from "./chunks/export-rKLeGQMo.js";
5
+ import { T as TextCellWriter } from "./chunks/text-DHOJXnED.js";
6
+ import { W as W2, i as i2, a as a5, p as p2 } from "./chunks/text-DHOJXnED.js";
7
+ import { C as C2, c as c2, a as a6 } from "./chunks/children-CA4coBi0.js";
8
8
  import { c as collectBytes } from "./chunks/writer-DxjgHwSe.js";
9
9
  import { D as D2, d as d2, e as e2, j as j2, t as t2 } from "./chunks/writer-DxjgHwSe.js";
10
10
  import { csvImporter, csvExporter } from "./csv.js";
11
11
  import { CSV_CAPABILITIES, CSV_ISSUE, CSV_LOSS } from "./csv.js";
12
- import { d as cxImporter, c as cxExporter } from "./chunks/importer-D_srHyj6.js";
13
- import { C as C3, a as a7, b } from "./chunks/importer-D_srHyj6.js";
14
- import { c as cx2Exporter } from "./chunks/exporter-6ocL_9x_.js";
15
- import { C as C4, a as a8 } from "./chunks/exporter-6ocL_9x_.js";
16
- import { c as cx2Importer } from "./chunks/importer-BJlGAOht.js";
17
- import { C as C5 } from "./chunks/importer-BJlGAOht.js";
18
- import { d as cysImporter, c as cysExporter } from "./chunks/importer-CPqnIY8m.js";
19
- import { C as C6, a as a9, b as b10 } from "./chunks/importer-CPqnIY8m.js";
20
- import { b as dotImporter, d as dotExporter } from "./chunks/importer-DcKB97kW.js";
21
- import { D as D3, a as a10 } from "./chunks/importer-DcKB97kW.js";
12
+ import { d as cxImporter, c as cxExporter } from "./chunks/importer-C98dpSH4.js";
13
+ import { C as C3, a as a7, b } from "./chunks/importer-C98dpSH4.js";
14
+ import { c as cx2Exporter } from "./chunks/exporter-8hLNemFk.js";
15
+ import { C as C4, a as a8 } from "./chunks/exporter-8hLNemFk.js";
16
+ import { c as cx2Importer } from "./chunks/importer-D794XUTe.js";
17
+ import { C as C5 } from "./chunks/importer-D794XUTe.js";
18
+ import { d as cysImporter, c as cysExporter } from "./chunks/importer-WrGRZb0N.js";
19
+ import { C as C6, a as a9, b as b10 } from "./chunks/importer-WrGRZb0N.js";
20
+ import { b as dotImporter, d as dotExporter } from "./chunks/importer-BbNb7eNg.js";
21
+ import { D as D3, a as a10 } from "./chunks/importer-BbNb7eNg.js";
22
22
  import { gexfImporter, gexfExporter } from "./gexf.js";
23
23
  import { GEXF_1_2_CAPABILITIES, GEXF_ISSUE, GEXF_LOSS } from "./gexf.js";
24
24
  import { gmlImporter, gmlExporter } from "./gml.js";
25
25
  import { GML_ISSUE, GML_LOSS } from "./gml.js";
26
- import { a as graphmlImporter, g as graphmlExporter } from "./chunks/importer-BpuS3J8C.js";
27
- import { r as rankFormats, S as SNIFF_HEAD_BYTES, e as jsonImporter, c as jsonExporter } from "./chunks/exporter-Bcp-l4Bo.js";
28
- import { G as G2, J as J2, a as a11, b as b11, d as d3, g as g2, h as h2, j as j3, f as f2, n as n2, s as s2, i as i3 } from "./chunks/exporter-Bcp-l4Bo.js";
26
+ import { a as graphmlImporter, g as graphmlExporter } from "./chunks/importer-xZ-3suY1.js";
27
+ import { r as rankFormats, S as SNIFF_HEAD_BYTES, e as jsonImporter, c as jsonExporter } from "./chunks/exporter-CpRyHZ3H.js";
28
+ import { G as G2, J as J2, a as a11, b as b11, d as d3, g as g2, h as h2, j as j3, f as f2, n as n2, s as s2, i as i3 } from "./chunks/exporter-CpRyHZ3H.js";
29
29
  import { neo4jImporter, neo4jExporter } from "./neo4j.js";
30
30
  import { ID_SPACE_COLUMN, LABELS_COLUMN, NEO4J_CAPABILITIES, NEO4J_ISSUE, NEO4J_LOSS, ORIGINAL_ID_COLUMN, TYPE_COLUMN, exportNeo4jFiles } from "./neo4j.js";
31
- import { c as oboImporter, o as oboExporter } from "./chunks/exporter-SFYkDzD0.js";
32
- import { O, a as a12, b as b12 } from "./chunks/exporter-SFYkDzD0.js";
33
- import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-AjwOJrn2.js";
34
- import { P as P2, a as a13 } from "./chunks/importer-AjwOJrn2.js";
35
- import { x as xgmmlExporter } from "./chunks/exporter-BVXnV9-9.js";
36
- import { x as xgmmlImporter } from "./chunks/importer-DEp_fYjf.js";
37
- import { X as X2, a as a14 } from "./chunks/importer-DEp_fYjf.js";
38
- import { G as G3, a as a15 } from "./chunks/constants-DqKZT6cH.js";
39
- import { X as X3, b as b13, h as h3, t as t3, x as x2 } from "./chunks/escape-BJRLd3vJ.js";
31
+ import { c as oboImporter, o as oboExporter } from "./chunks/exporter-yLxKBvLE.js";
32
+ import { O, a as a12, b as b12 } from "./chunks/exporter-yLxKBvLE.js";
33
+ import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-Dz7tI8Sa.js";
34
+ import { P as P2, a as a13 } from "./chunks/importer-Dz7tI8Sa.js";
35
+ import { x as xgmmlExporter } from "./chunks/exporter-BWwEuOPT.js";
36
+ import { x as xgmmlImporter } from "./chunks/importer-Ht7LNg8L.js";
37
+ import { X as X2, a as a14 } from "./chunks/importer-Ht7LNg8L.js";
38
+ import { G as G3, a as a15 } from "./chunks/constants-fT3E8JYY.js";
39
+ import { X as X3, b as b13, h as h3, t as t3, x as x2 } from "./chunks/escape-B62ZGM_a.js";
40
40
  const USED = /* @__PURE__ */ new Set(["ids", "defaultDirected", "weightFrom", "addMissingNodes"]);
41
41
  function defineLineFormat(definition) {
42
42
  const { format, extensions, mimeTypes = [], directed = false, comment = "#", sniff: sniff2, parseLine } = definition;
package/dist/graphml.js CHANGED
@@ -1,5 +1,5 @@
1
- import { G, a } from "./chunks/constants-DqKZT6cH.js";
2
- import { g, a as a2 } from "./chunks/importer-BpuS3J8C.js";
1
+ import { G, a } from "./chunks/constants-fT3E8JYY.js";
2
+ import { g, a as a2 } from "./chunks/importer-xZ-3suY1.js";
3
3
  export {
4
4
  G as GRAPHML_ISSUE,
5
5
  a as GRAPHML_LOSS,
package/dist/json.js CHANGED
@@ -1,4 +1,4 @@
1
- import { J, a, b, d, j, c, e, f } from "./chunks/exporter-Bcp-l4Bo.js";
1
+ import { J, a, b, d, j, c, e, f } from "./chunks/exporter-CpRyHZ3H.js";
2
2
  export {
3
3
  J as JSON_DIALECTS,
4
4
  a as JSON_ISSUE,
package/dist/neo4j.js CHANGED
@@ -1,7 +1,7 @@
1
- import { i as DANGLING_REFERENCE_CODE$1, R as ROLE_TAKEN_CODE$1, I as ID_MERGED_CODE$1, n as DUPLICATE_NODE_CODE$1, s as MISSING_ENDPOINT_CODE$1, t as MISSING_ID_CODE$1, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, am as throwIfAborted, ar as IdCoercer, aq as DirectionResolver, b as plural, $ as agree, aS as ImportError, bH as declareAttribute, bX as declareOn, a0 as uniqueColumnName, ay as RENAMED_CODE, aK as parseWeightText, bJ as parseDeclaredTemporal, bK as parseDeclaredValue, bL as losesPrecision, br as declareCompanion, P as PRECISION_CODE, bN as splitListText, by as isImportInput, bW as takenIn, bw as inputLength, bY as parseTemporal, bZ as withArticle, c as capabilities, b8 as ID_TEXT_COLLISION_CODE, J as ID_TEXT_TYPE_CODE, r as resolveExportOptions, a as checkCapabilities, p as pairFolding, L as LOSS, bR as mapDeclaredType, e as explicitWeights, bx as isCanonicalIntegerText, bT as formatTemporal, ab as formatF64, aa as formatF32, aG as formatInteger, S as SINK_OPTION_CODE, O as OPTION_IGNORED_CODE, C as COLUMN_RENAMED_CODE, U as UNKNOWN_ATTR_TYPE_CODE, w as UNKNOWN_ENCODING_CODE, x as ENCODING_FALLBACK_CODE, y as INVALID_ENCODING_CODE, z as INVALID_UTF8_CODE, A as COLUMN_TYPE_CODE, F as ELEMENT_ISSUE, G as INPUT_ISSUE, bp as WEIGHT_KEY_CLASH_CODE, K as ROLE_DROPPED_CODE, bc as MUTUAL_EXPANDED_CODE } from "./chunks/export-B-aVCwyG.js";
2
- import { c as checkRecordSyntax, R as RecordReader, B as BAD_QUOTE_CODE, U as UNCLOSED_QUOTE_CODE } from "./chunks/records-r3SFHz11.js";
1
+ import { i as DANGLING_REFERENCE_CODE$1, R as ROLE_TAKEN_CODE$1, I as ID_MERGED_CODE$1, n as DUPLICATE_NODE_CODE$1, s as MISSING_ENDPOINT_CODE$1, t as MISSING_ID_CODE$1, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, am as throwIfAborted, ar as IdCoercer, aq as DirectionResolver, b as plural, $ as agree, aS as ImportError, bH as declareAttribute, bX as declareOn, a0 as uniqueColumnName, ay as RENAMED_CODE, aK as parseWeightText, bL as losesPrecision, bJ as parseDeclaredTemporal, bK as parseDeclaredValue, br as declareCompanion, P as PRECISION_CODE, bN as splitListText, by as isImportInput, bW as takenIn, bw as inputLength, bY as parseTemporal, bZ as withArticle, c as capabilities, b8 as ID_TEXT_COLLISION_CODE, J as ID_TEXT_TYPE_CODE, r as resolveExportOptions, a as checkCapabilities, p as pairFolding, L as LOSS, bR as mapDeclaredType, e as explicitWeights, bx as isCanonicalIntegerText, aG as formatInteger, bT as formatTemporal, ab as formatF64, aa as formatF32, S as SINK_OPTION_CODE, O as OPTION_IGNORED_CODE, C as COLUMN_RENAMED_CODE, U as UNKNOWN_ATTR_TYPE_CODE, w as UNKNOWN_ENCODING_CODE, x as ENCODING_FALLBACK_CODE, y as INVALID_ENCODING_CODE, z as INVALID_UTF8_CODE, A as COLUMN_TYPE_CODE, F as ELEMENT_ISSUE, G as INPUT_ISSUE, bp as WEIGHT_KEY_CLASH_CODE, K as ROLE_DROPPED_CODE, bc as MUTUAL_EXPANDED_CODE } from "./chunks/export-rKLeGQMo.js";
2
+ import { c as checkRecordSyntax, R as RecordReader, B as BAD_QUOTE_CODE, U as UNCLOSED_QUOTE_CODE } from "./chunks/records-Cu4bxYOm.js";
3
3
  import { GraphFormatError, INVALID_INDEX } from "@graphty/graph-format";
4
- import { o as quoteCsvCell } from "./chunks/escape-BJRLd3vJ.js";
4
+ import { o as quoteCsvCell } from "./chunks/escape-B62ZGM_a.js";
5
5
  import { j as joinText, e as encodeChunks } from "./chunks/writer-DxjgHwSe.js";
6
6
  const STRUCTURAL = /* @__PURE__ */ new Set(["ID", "LABEL", "START_ID", "END_ID", "TYPE", "IGNORE"]);
7
7
  const SPACE_KINDS = /* @__PURE__ */ new Set(["ID", "START_ID", "END_ID"]);
@@ -44,27 +44,14 @@ function parseHeaderField(text) {
44
44
  const space = m[3] === void 0 ? null : m[3].trim();
45
45
  const options = parseOptions(text, m[4]);
46
46
  if (rawType === null) {
47
- if (name.length === 0) {
48
- throw headerError$1(text, "an empty header cell");
49
- }
50
- if (space !== null || options.size > 0) {
51
- throw headerError$1(text, "an id space or options need a field type");
52
- }
53
- return { text, name, kind: "PROPERTY", type: null, space: null, options };
47
+ return untypedField(text, name, space, options);
54
48
  }
55
49
  if (rawType.length === 0) {
56
50
  throw headerError$1(text, "an empty field type");
57
51
  }
58
52
  const upper = rawType.toUpperCase();
59
53
  if (STRUCTURAL.has(upper)) {
60
- const kind = upper;
61
- if (space !== null && !SPACE_KINDS.has(kind)) {
62
- throw headerError$1(text, `an id space is only allowed on ID, START_ID and END_ID, not ${kind}`);
63
- }
64
- if (name.length > 0 && kind !== "ID" && kind !== "IGNORE") {
65
- throw headerError$1(text, `a ${kind} field cannot be stored as a property`);
66
- }
67
- return { text, name, kind, type: null, space: space === "" ? null : space, options };
54
+ return structuralField(text, name, upper, space, options);
68
55
  }
69
56
  if (name.length === 0) {
70
57
  throw headerError$1(text, "a property column needs a name");
@@ -74,6 +61,24 @@ function parseHeaderField(text) {
74
61
  }
75
62
  return { text, name, kind: "PROPERTY", type: rawType, space: null, options };
76
63
  }
64
+ function untypedField(text, name, space, options) {
65
+ if (name.length === 0) {
66
+ throw headerError$1(text, "an empty header cell");
67
+ }
68
+ if (space !== null || options.size > 0) {
69
+ throw headerError$1(text, "an id space or options need a field type");
70
+ }
71
+ return { text, name, kind: "PROPERTY", type: null, space: null, options };
72
+ }
73
+ function structuralField(text, name, kind, space, options) {
74
+ if (space !== null && !SPACE_KINDS.has(kind)) {
75
+ throw headerError$1(text, `an id space is only allowed on ID, START_ID and END_ID, not ${kind}`);
76
+ }
77
+ if (name.length > 0 && kind !== "ID" && kind !== "IGNORE") {
78
+ throw headerError$1(text, `a ${kind} field cannot be stored as a property`);
79
+ }
80
+ return { text, name, kind, type: null, space: space === "" ? null : space, options };
81
+ }
77
82
  function parseOptions(text, body) {
78
83
  const options = /* @__PURE__ */ new Map();
79
84
  if (body === void 0 || body.trim().length === 0) {
@@ -1048,15 +1053,7 @@ class Neo4jImportSession {
1048
1053
  }
1049
1054
  const { spec } = slot;
1050
1055
  try {
1051
- if (spec.temporal !== null && !spec.list) {
1052
- const zoned = withZoneOffset(text, spec);
1053
- const parsed = parseDeclaredTemporal(zoned, spec);
1054
- values[slot.cell] = parsed.value;
1055
- texts[slot.cell] = zoned === text ? parsed.text : text;
1056
- } else {
1057
- values[slot.cell] = parseDeclaredValue(text, spec, this.options.listSyntax);
1058
- checkNeo4jRange(spec, values[slot.cell], text);
1059
- }
1056
+ this.parseCell(slot, text);
1060
1057
  } catch (err) {
1061
1058
  this.report.recordError(err, { line, element: `${element} ${slot.name}` });
1062
1059
  return false;
@@ -1070,6 +1067,24 @@ class Neo4jImportSession {
1070
1067
  }
1071
1068
  return true;
1072
1069
  }
1070
+ /**
1071
+ * Parse one non-empty property cell into the scratch arrays; throws on a malformed value.
1072
+ * @param slot - the cell's property slot
1073
+ * @param text - the cell text
1074
+ */
1075
+ parseCell(slot, text) {
1076
+ const { values, texts } = this;
1077
+ const { spec } = slot;
1078
+ if (spec.temporal !== null && !spec.list) {
1079
+ const zoned = withZoneOffset(text, spec);
1080
+ const parsed = parseDeclaredTemporal(zoned, spec);
1081
+ values[slot.cell] = parsed.value;
1082
+ texts[slot.cell] = zoned === text ? parsed.text : text;
1083
+ } else {
1084
+ values[slot.cell] = parseDeclaredValue(text, spec, this.options.listSyntax);
1085
+ checkNeo4jRange(spec, values[slot.cell], text);
1086
+ }
1087
+ }
1073
1088
  /**
1074
1089
  * Write the parsed property values of a row.
1075
1090
  * @param domain - node or edge
@@ -1487,6 +1502,16 @@ class ExportPlan {
1487
1502
  this.checkStoredIds();
1488
1503
  this.directionNotes();
1489
1504
  const slots = new Set([this.kind, this.labels, this.idSpace].flatMap((c) => c === null ? [] : [c.meta.name]));
1505
+ this.addGenericNotes(generic, slots);
1506
+ this.notes.push(...this.ownNotes);
1507
+ this.filterNotesByPart();
1508
+ }
1509
+ /**
1510
+ * Add the generic capability notes, leaving out the ones this format reads back as they were.
1511
+ * @param generic - the notes the capability check found
1512
+ * @param slots - the names of the :TYPE, :LABEL and :ID(Space) columns
1513
+ */
1514
+ addGenericNotes(generic, slots) {
1490
1515
  for (const gen of generic) {
1491
1516
  if (gen.code === LOSS.JSON && gen.column !== null && this.writtenAsPoint(gen.column)) {
1492
1517
  continue;
@@ -1510,8 +1535,6 @@ class ExportPlan {
1510
1535
  }
1511
1536
  this.notes.push(gen);
1512
1537
  }
1513
- this.notes.push(...this.ownNotes);
1514
- this.filterNotesByPart();
1515
1538
  }
1516
1539
  /**
1517
1540
  * The direction notes: an undirected snapshot writes every edge as a directed relationship;
@@ -1688,22 +1711,7 @@ class ExportPlan {
1688
1711
  * @returns the scalar plan
1689
1712
  */
1690
1713
  integralOrDouble(column, declared, label) {
1691
- let integral = true;
1692
- if (column.dtype === "f64") {
1693
- for (let r = 0; r < column.length && integral; r++) {
1694
- if (column.isSet(r) && !Number.isInteger(column.data[r])) {
1695
- integral = false;
1696
- }
1697
- }
1698
- } else if (column.dtype === "list" && column.child.dtype === "f64") {
1699
- const { data } = column.child;
1700
- for (let i = 0; i < data.length && integral; i++) {
1701
- if (!Number.isInteger(data[i])) {
1702
- integral = false;
1703
- }
1704
- }
1705
- }
1706
- if (integral) {
1714
+ if (holdsOnlyIntegers(column)) {
1707
1715
  return { type: declared, kind: "integer", temporal: null };
1708
1716
  }
1709
1717
  this.note(
@@ -2230,22 +2238,32 @@ class ExportPlan {
2230
2238
  return null;
2231
2239
  }
2232
2240
  if (plan2.list) {
2233
- const items = column.dtype === "list" ? column.sliceOf(row) : column.value(row);
2234
- const texts = [];
2235
- for (const item of Array.from(items)) {
2236
- if (Array.isArray(item) || ArrayBuffer.isView(item)) {
2237
- for (const component of Array.from(item)) {
2238
- texts.push(formatScalar(component, scalar, null));
2239
- }
2240
- } else {
2241
- texts.push(formatScalar(item, scalar, null));
2242
- }
2243
- }
2244
- return texts.join(this.options.arrayDelimiter);
2241
+ return this.listText(plan2, row);
2245
2242
  }
2246
2243
  const text = companion?.isSet(row) ? textOf(companion, row) : null;
2247
2244
  return formatScalar(column.dtype === "json" ? column.values[row] : column.value(row), scalar, text);
2248
2245
  }
2246
+ /**
2247
+ * The text of one list cell: its items joined by the array delimiter.
2248
+ * @param plan - the column plan
2249
+ * @param row - the row, which is set
2250
+ * @returns the text
2251
+ */
2252
+ listText(plan2, row) {
2253
+ const { column, scalar } = plan2;
2254
+ const items = column.dtype === "list" ? column.sliceOf(row) : column.value(row);
2255
+ const texts = [];
2256
+ for (const item of Array.from(items)) {
2257
+ if (Array.isArray(item) || ArrayBuffer.isView(item)) {
2258
+ for (const component of Array.from(item)) {
2259
+ texts.push(formatScalar(component, scalar, null));
2260
+ }
2261
+ } else {
2262
+ texts.push(formatScalar(item, scalar, null));
2263
+ }
2264
+ }
2265
+ return texts.join(this.options.arrayDelimiter);
2266
+ }
2249
2267
  }
2250
2268
  function isIdText(meta) {
2251
2269
  return meta.role === null && meta.dtype === "string" && meta.origin !== null && meta.origin.format === NEO4J && meta.origin.id === ":ID" && meta.origin.type === null;
@@ -2312,23 +2330,26 @@ function defaultScalar(dtype) {
2312
2330
  }
2313
2331
  }
2314
2332
  }
2333
+ function numberOrString(value, format) {
2334
+ return typeof value === "number" ? format(value) : String(value);
2335
+ }
2315
2336
  function formatScalar(value, scalar, text) {
2316
2337
  switch (scalar.kind) {
2317
2338
  case "integer":
2318
- return typeof value === "number" ? formatInteger(value) : String(value);
2339
+ return numberOrString(value, formatInteger);
2319
2340
  case "float":
2320
- return typeof value === "number" ? formatF32(value) : String(value);
2341
+ return numberOrString(value, formatF32);
2321
2342
  case "double":
2322
- return typeof value === "number" ? formatF64(value) : String(value);
2343
+ return numberOrString(value, formatF64);
2323
2344
  case "boolean":
2324
2345
  return value === true ? "true" : "false";
2325
2346
  case "string":
2326
- return typeof value === "string" ? value : String(value);
2347
+ return String(value);
2327
2348
  case "temporal":
2328
- if (text !== null) {
2329
- return text;
2330
- }
2331
- return typeof value === "number" && scalar.temporal !== null ? formatTemporal(value, scalar.temporal) : String(value);
2349
+ return text ?? numberOrString(
2350
+ value,
2351
+ (n) => scalar.temporal === null ? String(n) : formatTemporal(n, scalar.temporal)
2352
+ );
2332
2353
  case "point":
2333
2354
  return formatPoint(value);
2334
2355
  case "json":
@@ -2434,6 +2455,23 @@ function weightPropertyOf(snapshot) {
2434
2455
  const name = neo4j?.weightProperty;
2435
2456
  return typeof name === "string" && name !== "" ? name : null;
2436
2457
  }
2458
+ function holdsOnlyIntegers(column) {
2459
+ if (column.dtype === "f64") {
2460
+ for (let r = 0; r < column.length; r++) {
2461
+ if (column.isSet(r) && !Number.isInteger(column.data[r])) {
2462
+ return false;
2463
+ }
2464
+ }
2465
+ } else if (column.dtype === "list" && column.child.dtype === "f64") {
2466
+ const { data } = column.child;
2467
+ for (let i = 0; i < data.length; i++) {
2468
+ if (!Number.isInteger(data[i])) {
2469
+ return false;
2470
+ }
2471
+ }
2472
+ }
2473
+ return true;
2474
+ }
2437
2475
  const NEO4J_ISSUE = Object.freeze({
2438
2476
  ...INPUT_ISSUE,
2439
2477
  ...ELEMENT_ISSUE,