@graphty/graph-io 0.3.40 → 0.3.41
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/chunks/{choose-CS3fvGT1.js → choose-CwFQamH9.js} +2 -2
- package/dist/chunks/{choose-CS3fvGT1.js.map → choose-CwFQamH9.js.map} +1 -1
- package/dist/chunks/{constants-DqKZT6cH.js → constants-Cf4Nn6tw.js} +2 -2
- package/dist/chunks/{constants-DqKZT6cH.js.map → constants-Cf4Nn6tw.js.map} +1 -1
- package/dist/chunks/{escape-BJRLd3vJ.js → escape-DBb8zuNE.js} +2 -2
- package/dist/chunks/{escape-BJRLd3vJ.js.map → escape-DBb8zuNE.js.map} +1 -1
- package/dist/chunks/{export-B-aVCwyG.js → export-DD3Lvw-F.js} +173 -116
- package/dist/chunks/export-DD3Lvw-F.js.map +1 -0
- package/dist/chunks/{exporter-Bcp-l4Bo.js → exporter-BqtmlxNr.js} +545 -459
- package/dist/chunks/exporter-BqtmlxNr.js.map +1 -0
- package/dist/chunks/{exporter-6ocL_9x_.js → exporter-CS35R6Fg.js} +4 -4
- package/dist/chunks/{exporter-6ocL_9x_.js.map → exporter-CS35R6Fg.js.map} +1 -1
- package/dist/chunks/{exporter-BVXnV9-9.js → exporter-D8r1N2dU.js} +28 -16
- package/dist/chunks/exporter-D8r1N2dU.js.map +1 -0
- package/dist/chunks/{exporter-SFYkDzD0.js → exporter-NMplSnYn.js} +23 -20
- package/dist/chunks/{exporter-SFYkDzD0.js.map → exporter-NMplSnYn.js.map} +1 -1
- package/dist/chunks/{importer-CPqnIY8m.js → importer-BKC7AmCA.js} +42 -29
- package/dist/chunks/importer-BKC7AmCA.js.map +1 -0
- package/dist/chunks/{importer-D_srHyj6.js → importer-BdWHmlmG.js} +4 -4
- package/dist/chunks/{importer-D_srHyj6.js.map → importer-BdWHmlmG.js.map} +1 -1
- package/dist/chunks/{importer-AjwOJrn2.js → importer-BfbzWk6k.js} +202 -181
- package/dist/chunks/importer-BfbzWk6k.js.map +1 -0
- package/dist/chunks/{importer-BpuS3J8C.js → importer-BmaZcskq.js} +73 -60
- package/dist/chunks/importer-BmaZcskq.js.map +1 -0
- package/dist/chunks/{importer-DEp_fYjf.js → importer-DviEsHy4.js} +92 -64
- package/dist/chunks/importer-DviEsHy4.js.map +1 -0
- package/dist/chunks/{importer-DcKB97kW.js → importer-S-abxJHn.js} +5 -5
- package/dist/chunks/{importer-DcKB97kW.js.map → importer-S-abxJHn.js.map} +1 -1
- package/dist/chunks/{importer-BJlGAOht.js → importer-r29cWnEf.js} +3 -3
- package/dist/chunks/{importer-BJlGAOht.js.map → importer-r29cWnEf.js.map} +1 -1
- package/dist/chunks/{json-elements-DpO6AXIc.js → json-elements-DdF-etPT.js} +3 -3
- package/dist/chunks/{json-elements-DpO6AXIc.js.map → json-elements-DdF-etPT.js.map} +1 -1
- package/dist/chunks/{ontology-export-50L9DOV4.js → ontology-export-BC0zyPhj.js} +2 -2
- package/dist/chunks/{ontology-export-50L9DOV4.js.map → ontology-export-BC0zyPhj.js.map} +1 -1
- package/dist/chunks/{records-r3SFHz11.js → records-Uc3LkABx.js} +15 -12
- package/dist/chunks/records-Uc3LkABx.js.map +1 -0
- package/dist/chunks/{text-Bjfa1xYL.js → text-Bh9SaAob.js} +20 -11
- package/dist/chunks/text-Bh9SaAob.js.map +1 -0
- package/dist/csv.js +67 -49
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +1 -1
- package/dist/gexf.js +195 -97
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +170 -149
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +26 -26
- package/dist/graphml.js +2 -2
- package/dist/json.js +1 -1
- package/dist/neo4j.js +103 -65
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/src/common/attributes.d.ts.map +1 -1
- package/dist/src/common/attributes.js +34 -9
- package/dist/src/common/attributes.js.map +1 -1
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +180 -102
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/text.d.ts +7 -0
- package/dist/src/common/text.d.ts.map +1 -1
- package/dist/src/common/text.js +15 -7
- package/dist/src/common/text.js.map +1 -1
- package/dist/src/common/zip.d.ts.map +1 -1
- package/dist/src/common/zip.js +36 -19
- package/dist/src/common/zip.js.map +1 -1
- package/dist/src/formats/csv/exporter.d.ts.map +1 -1
- package/dist/src/formats/csv/exporter.js +77 -25
- package/dist/src/formats/csv/exporter.js.map +1 -1
- package/dist/src/formats/csv/importer.d.ts.map +1 -1
- package/dist/src/formats/csv/importer.js +16 -6
- package/dist/src/formats/csv/importer.js.map +1 -1
- package/dist/src/formats/csv/records.d.ts.map +1 -1
- package/dist/src/formats/csv/records.js +18 -10
- package/dist/src/formats/csv/records.js.map +1 -1
- package/dist/src/formats/cys/tables.d.ts.map +1 -1
- package/dist/src/formats/cys/tables.js +11 -8
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +65 -37
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +138 -50
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +51 -35
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +103 -58
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/syntax.d.ts.map +1 -1
- package/dist/src/formats/gml/syntax.js +17 -8
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
- package/dist/src/formats/graphml/exporter.js +34 -24
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.d.ts.map +1 -1
- package/dist/src/formats/graphml/importer.js +17 -13
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/tree.js +23 -14
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +22 -10
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +38 -21
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +536 -343
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/obographs.js +29 -17
- package/dist/src/formats/json/obographs.js.map +1 -1
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +73 -43
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/neo4j/header.d.ts.map +1 -1
- package/dist/src/formats/neo4j/header.js +37 -16
- package/dist/src/formats/neo4j/header.js.map +1 -1
- package/dist/src/formats/neo4j/importer.d.ts.map +1 -1
- package/dist/src/formats/neo4j/importer.js +21 -11
- package/dist/src/formats/neo4j/importer.js.map +1 -1
- package/dist/src/formats/obo/exporter.d.ts.map +1 -1
- package/dist/src/formats/obo/exporter.js +18 -7
- package/dist/src/formats/obo/exporter.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +142 -73
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +26 -15
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +85 -58
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts +7 -0
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +79 -40
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +38 -12
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
- package/dist/src/formats/xgmml/importer.js +38 -18
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/sniff.js +109 -57
- package/dist/src/sniff.js.map +1 -1
- package/dist/xgmml.js +2 -2
- package/package.json +2 -2
- package/src/common/attributes.ts +59 -19
- package/src/common/input.ts +216 -102
- package/src/common/text.ts +24 -15
- package/src/common/zip.ts +47 -18
- package/src/formats/csv/exporter.ts +103 -39
- package/src/formats/csv/importer.ts +17 -6
- package/src/formats/csv/records.ts +19 -10
- package/src/formats/cys/tables.ts +11 -10
- package/src/formats/gexf/exporter.ts +67 -36
- package/src/formats/gexf/importer.ts +173 -63
- package/src/formats/gml/exporter.ts +78 -82
- package/src/formats/gml/importer.ts +119 -68
- package/src/formats/gml/syntax.ts +18 -8
- package/src/formats/graphml/exporter.ts +44 -24
- package/src/formats/graphml/importer.ts +18 -11
- package/src/formats/graphml/tree.ts +22 -12
- package/src/formats/graphml/yfiles.ts +23 -10
- package/src/formats/json/exporter.ts +40 -21
- package/src/formats/json/importer.ts +701 -385
- package/src/formats/json/obographs.ts +35 -15
- package/src/formats/neo4j/exporter.ts +79 -41
- package/src/formats/neo4j/header.ts +50 -16
- package/src/formats/neo4j/importer.ts +21 -10
- package/src/formats/obo/exporter.ts +34 -17
- package/src/formats/pajek/exporter.ts +180 -117
- package/src/formats/pajek/importer.ts +27 -15
- package/src/formats/pajek/syntax.ts +99 -58
- package/src/formats/xgmml/emit.ts +88 -40
- package/src/formats/xgmml/exporter.ts +40 -12
- package/src/formats/xgmml/importer.ts +45 -23
- package/src/sniff.ts +115 -59
- package/dist/chunks/export-B-aVCwyG.js.map +0 -1
- package/dist/chunks/exporter-BVXnV9-9.js.map +0 -1
- package/dist/chunks/exporter-Bcp-l4Bo.js.map +0 -1
- package/dist/chunks/importer-AjwOJrn2.js.map +0 -1
- package/dist/chunks/importer-BpuS3J8C.js.map +0 -1
- package/dist/chunks/importer-CPqnIY8m.js.map +0 -1
- package/dist/chunks/importer-DEp_fYjf.js.map +0 -1
- package/dist/chunks/records-r3SFHz11.js.map +0 -1
- 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-
|
|
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-
|
|
5
|
-
import { T as TextCellWriter } from "./chunks/text-
|
|
6
|
-
import { W as W2, i as i2, a as a5, p as p2 } from "./chunks/text-
|
|
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-DD3Lvw-F.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-DD3Lvw-F.js";
|
|
5
|
+
import { T as TextCellWriter } from "./chunks/text-Bh9SaAob.js";
|
|
6
|
+
import { W as W2, i as i2, a as a5, p as p2 } from "./chunks/text-Bh9SaAob.js";
|
|
7
7
|
import { C as C2, c as c2, a as a6 } from "./chunks/children-CL3Cy0ez.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-
|
|
13
|
-
import { C as C3, a as a7, b } from "./chunks/importer-
|
|
14
|
-
import { c as cx2Exporter } from "./chunks/exporter-
|
|
15
|
-
import { C as C4, a as a8 } from "./chunks/exporter-
|
|
16
|
-
import { c as cx2Importer } from "./chunks/importer-
|
|
17
|
-
import { C as C5 } from "./chunks/importer-
|
|
18
|
-
import { d as cysImporter, c as cysExporter } from "./chunks/importer-
|
|
19
|
-
import { C as C6, a as a9, b as b10 } from "./chunks/importer-
|
|
20
|
-
import { b as dotImporter, d as dotExporter } from "./chunks/importer-
|
|
21
|
-
import { D as D3, a as a10 } from "./chunks/importer-
|
|
12
|
+
import { d as cxImporter, c as cxExporter } from "./chunks/importer-BdWHmlmG.js";
|
|
13
|
+
import { C as C3, a as a7, b } from "./chunks/importer-BdWHmlmG.js";
|
|
14
|
+
import { c as cx2Exporter } from "./chunks/exporter-CS35R6Fg.js";
|
|
15
|
+
import { C as C4, a as a8 } from "./chunks/exporter-CS35R6Fg.js";
|
|
16
|
+
import { c as cx2Importer } from "./chunks/importer-r29cWnEf.js";
|
|
17
|
+
import { C as C5 } from "./chunks/importer-r29cWnEf.js";
|
|
18
|
+
import { d as cysImporter, c as cysExporter } from "./chunks/importer-BKC7AmCA.js";
|
|
19
|
+
import { C as C6, a as a9, b as b10 } from "./chunks/importer-BKC7AmCA.js";
|
|
20
|
+
import { b as dotImporter, d as dotExporter } from "./chunks/importer-S-abxJHn.js";
|
|
21
|
+
import { D as D3, a as a10 } from "./chunks/importer-S-abxJHn.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-
|
|
27
|
-
import { r as rankFormats, S as SNIFF_HEAD_BYTES, e as jsonImporter, c as jsonExporter } from "./chunks/exporter-
|
|
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-
|
|
26
|
+
import { a as graphmlImporter, g as graphmlExporter } from "./chunks/importer-BmaZcskq.js";
|
|
27
|
+
import { r as rankFormats, S as SNIFF_HEAD_BYTES, e as jsonImporter, c as jsonExporter } from "./chunks/exporter-BqtmlxNr.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-BqtmlxNr.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-
|
|
32
|
-
import { O, a as a12, b as b12 } from "./chunks/exporter-
|
|
33
|
-
import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-
|
|
34
|
-
import { P as P2, a as a13 } from "./chunks/importer-
|
|
35
|
-
import { x as xgmmlExporter } from "./chunks/exporter-
|
|
36
|
-
import { x as xgmmlImporter } from "./chunks/importer-
|
|
37
|
-
import { X as X2, a as a14 } from "./chunks/importer-
|
|
38
|
-
import { G as G3, a as a15 } from "./chunks/constants-
|
|
39
|
-
import { X as X3, b as b13, h as h3, t as t3, x as x2 } from "./chunks/escape-
|
|
31
|
+
import { c as oboImporter, o as oboExporter } from "./chunks/exporter-NMplSnYn.js";
|
|
32
|
+
import { O, a as a12, b as b12 } from "./chunks/exporter-NMplSnYn.js";
|
|
33
|
+
import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-BfbzWk6k.js";
|
|
34
|
+
import { P as P2, a as a13 } from "./chunks/importer-BfbzWk6k.js";
|
|
35
|
+
import { x as xgmmlExporter } from "./chunks/exporter-D8r1N2dU.js";
|
|
36
|
+
import { x as xgmmlImporter } from "./chunks/importer-DviEsHy4.js";
|
|
37
|
+
import { X as X2, a as a14 } from "./chunks/importer-DviEsHy4.js";
|
|
38
|
+
import { G as G3, a as a15 } from "./chunks/constants-Cf4Nn6tw.js";
|
|
39
|
+
import { X as X3, b as b13, h as h3, t as t3, x as x2 } from "./chunks/escape-DBb8zuNE.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-
|
|
2
|
-
import { g, a as a2 } from "./chunks/importer-
|
|
1
|
+
import { G, a } from "./chunks/constants-Cf4Nn6tw.js";
|
|
2
|
+
import { g, a as a2 } from "./chunks/importer-BmaZcskq.js";
|
|
3
3
|
export {
|
|
4
4
|
G as GRAPHML_ISSUE,
|
|
5
5
|
a as GRAPHML_LOSS,
|
package/dist/json.js
CHANGED
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,
|
|
2
|
-
import { c as checkRecordSyntax, R as RecordReader, B as BAD_QUOTE_CODE, U as UNCLOSED_QUOTE_CODE } from "./chunks/records-
|
|
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-DD3Lvw-F.js";
|
|
2
|
+
import { c as checkRecordSyntax, R as RecordReader, B as BAD_QUOTE_CODE, U as UNCLOSED_QUOTE_CODE } from "./chunks/records-Uc3LkABx.js";
|
|
3
3
|
import { GraphFormatError, INVALID_INDEX } from "@graphty/graph-format";
|
|
4
|
-
import { o as quoteCsvCell } from "./chunks/escape-
|
|
4
|
+
import { o as quoteCsvCell } from "./chunks/escape-DBb8zuNE.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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2339
|
+
return numberOrString(value, formatInteger);
|
|
2319
2340
|
case "float":
|
|
2320
|
-
return
|
|
2341
|
+
return numberOrString(value, formatF32);
|
|
2321
2342
|
case "double":
|
|
2322
|
-
return
|
|
2343
|
+
return numberOrString(value, formatF64);
|
|
2323
2344
|
case "boolean":
|
|
2324
2345
|
return value === true ? "true" : "false";
|
|
2325
2346
|
case "string":
|
|
2326
|
-
return
|
|
2347
|
+
return String(value);
|
|
2327
2348
|
case "temporal":
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
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,
|