@graphty/graph-io 0.3.25 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -414
- package/dist/chunks/children-CL3Cy0ez.js.map +1 -1
- package/dist/chunks/choose-DrXtu_96.js +56 -0
- package/dist/chunks/choose-DrXtu_96.js.map +1 -0
- package/dist/chunks/constants-ikG85dT8.js +231 -0
- package/dist/chunks/constants-ikG85dT8.js.map +1 -0
- package/dist/chunks/{escape-B-tkk_Cl.js → escape-D1HPTUrP.js} +390 -99
- package/dist/chunks/escape-D1HPTUrP.js.map +1 -0
- package/dist/chunks/export-CHd4tQE2.js +4333 -0
- package/dist/chunks/export-CHd4tQE2.js.map +1 -0
- package/dist/chunks/{importer-eUREhBGj.js → exporter-D23CKNqF.js} +4969 -3201
- package/dist/chunks/exporter-D23CKNqF.js.map +1 -0
- package/dist/chunks/{exporter-DIeGJXAZ.js → exporter-DfWTgrti.js} +23 -21
- package/dist/chunks/exporter-DfWTgrti.js.map +1 -0
- package/dist/chunks/exporter-DhtW6FxK.js +3465 -0
- package/dist/chunks/exporter-DhtW6FxK.js.map +1 -0
- package/dist/chunks/{exporter-BGrsWamJ.js → exporter-IHv4nkCm.js} +38 -229
- package/dist/chunks/exporter-IHv4nkCm.js.map +1 -0
- package/dist/chunks/{importer-BWY2FFc5.js → importer-B1wmPQjr.js} +255 -77
- package/dist/chunks/importer-B1wmPQjr.js.map +1 -0
- package/dist/chunks/{importer-D_e7e7LX.js → importer-B2W_58pz.js} +399 -146
- package/dist/chunks/importer-B2W_58pz.js.map +1 -0
- package/dist/chunks/importer-BSALvkui.js +2811 -0
- package/dist/chunks/importer-BSALvkui.js.map +1 -0
- package/dist/chunks/{importer-vi3bSdtw.js → importer-BVRE--Un.js} +510 -77
- package/dist/chunks/importer-BVRE--Un.js.map +1 -0
- package/dist/chunks/{importer-DET1tg6s.js → importer-CIAzt-wo.js} +1689 -312
- package/dist/chunks/importer-CIAzt-wo.js.map +1 -0
- package/dist/chunks/{importer-DIrbbnAf.js → importer-DpEW5zeG.js} +585 -226
- package/dist/chunks/importer-DpEW5zeG.js.map +1 -0
- package/dist/chunks/{importer-zGLo8Dg_.js → importer-z_FL4VMb.js} +488 -161
- package/dist/chunks/importer-z_FL4VMb.js.map +1 -0
- package/dist/chunks/json-elements-BAmNBZok.js +1225 -0
- package/dist/chunks/json-elements-BAmNBZok.js.map +1 -0
- package/dist/chunks/ontology-export-Bab4eUA8.js +357 -0
- package/dist/chunks/ontology-export-Bab4eUA8.js.map +1 -0
- package/dist/chunks/{records-dbRkxwaq.js → records-CdlvL4RO.js} +298 -114
- package/dist/chunks/records-CdlvL4RO.js.map +1 -0
- package/dist/chunks/{text-Dr0Ifpag.js → text-DzXjAiTl.js} +29 -11
- package/dist/chunks/text-DzXjAiTl.js.map +1 -0
- package/dist/chunks/{writer-C7flM-Ih.js → writer-DxjgHwSe.js} +19 -1
- package/dist/chunks/writer-DxjgHwSe.js.map +1 -0
- package/dist/csv.js +952 -262
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +6 -3
- package/dist/cx2.js +2 -2
- package/dist/cys.js +6 -3
- package/dist/dot.js +1 -1
- package/dist/gexf.js +554 -122
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +344 -87
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +1105 -213
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +3 -2
- package/dist/graphml.js.map +1 -1
- package/dist/json.js +3 -2
- package/dist/neo4j.js +565 -158
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +6 -3
- package/dist/pajek.js +1 -1
- package/dist/src/children.d.ts +18 -6
- package/dist/src/children.d.ts.map +1 -1
- package/dist/src/children.js +6 -3
- package/dist/src/children.js.map +1 -1
- package/dist/src/common/attributes.d.ts +29 -11
- package/dist/src/common/attributes.d.ts.map +1 -1
- package/dist/src/common/attributes.js +25 -7
- package/dist/src/common/attributes.js.map +1 -1
- package/dist/src/common/cell-budget.d.ts +9 -2
- package/dist/src/common/cell-budget.d.ts.map +1 -1
- package/dist/src/common/cell-budget.js +11 -3
- package/dist/src/common/cell-budget.js.map +1 -1
- package/dist/src/common/choose.d.ts +19 -0
- package/dist/src/common/choose.d.ts.map +1 -0
- package/dist/src/common/choose.js +72 -0
- package/dist/src/common/choose.js.map +1 -0
- package/dist/src/common/codes.d.ts +456 -66
- package/dist/src/common/codes.d.ts.map +1 -1
- package/dist/src/common/codes.js +458 -66
- package/dist/src/common/codes.js.map +1 -1
- package/dist/src/common/compare.d.ts +81 -0
- package/dist/src/common/compare.d.ts.map +1 -0
- package/dist/src/common/compare.js +394 -0
- package/dist/src/common/compare.js.map +1 -0
- package/dist/src/common/cx-export.d.ts +123 -0
- package/dist/src/common/cx-export.d.ts.map +1 -0
- package/dist/src/common/cx-export.js +334 -0
- package/dist/src/common/cx-export.js.map +1 -0
- package/dist/src/common/declared-types.d.ts +22 -2
- package/dist/src/common/declared-types.d.ts.map +1 -1
- package/dist/src/common/declared-types.js +21 -3
- package/dist/src/common/declared-types.js.map +1 -1
- package/dist/src/common/direction.d.ts +74 -50
- package/dist/src/common/direction.d.ts.map +1 -1
- package/dist/src/common/direction.js +47 -27
- package/dist/src/common/direction.js.map +1 -1
- package/dist/src/common/escape.d.ts +21 -9
- package/dist/src/common/escape.d.ts.map +1 -1
- package/dist/src/common/escape.js +39 -22
- package/dist/src/common/escape.js.map +1 -1
- package/dist/src/common/export.d.ts +144 -32
- package/dist/src/common/export.d.ts.map +1 -1
- package/dist/src/common/export.js +216 -42
- package/dist/src/common/export.js.map +1 -1
- package/dist/src/common/format.d.ts +23 -1
- package/dist/src/common/format.d.ts.map +1 -1
- package/dist/src/common/format.js +26 -1
- package/dist/src/common/format.js.map +1 -1
- package/dist/src/common/ids.d.ts +9 -2
- package/dist/src/common/ids.d.ts.map +1 -1
- package/dist/src/common/ids.js +6 -2
- package/dist/src/common/ids.js.map +1 -1
- package/dist/src/common/input.d.ts +122 -28
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +890 -124
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/json-elements.d.ts +144 -20
- package/dist/src/common/json-elements.d.ts.map +1 -1
- package/dist/src/common/json-elements.js +869 -189
- package/dist/src/common/json-elements.js.map +1 -1
- package/dist/src/common/line-format.d.ts +90 -0
- package/dist/src/common/line-format.d.ts.map +1 -0
- package/dist/src/common/line-format.js +185 -0
- package/dist/src/common/line-format.js.map +1 -0
- package/dist/src/common/lists.d.ts +6 -1
- package/dist/src/common/lists.d.ts.map +1 -1
- package/dist/src/common/lists.js +3 -1
- package/dist/src/common/lists.js.map +1 -1
- package/dist/src/common/ontology-export.d.ts +167 -0
- package/dist/src/common/ontology-export.d.ts.map +1 -0
- package/dist/src/common/ontology-export.js +359 -0
- package/dist/src/common/ontology-export.js.map +1 -0
- package/dist/src/common/ontology.d.ts +25 -3
- package/dist/src/common/ontology.d.ts.map +1 -1
- package/dist/src/common/ontology.js +30 -9
- package/dist/src/common/ontology.js.map +1 -1
- package/dist/src/common/options.d.ts +62 -12
- package/dist/src/common/options.d.ts.map +1 -1
- package/dist/src/common/options.js +89 -11
- package/dist/src/common/options.js.map +1 -1
- package/dist/src/common/plural.d.ts +31 -0
- package/dist/src/common/plural.d.ts.map +1 -0
- package/dist/src/common/plural.js +46 -0
- package/dist/src/common/plural.js.map +1 -0
- package/dist/src/common/report.d.ts +72 -14
- package/dist/src/common/report.d.ts.map +1 -1
- package/dist/src/common/report.js +146 -22
- package/dist/src/common/report.js.map +1 -1
- package/dist/src/common/temporal.d.ts +22 -5
- package/dist/src/common/temporal.d.ts.map +1 -1
- package/dist/src/common/temporal.js +13 -2
- package/dist/src/common/temporal.js.map +1 -1
- package/dist/src/common/text.d.ts +39 -23
- package/dist/src/common/text.d.ts.map +1 -1
- package/dist/src/common/text.js +51 -21
- package/dist/src/common/text.js.map +1 -1
- package/dist/src/common/weights.d.ts +37 -4
- package/dist/src/common/weights.d.ts.map +1 -1
- package/dist/src/common/weights.js +61 -2
- package/dist/src/common/weights.js.map +1 -1
- package/dist/src/common/writer.d.ts +19 -3
- package/dist/src/common/writer.d.ts.map +1 -1
- package/dist/src/common/writer.js +30 -2
- package/dist/src/common/writer.js.map +1 -1
- package/dist/src/common/xml.d.ts +125 -9
- package/dist/src/common/xml.d.ts.map +1 -1
- package/dist/src/common/xml.js +402 -85
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/common/zip.d.ts +44 -4
- package/dist/src/common/zip.d.ts.map +1 -1
- package/dist/src/common/zip.js +134 -5
- package/dist/src/common/zip.js.map +1 -1
- package/dist/src/formats/csv/exporter.d.ts +80 -24
- package/dist/src/formats/csv/exporter.d.ts.map +1 -1
- package/dist/src/formats/csv/exporter.js +146 -33
- package/dist/src/formats/csv/exporter.js.map +1 -1
- package/dist/src/formats/csv/header.d.ts +38 -9
- package/dist/src/formats/csv/header.d.ts.map +1 -1
- package/dist/src/formats/csv/header.js +46 -10
- package/dist/src/formats/csv/header.js.map +1 -1
- package/dist/src/formats/csv/importer.d.ts +187 -37
- package/dist/src/formats/csv/importer.d.ts.map +1 -1
- package/dist/src/formats/csv/importer.js +835 -204
- package/dist/src/formats/csv/importer.js.map +1 -1
- package/dist/src/formats/csv/index.d.ts +100 -19
- package/dist/src/formats/csv/index.d.ts.map +1 -1
- package/dist/src/formats/csv/index.js +94 -21
- package/dist/src/formats/csv/index.js.map +1 -1
- package/dist/src/formats/csv/records.d.ts +95 -10
- package/dist/src/formats/csv/records.d.ts.map +1 -1
- package/dist/src/formats/csv/records.js +333 -122
- package/dist/src/formats/csv/records.js.map +1 -1
- package/dist/src/formats/csv/values.d.ts +1 -0
- package/dist/src/formats/csv/values.d.ts.map +1 -1
- package/dist/src/formats/csv/values.js +1 -0
- package/dist/src/formats/csv/values.js.map +1 -1
- package/dist/src/formats/cx/exporter.d.ts +102 -0
- package/dist/src/formats/cx/exporter.d.ts.map +1 -0
- package/dist/src/formats/cx/exporter.js +1217 -0
- package/dist/src/formats/cx/exporter.js.map +1 -0
- package/dist/src/formats/cx/importer.d.ts +79 -32
- package/dist/src/formats/cx/importer.d.ts.map +1 -1
- package/dist/src/formats/cx/importer.js +682 -287
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx/index.d.ts +4 -3
- package/dist/src/formats/cx/index.d.ts.map +1 -1
- package/dist/src/formats/cx/index.js +4 -3
- package/dist/src/formats/cx/index.js.map +1 -1
- package/dist/src/formats/cx2/exporter.d.ts +29 -11
- package/dist/src/formats/cx2/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx2/exporter.js +39 -268
- package/dist/src/formats/cx2/exporter.js.map +1 -1
- package/dist/src/formats/cx2/importer.d.ts +78 -28
- package/dist/src/formats/cx2/importer.d.ts.map +1 -1
- package/dist/src/formats/cx2/importer.js +227 -80
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/cx2/index.d.ts +2 -1
- package/dist/src/formats/cx2/index.d.ts.map +1 -1
- package/dist/src/formats/cx2/index.js +2 -1
- package/dist/src/formats/cx2/index.js.map +1 -1
- package/dist/src/formats/cys/constants.d.ts +66 -17
- package/dist/src/formats/cys/constants.d.ts.map +1 -1
- package/dist/src/formats/cys/constants.js +59 -18
- package/dist/src/formats/cys/constants.js.map +1 -1
- package/dist/src/formats/cys/exporter.d.ts +118 -0
- package/dist/src/formats/cys/exporter.d.ts.map +1 -0
- package/dist/src/formats/cys/exporter.js +1072 -0
- package/dist/src/formats/cys/exporter.js.map +1 -0
- package/dist/src/formats/cys/importer.d.ts +22 -8
- package/dist/src/formats/cys/importer.d.ts.map +1 -1
- package/dist/src/formats/cys/importer.js +510 -149
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/index.d.ts +4 -2
- package/dist/src/formats/cys/index.d.ts.map +1 -1
- package/dist/src/formats/cys/index.js +4 -2
- package/dist/src/formats/cys/index.js.map +1 -1
- package/dist/src/formats/cys/session.d.ts +46 -7
- package/dist/src/formats/cys/session.d.ts.map +1 -1
- package/dist/src/formats/cys/session.js +101 -27
- package/dist/src/formats/cys/session.js.map +1 -1
- package/dist/src/formats/cys/tables.d.ts +9 -2
- package/dist/src/formats/cys/tables.d.ts.map +1 -1
- package/dist/src/formats/cys/tables.js +29 -7
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/dot/exporter.d.ts +42 -14
- package/dist/src/formats/dot/exporter.d.ts.map +1 -1
- package/dist/src/formats/dot/exporter.js +56 -29
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.d.ts +91 -29
- package/dist/src/formats/dot/importer.d.ts.map +1 -1
- package/dist/src/formats/dot/importer.js +190 -39
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/dot/index.d.ts +2 -1
- package/dist/src/formats/dot/index.d.ts.map +1 -1
- package/dist/src/formats/dot/index.js +2 -1
- package/dist/src/formats/dot/index.js.map +1 -1
- package/dist/src/formats/dot/names.d.ts +44 -11
- package/dist/src/formats/dot/names.d.ts.map +1 -1
- package/dist/src/formats/dot/names.js +44 -11
- package/dist/src/formats/dot/names.js.map +1 -1
- package/dist/src/formats/dot/tokenizer.d.ts +9 -2
- package/dist/src/formats/dot/tokenizer.d.ts.map +1 -1
- package/dist/src/formats/dot/tokenizer.js +20 -5
- package/dist/src/formats/dot/tokenizer.js.map +1 -1
- package/dist/src/formats/gexf/exporter.d.ts +46 -15
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +45 -15
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts +87 -23
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +471 -90
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/index.d.ts +84 -21
- package/dist/src/formats/gexf/index.d.ts.map +1 -1
- package/dist/src/formats/gexf/index.js +80 -23
- package/dist/src/formats/gexf/index.js.map +1 -1
- package/dist/src/formats/gexf/schema.d.ts +67 -15
- package/dist/src/formats/gexf/schema.d.ts.map +1 -1
- package/dist/src/formats/gexf/schema.js +59 -13
- package/dist/src/formats/gexf/schema.js.map +1 -1
- package/dist/src/formats/gml/exporter.d.ts +69 -21
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +74 -29
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts +116 -25
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +290 -61
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/index.d.ts +87 -24
- package/dist/src/formats/gml/index.d.ts.map +1 -1
- package/dist/src/formats/gml/index.js +79 -26
- package/dist/src/formats/gml/index.js.map +1 -1
- package/dist/src/formats/gml/syntax.d.ts +67 -18
- package/dist/src/formats/gml/syntax.d.ts.map +1 -1
- package/dist/src/formats/gml/syntax.js +110 -28
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/constants.d.ts +174 -44
- package/dist/src/formats/graphml/constants.d.ts.map +1 -1
- package/dist/src/formats/graphml/constants.js +165 -44
- package/dist/src/formats/graphml/constants.js.map +1 -1
- package/dist/src/formats/graphml/exporter.d.ts +17 -9
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
- package/dist/src/formats/graphml/exporter.js +33 -12
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.d.ts +19 -7
- package/dist/src/formats/graphml/importer.d.ts.map +1 -1
- package/dist/src/formats/graphml/importer.js +466 -39
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/index.d.ts +2 -1
- package/dist/src/formats/graphml/index.d.ts.map +1 -1
- package/dist/src/formats/graphml/index.js +2 -1
- package/dist/src/formats/graphml/index.js.map +1 -1
- package/dist/src/formats/graphml/tree.d.ts +6 -2
- package/dist/src/formats/graphml/tree.d.ts.map +1 -1
- package/dist/src/formats/graphml/tree.js +6 -2
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts +8 -3
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +36 -15
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/dialect.d.ts +88 -24
- package/dist/src/formats/json/dialect.d.ts.map +1 -1
- package/dist/src/formats/json/dialect.js +109 -19
- package/dist/src/formats/json/dialect.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts +134 -22
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +135 -54
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +173 -52
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +899 -220
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/index.d.ts +3 -2
- package/dist/src/formats/json/index.d.ts.map +1 -1
- package/dist/src/formats/json/index.js +3 -2
- package/dist/src/formats/json/index.js.map +1 -1
- package/dist/src/formats/json/obographs-export.d.ts +68 -0
- package/dist/src/formats/json/obographs-export.d.ts.map +1 -0
- package/dist/src/formats/json/obographs-export.js +941 -0
- package/dist/src/formats/json/obographs-export.js.map +1 -0
- package/dist/src/formats/json/obographs.d.ts +26 -0
- package/dist/src/formats/json/obographs.d.ts.map +1 -1
- package/dist/src/formats/json/obographs.js +297 -80
- package/dist/src/formats/json/obographs.js.map +1 -1
- package/dist/src/formats/neo4j/exporter.d.ts +109 -21
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +239 -86
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/neo4j/header.d.ts +17 -4
- package/dist/src/formats/neo4j/header.d.ts.map +1 -1
- package/dist/src/formats/neo4j/header.js +36 -4
- package/dist/src/formats/neo4j/header.js.map +1 -1
- package/dist/src/formats/neo4j/importer.d.ts +107 -27
- package/dist/src/formats/neo4j/importer.d.ts.map +1 -1
- package/dist/src/formats/neo4j/importer.js +415 -63
- package/dist/src/formats/neo4j/importer.js.map +1 -1
- package/dist/src/formats/neo4j/index.d.ts +73 -23
- package/dist/src/formats/neo4j/index.d.ts.map +1 -1
- package/dist/src/formats/neo4j/index.js +65 -25
- package/dist/src/formats/neo4j/index.js.map +1 -1
- package/dist/src/formats/obo/exporter.d.ts +150 -0
- package/dist/src/formats/obo/exporter.d.ts.map +1 -0
- package/dist/src/formats/obo/exporter.js +1736 -0
- package/dist/src/formats/obo/exporter.js.map +1 -0
- package/dist/src/formats/obo/importer.d.ts +95 -19
- package/dist/src/formats/obo/importer.d.ts.map +1 -1
- package/dist/src/formats/obo/importer.js +475 -104
- package/dist/src/formats/obo/importer.js.map +1 -1
- package/dist/src/formats/obo/index.d.ts +6 -3
- package/dist/src/formats/obo/index.d.ts.map +1 -1
- package/dist/src/formats/obo/index.js +6 -3
- package/dist/src/formats/obo/index.js.map +1 -1
- package/dist/src/formats/obo/syntax.d.ts +108 -4
- package/dist/src/formats/obo/syntax.d.ts.map +1 -1
- package/dist/src/formats/obo/syntax.js +211 -34
- package/dist/src/formats/obo/syntax.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts +54 -16
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +67 -35
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts +84 -22
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +303 -83
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/index.d.ts +2 -1
- package/dist/src/formats/pajek/index.d.ts.map +1 -1
- package/dist/src/formats/pajek/index.js +2 -1
- package/dist/src/formats/pajek/index.js.map +1 -1
- package/dist/src/formats/pajek/syntax.d.ts +77 -14
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +186 -54
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/columns.d.ts +1 -0
- package/dist/src/formats/xgmml/columns.d.ts.map +1 -1
- package/dist/src/formats/xgmml/columns.js +4 -0
- package/dist/src/formats/xgmml/columns.js.map +1 -1
- package/dist/src/formats/xgmml/constants.d.ts +186 -56
- package/dist/src/formats/xgmml/constants.d.ts.map +1 -1
- package/dist/src/formats/xgmml/constants.js +181 -57
- package/dist/src/formats/xgmml/constants.js.map +1 -1
- package/dist/src/formats/xgmml/document.d.ts +65 -11
- package/dist/src/formats/xgmml/document.d.ts.map +1 -1
- package/dist/src/formats/xgmml/document.js +157 -28
- package/dist/src/formats/xgmml/document.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts +61 -3
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +129 -26
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.d.ts +13 -6
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +21 -22
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.d.ts +33 -12
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
- package/dist/src/formats/xgmml/importer.js +35 -72
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/formats/xgmml/index.d.ts +1 -0
- package/dist/src/formats/xgmml/index.d.ts.map +1 -1
- package/dist/src/formats/xgmml/index.js +1 -0
- package/dist/src/formats/xgmml/index.js.map +1 -1
- package/dist/src/formats/xgmml/values.d.ts +8 -1
- package/dist/src/formats/xgmml/values.d.ts.map +1 -1
- package/dist/src/formats/xgmml/values.js +8 -3
- package/dist/src/formats/xgmml/values.js.map +1 -1
- package/dist/src/index.d.ts +23 -18
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +28 -16
- package/dist/src/index.js.map +1 -1
- package/dist/src/registry.d.ts +478 -92
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +807 -88
- package/dist/src/registry.js.map +1 -1
- package/dist/src/sniff.d.ts +61 -19
- package/dist/src/sniff.d.ts.map +1 -1
- package/dist/src/sniff.js +121 -29
- package/dist/src/sniff.js.map +1 -1
- package/dist/src/types.d.ts +362 -112
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +28 -7
- package/dist/src/types.js.map +1 -1
- package/dist/xgmml.js +2 -2
- package/docs/samples/README.md +25 -0
- package/docs/samples/got-edges.csv +353 -0
- package/docs/samples/got-network.graphml +1384 -0
- package/docs/samples/got-nodes.csv +108 -0
- package/docs/samples/got.cx +930 -0
- package/docs/samples/got.cx2 +465 -0
- package/docs/samples/got.gexf +471 -0
- package/docs/samples/got.gml +2650 -0
- package/docs/samples/got.json +2546 -0
- package/docs/samples/got.net +461 -0
- package/docs/samples/movies-nodes.csv +9 -0
- package/docs/samples/movies-rels.csv +8 -0
- package/docs/samples/networks.cys +0 -0
- package/docs/samples/proteins.xgmml +9 -0
- package/docs/samples/teams.gv +24 -0
- package/docs/samples/vehicles.obo +25 -0
- package/package.json +9 -4
- package/src/children.ts +18 -6
- package/src/common/attributes.ts +29 -11
- package/src/common/cell-budget.ts +11 -3
- package/src/common/choose.ts +89 -0
- package/src/common/codes.ts +490 -66
- package/src/common/compare.ts +472 -0
- package/src/common/cx-export.ts +432 -0
- package/src/common/declared-types.ts +40 -6
- package/src/common/direction.ts +78 -51
- package/src/common/escape.ts +39 -22
- package/src/common/export.ts +284 -47
- package/src/common/format.ts +30 -1
- package/src/common/ids.ts +14 -3
- package/src/common/input.ts +1057 -134
- package/src/common/json-elements.ts +1035 -199
- package/src/common/line-format.ts +249 -0
- package/src/common/lists.ts +7 -2
- package/src/common/ontology-export.ts +461 -0
- package/src/common/ontology.ts +31 -9
- package/src/common/options.ts +110 -15
- package/src/common/plural.ts +49 -0
- package/src/common/report.ts +168 -25
- package/src/common/temporal.ts +22 -5
- package/src/common/text.ts +62 -23
- package/src/common/weights.ts +74 -4
- package/src/common/writer.ts +37 -3
- package/src/common/xml.ts +479 -90
- package/src/common/zip.ts +169 -7
- package/src/formats/csv/exporter.ts +202 -47
- package/src/formats/csv/header.ts +50 -11
- package/src/formats/csv/importer.ts +1133 -245
- package/src/formats/csv/index.ts +106 -19
- package/src/formats/csv/records.ts +396 -122
- package/src/formats/csv/values.ts +1 -0
- package/src/formats/cx/exporter.ts +1483 -0
- package/src/formats/cx/importer.ts +890 -302
- package/src/formats/cx/index.ts +4 -3
- package/src/formats/cx2/exporter.ts +62 -339
- package/src/formats/cx2/importer.ts +318 -87
- package/src/formats/cx2/index.ts +2 -1
- package/src/formats/cys/constants.ts +62 -17
- package/src/formats/cys/exporter.ts +1368 -0
- package/src/formats/cys/importer.ts +659 -157
- package/src/formats/cys/index.ts +4 -2
- package/src/formats/cys/session.ts +142 -34
- package/src/formats/cys/tables.ts +47 -9
- package/src/formats/dot/exporter.ts +83 -37
- package/src/formats/dot/importer.ts +248 -54
- package/src/formats/dot/index.ts +2 -1
- package/src/formats/dot/names.ts +44 -11
- package/src/formats/dot/tokenizer.ts +25 -6
- package/src/formats/gexf/exporter.ts +57 -18
- package/src/formats/gexf/importer.ts +636 -105
- package/src/formats/gexf/index.ts +90 -21
- package/src/formats/gexf/schema.ts +67 -15
- package/src/formats/gml/exporter.ts +90 -36
- package/src/formats/gml/importer.ts +388 -67
- package/src/formats/gml/index.ts +85 -24
- package/src/formats/gml/syntax.ts +113 -28
- package/src/formats/graphml/constants.ts +178 -44
- package/src/formats/graphml/exporter.ts +52 -18
- package/src/formats/graphml/importer.ts +640 -60
- package/src/formats/graphml/index.ts +2 -1
- package/src/formats/graphml/tree.ts +6 -2
- package/src/formats/graphml/yfiles.ts +37 -15
- package/src/formats/json/dialect.ts +128 -29
- package/src/formats/json/exporter.ts +205 -68
- package/src/formats/json/importer.ts +1163 -253
- package/src/formats/json/index.ts +3 -1
- package/src/formats/json/obographs-export.ts +1197 -0
- package/src/formats/json/obographs.ts +353 -92
- package/src/formats/neo4j/exporter.ts +321 -102
- package/src/formats/neo4j/header.ts +44 -6
- package/src/formats/neo4j/importer.ts +512 -73
- package/src/formats/neo4j/index.ts +75 -23
- package/src/formats/obo/exporter.ts +2210 -0
- package/src/formats/obo/importer.ts +622 -109
- package/src/formats/obo/index.ts +6 -3
- package/src/formats/obo/syntax.ts +232 -37
- package/src/formats/pajek/exporter.ts +90 -42
- package/src/formats/pajek/importer.ts +407 -93
- package/src/formats/pajek/index.ts +2 -1
- package/src/formats/pajek/syntax.ts +216 -55
- package/src/formats/xgmml/columns.ts +10 -0
- package/src/formats/xgmml/constants.ts +183 -56
- package/src/formats/xgmml/document.ts +212 -34
- package/src/formats/xgmml/emit.ts +175 -34
- package/src/formats/xgmml/exporter.ts +36 -28
- package/src/formats/xgmml/importer.ts +64 -86
- package/src/formats/xgmml/index.ts +1 -0
- package/src/formats/xgmml/values.ts +12 -4
- package/src/index.ts +81 -11
- package/src/registry.ts +1121 -135
- package/src/sniff.ts +163 -32
- package/src/types.ts +385 -114
- package/dist/chunks/escape-B-tkk_Cl.js.map +0 -1
- package/dist/chunks/export-Bh60Dv-n.js +0 -582
- package/dist/chunks/export-Bh60Dv-n.js.map +0 -1
- package/dist/chunks/exporter-BGrsWamJ.js.map +0 -1
- package/dist/chunks/exporter-DIeGJXAZ.js.map +0 -1
- package/dist/chunks/importer-BWY2FFc5.js.map +0 -1
- package/dist/chunks/importer-DD-xv9_Y.js +0 -1471
- package/dist/chunks/importer-DD-xv9_Y.js.map +0 -1
- package/dist/chunks/importer-DET1tg6s.js.map +0 -1
- package/dist/chunks/importer-DEcKhsmQ.js +0 -1614
- package/dist/chunks/importer-DEcKhsmQ.js.map +0 -1
- package/dist/chunks/importer-DIrbbnAf.js.map +0 -1
- package/dist/chunks/importer-D_e7e7LX.js.map +0 -1
- package/dist/chunks/importer-eUREhBGj.js.map +0 -1
- package/dist/chunks/importer-vi3bSdtw.js.map +0 -1
- package/dist/chunks/importer-zGLo8Dg_.js.map +0 -1
- package/dist/chunks/json-elements-DDS8N2Dd.js +0 -779
- package/dist/chunks/json-elements-DDS8N2Dd.js.map +0 -1
- package/dist/chunks/ontology-BnrJ4I98.js +0 -113
- package/dist/chunks/ontology-BnrJ4I98.js.map +0 -1
- package/dist/chunks/records-dbRkxwaq.js.map +0 -1
- package/dist/chunks/report-B1z4WT9e.js +0 -2372
- package/dist/chunks/report-B1z4WT9e.js.map +0 -1
- package/dist/chunks/text-Dr0Ifpag.js.map +0 -1
- package/dist/chunks/weights-Dzba96G3.js +0 -176
- package/dist/chunks/weights-Dzba96G3.js.map +0 -1
- package/dist/chunks/writer-C7flM-Ih.js.map +0 -1
package/dist/graph-io.js
CHANGED
|
@@ -1,41 +1,446 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { INVALID_INDEX, GraphFormatError, GraphBuilder } from "@graphty/graph-format";
|
|
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, aL as parseWeightText, aM as isAbortError, aN as BAD_LINE_CODE, aO as messageOf, aP as describe, b as plural, aQ as UNKNOWN_OPTION_CODE, a7 as chooseGraph, aR as normalizeInput, aS as foreignKind, E as EMPTY_INPUT_CODE, aT as ImportError, aU as FETCH_CODE, $ as agree, aV as EDGES_MERGED_CODE, aW as SELF_LOOPS_DROPPED_CODE, O as OPTION_IGNORED_CODE, aX as WEIGHT_NOT_FOUND_CODE, aY as lockReader, aZ as abortable } from "./chunks/export-CHd4tQE2.js";
|
|
4
|
+
import { ae, Y, V, B, a_, a3, at, a$, C, b0, A, b1, k, j, i, b2, b3, b4, D, d, o, b5, m, u, n, F, b6, v, x, b7, b8, aB, af, H, I, b9, J, G, ba, y, z, bb, a2, L, s, t, M, l, W, T, bc, bd, aA, be, bf, N, bg, bh, Q, ai, bi, P, aD, ay, au, K, R, bj, ag, S, Z, _, bk, f, ah, ak, bl, bm, bn, ad, aC, U, g, w, q, bo, h, bp, bq, aj, ax, X, aH, c, a, br, aI, bs, a1, bt, bu, e, bv, aF, aa, ab, bw, aG, ap, bx, by, bz, bA, aK, bB, p, bC, bD, r, aE, a4 } from "./chunks/export-CHd4tQE2.js";
|
|
5
|
+
import { T as TextCellWriter } from "./chunks/text-DzXjAiTl.js";
|
|
6
|
+
import { W as W2, i as i2, a as a5, p as p2 } from "./chunks/text-DzXjAiTl.js";
|
|
7
|
+
import { C as C2, c as c2, a as a6 } from "./chunks/children-CL3Cy0ez.js";
|
|
8
|
+
import { c as collectBytes } from "./chunks/writer-DxjgHwSe.js";
|
|
9
|
+
import { D as D2, d as d2, e as e2, j as j2, t as t2 } from "./chunks/writer-DxjgHwSe.js";
|
|
5
10
|
import { csvImporter, csvExporter } from "./csv.js";
|
|
6
11
|
import { CSV_CAPABILITIES, CSV_ISSUE, CSV_LOSS } from "./csv.js";
|
|
7
|
-
import {
|
|
8
|
-
import { C as C3 } from "./chunks/importer-
|
|
9
|
-
import { c as cx2Exporter } from "./chunks/exporter-
|
|
10
|
-
import { C as C4, a as
|
|
11
|
-
import { c as cx2Importer } from "./chunks/importer-
|
|
12
|
-
import { C as C5 } from "./chunks/importer-
|
|
13
|
-
import {
|
|
14
|
-
import { C as C6 } from "./chunks/importer-
|
|
15
|
-
import { b as dotImporter, d as dotExporter } from "./chunks/importer-
|
|
16
|
-
import { D as
|
|
12
|
+
import { d as cxImporter, c as cxExporter } from "./chunks/importer-CIAzt-wo.js";
|
|
13
|
+
import { C as C3, a as a7, b } from "./chunks/importer-CIAzt-wo.js";
|
|
14
|
+
import { c as cx2Exporter } from "./chunks/exporter-IHv4nkCm.js";
|
|
15
|
+
import { C as C4, a as a8 } from "./chunks/exporter-IHv4nkCm.js";
|
|
16
|
+
import { c as cx2Importer } from "./chunks/importer-BVRE--Un.js";
|
|
17
|
+
import { C as C5 } from "./chunks/importer-BVRE--Un.js";
|
|
18
|
+
import { d as cysImporter, c as cysExporter } from "./chunks/importer-BSALvkui.js";
|
|
19
|
+
import { C as C6, a as a9, b as b10 } from "./chunks/importer-BSALvkui.js";
|
|
20
|
+
import { b as dotImporter, d as dotExporter } from "./chunks/importer-B1wmPQjr.js";
|
|
21
|
+
import { D as D3, a as a10 } from "./chunks/importer-B1wmPQjr.js";
|
|
17
22
|
import { gexfImporter, gexfExporter } from "./gexf.js";
|
|
18
23
|
import { GEXF_1_2_CAPABILITIES, GEXF_ISSUE, GEXF_LOSS } from "./gexf.js";
|
|
19
24
|
import { gmlImporter, gmlExporter } from "./gml.js";
|
|
20
25
|
import { GML_ISSUE, GML_LOSS } from "./gml.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { G as G3, J as J2, a as a14, b as b2, d as d2, f as f2, h as h2, j as j2, n as n2, s as s2, g as g2 } from "./chunks/importer-eUREhBGj.js";
|
|
26
|
+
import { a as graphmlImporter, g as graphmlExporter } from "./chunks/importer-DpEW5zeG.js";
|
|
27
|
+
import { r as rankFormats, S as SNIFF_HEAD_BYTES, e as jsonImporter, c as jsonExporter } from "./chunks/exporter-D23CKNqF.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-D23CKNqF.js";
|
|
25
29
|
import { neo4jImporter, neo4jExporter } from "./neo4j.js";
|
|
26
|
-
import { ID_SPACE_COLUMN, LABELS_COLUMN, NEO4J_CAPABILITIES, NEO4J_ISSUE, NEO4J_LOSS, ORIGINAL_ID_COLUMN, TYPE_COLUMN } from "./neo4j.js";
|
|
27
|
-
import {
|
|
28
|
-
import { O as
|
|
29
|
-
import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-
|
|
30
|
-
import { P as P2, a as
|
|
31
|
-
import { x as xgmmlExporter } from "./chunks/exporter-
|
|
32
|
-
import { x as xgmmlImporter } from "./chunks/importer-
|
|
33
|
-
import { X as X2, a as
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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-DhtW6FxK.js";
|
|
32
|
+
import { O, a as a12, b as b12 } from "./chunks/exporter-DhtW6FxK.js";
|
|
33
|
+
import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-z_FL4VMb.js";
|
|
34
|
+
import { P as P2, a as a13 } from "./chunks/importer-z_FL4VMb.js";
|
|
35
|
+
import { x as xgmmlExporter } from "./chunks/exporter-DfWTgrti.js";
|
|
36
|
+
import { x as xgmmlImporter } from "./chunks/importer-B2W_58pz.js";
|
|
37
|
+
import { X as X2, a as a14 } from "./chunks/importer-B2W_58pz.js";
|
|
38
|
+
import { G as G3, a as a15 } from "./chunks/constants-ikG85dT8.js";
|
|
39
|
+
import { X as X3, b as b13, h as h3, t as t3, x as x2 } from "./chunks/escape-D1HPTUrP.js";
|
|
40
|
+
const USED = /* @__PURE__ */ new Set(["ids", "defaultDirected", "weightFrom", "addMissingNodes"]);
|
|
41
|
+
function defineLineFormat(definition) {
|
|
42
|
+
const { format, extensions, mimeTypes = [], directed = false, comment = "#", sniff: sniff2, parseLine } = definition;
|
|
43
|
+
const importer = {
|
|
44
|
+
format,
|
|
45
|
+
extensions,
|
|
46
|
+
mimeTypes,
|
|
47
|
+
options: [],
|
|
48
|
+
import: async (input, sink, options) => {
|
|
49
|
+
const opts = resolveImportOptions(options, {
|
|
50
|
+
ids: "canonical",
|
|
51
|
+
defaultDirected: directed,
|
|
52
|
+
weightFrom: "weight"
|
|
53
|
+
});
|
|
54
|
+
const report = new ImportReportBuilder(format, opts.errorLimit);
|
|
55
|
+
reportSinkOptions(sink, options, report);
|
|
56
|
+
reportUnusedOptions(options, report, USED);
|
|
57
|
+
const ids = new IdCoercer(opts.ids);
|
|
58
|
+
const edges = new DirectionResolver(sink, report, opts.onMixedDirection);
|
|
59
|
+
const kind = opts.defaultDirected ? "directed" : "undirected";
|
|
60
|
+
edges.setHeader(opts.defaultDirected);
|
|
61
|
+
const attributes = new AttributeWriter(sink, report, opts.weightFrom);
|
|
62
|
+
const write = (domain, row, values) => {
|
|
63
|
+
attributes.write(domain, row, values);
|
|
64
|
+
};
|
|
65
|
+
const addNode = (id) => {
|
|
66
|
+
const nodeId = ids.text(id);
|
|
67
|
+
if (sink.indexOf(nodeId) === INVALID_INDEX) {
|
|
68
|
+
report.counts.nodes++;
|
|
69
|
+
}
|
|
70
|
+
return sink.addNode(nodeId);
|
|
71
|
+
};
|
|
72
|
+
let line = 0;
|
|
73
|
+
const graph = {
|
|
74
|
+
node: (id, attributes2) => {
|
|
75
|
+
write("node", addNode(id), attributes2);
|
|
76
|
+
},
|
|
77
|
+
edge: (source, target, attributes2) => {
|
|
78
|
+
const raw = opts.weightFrom === null ? void 0 : attributes2?.[opts.weightFrom];
|
|
79
|
+
const weight = raw === null || raw === void 0 ? void 0 : parseWeightText(String(raw), report);
|
|
80
|
+
const [s3, t4] = [ids.text(source), ids.text(target)];
|
|
81
|
+
const added = new Set([s3, t4].filter((id) => sink.indexOf(id) === INVALID_INDEX)).size;
|
|
82
|
+
const edge = edges.addEdge(s3, t4, kind, weight, { line });
|
|
83
|
+
report.counts.nodes += added;
|
|
84
|
+
report.counts.edges++;
|
|
85
|
+
write("edge", edge, attributes2);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const lines = new LineReader(input, report, opts);
|
|
89
|
+
for await (const text of lines) {
|
|
90
|
+
({ line } = lines);
|
|
91
|
+
if (line % 64 === 0) {
|
|
92
|
+
throwIfAborted(opts.signal);
|
|
93
|
+
}
|
|
94
|
+
const trimmed = text.trim();
|
|
95
|
+
if (trimmed === "" || comment !== null && trimmed.startsWith(comment)) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
parseLine(trimmed.split(/\s+/), graph, text);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
recordLineError(report, err, line);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
throwIfAborted(opts.signal);
|
|
105
|
+
return report.finish();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return Object.freeze(sniff2 === void 0 ? importer : { ...importer, sniff: sniff2 });
|
|
109
|
+
}
|
|
110
|
+
function recordLineError(report, err, line) {
|
|
111
|
+
if (isAbortError(err)) {
|
|
112
|
+
throw err;
|
|
113
|
+
}
|
|
114
|
+
if (err instanceof GraphFormatError) {
|
|
115
|
+
report.recordError(err, { line });
|
|
116
|
+
} else {
|
|
117
|
+
report.error("parse-error", BAD_LINE_CODE, err instanceof Error ? err.message : messageOf(err), { line });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
class AttributeWriter {
|
|
121
|
+
/**
|
|
122
|
+
* Create a writer.
|
|
123
|
+
* @param sink - the sink
|
|
124
|
+
* @param report - the report
|
|
125
|
+
* @param weightFrom - the edge attribute read as the weight (not written as a column), or null
|
|
126
|
+
*/
|
|
127
|
+
constructor(sink, report, weightFrom) {
|
|
128
|
+
this.sink = sink;
|
|
129
|
+
this.report = report;
|
|
130
|
+
this.weightFrom = weightFrom;
|
|
131
|
+
this.writers = { node: /* @__PURE__ */ new Map(), edge: /* @__PURE__ */ new Map() };
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Write one element's attributes; null and undefined values are left unset.
|
|
135
|
+
* @param domain - node or edge
|
|
136
|
+
* @param row - the element's index
|
|
137
|
+
* @param attributes - the attributes, or undefined
|
|
138
|
+
*/
|
|
139
|
+
write(domain, row, attributes) {
|
|
140
|
+
for (const [name, value] of Object.entries(attributes ?? {})) {
|
|
141
|
+
if (value === null || value === void 0 || domain === "edge" && name === this.weightFrom) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (name === "label") {
|
|
145
|
+
this.writeLabel(domain, row, String(value));
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
let writer = this.writers[domain].get(name);
|
|
149
|
+
if (writer === void 0) {
|
|
150
|
+
writer = new TextCellWriter(name, domain, this.sink, this.report);
|
|
151
|
+
this.writers[domain].set(name, writer);
|
|
152
|
+
}
|
|
153
|
+
writer.write(row, String(value));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Write a label: text, whatever it looks like, in the column that byRole("label") finds.
|
|
158
|
+
* @param domain - node or edge
|
|
159
|
+
* @param row - the element's index
|
|
160
|
+
* @param text - the label
|
|
161
|
+
*/
|
|
162
|
+
writeLabel(domain, row, text) {
|
|
163
|
+
const decl = { name: "label", dtype: "string", role: "label" };
|
|
164
|
+
if (domain === "node") {
|
|
165
|
+
this.sink.setNodeValue(this.sink.declareNodeColumn(decl), row, text);
|
|
166
|
+
} else {
|
|
167
|
+
this.sink.setEdgeValue(this.sink.declareEdgeColumn(decl), row, text);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function compareSnapshots(expected, actual, options = {}) {
|
|
172
|
+
const diffs = [];
|
|
173
|
+
const limit = options.limit ?? 50;
|
|
174
|
+
const tolerance = options.tolerance ?? 0;
|
|
175
|
+
const ctx = {
|
|
176
|
+
options,
|
|
177
|
+
diff: (path, e3, a16, message) => {
|
|
178
|
+
diffs.push({
|
|
179
|
+
path,
|
|
180
|
+
expected: e3,
|
|
181
|
+
actual: a16,
|
|
182
|
+
message: message ?? `${path}: expected ${show(e3)}, got ${show(a16)}`
|
|
183
|
+
});
|
|
184
|
+
if (diffs.length >= limit) {
|
|
185
|
+
throw new LimitReached();
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
same: (e3, a16) => valuesEqual(e3, a16, tolerance)
|
|
189
|
+
};
|
|
190
|
+
try {
|
|
191
|
+
compareGraphs(expected, actual, ctx);
|
|
192
|
+
} catch (err) {
|
|
193
|
+
if (!(err instanceof LimitReached)) {
|
|
194
|
+
throw err;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return diffs;
|
|
198
|
+
}
|
|
199
|
+
class LimitReached extends Error {
|
|
200
|
+
}
|
|
201
|
+
function compareGraphs(expected, actual, ctx) {
|
|
202
|
+
const { diff } = ctx;
|
|
203
|
+
if (expected.directed !== actual.directed) {
|
|
204
|
+
diff("directed", expected.directed, actual.directed);
|
|
205
|
+
}
|
|
206
|
+
if (expected.nodeCount !== actual.nodeCount) {
|
|
207
|
+
diff("nodeCount", expected.nodeCount, actual.nodeCount);
|
|
208
|
+
}
|
|
209
|
+
if (expected.edgeCount !== actual.edgeCount) {
|
|
210
|
+
diff("edgeCount", expected.edgeCount, actual.edgeCount);
|
|
211
|
+
}
|
|
212
|
+
compareIds(expected, actual, diff);
|
|
213
|
+
if (expected.nodeCount !== actual.nodeCount || expected.edgeCount !== actual.edgeCount) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
compareTopology(expected, actual, diff);
|
|
217
|
+
compareWeights(expected, actual, ctx);
|
|
218
|
+
compareTables("nodes", expected.nodes, actual.nodes, ctx);
|
|
219
|
+
compareTables("edges", expected.edges, actual.edges, ctx);
|
|
220
|
+
compareTables("graph", expected.graph, actual.graph, ctx);
|
|
221
|
+
if (ctx.options.extensions !== false) {
|
|
222
|
+
compareExtensions(expected, actual, ctx);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function compareIds(expected, actual, diff) {
|
|
226
|
+
const expectedIds = expected.ids.toArray();
|
|
227
|
+
const actualIds = actual.ids.toArray();
|
|
228
|
+
const n3 = Math.min(expectedIds.length, actualIds.length);
|
|
229
|
+
for (let i4 = 0; i4 < n3; i4++) {
|
|
230
|
+
if (!Object.is(expectedIds[i4], actualIds[i4])) {
|
|
231
|
+
diff(`ids[${i4}]`, expectedIds[i4], actualIds[i4]);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function compareTopology(expected, actual, diff) {
|
|
236
|
+
if (!typedEqual(expected.rowPtr, actual.rowPtr)) {
|
|
237
|
+
diff("rowPtr", expected.rowPtr, actual.rowPtr, "rowPtr differs");
|
|
238
|
+
}
|
|
239
|
+
if (!typedEqual(expected.colIdx, actual.colIdx)) {
|
|
240
|
+
diff("colIdx", expected.colIdx, actual.colIdx, "colIdx differs");
|
|
241
|
+
}
|
|
242
|
+
const el = expected.edgeList();
|
|
243
|
+
const al = actual.edgeList();
|
|
244
|
+
for (let e3 = 0; e3 < expected.edgeCount; e3++) {
|
|
245
|
+
if (el.src[e3] !== al.src[e3] || el.dst[e3] !== al.dst[e3]) {
|
|
246
|
+
diff(`edge[${e3}]`, `${el.src[e3]}->${el.dst[e3]}`, `${al.src[e3]}->${al.dst[e3]}`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function compareWeights(expected, actual, ctx) {
|
|
251
|
+
if (expected.flags.weighted !== actual.flags.weighted) {
|
|
252
|
+
ctx.diff("flags.weighted", expected.flags.weighted, actual.flags.weighted);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (!expected.flags.weighted) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const eShadow = expected.edges.byRole("weight");
|
|
259
|
+
const aShadow = actual.edges.byRole("weight");
|
|
260
|
+
if (eShadow !== null && aShadow !== null) {
|
|
261
|
+
compareExactWeights(expected.edgeCount, eShadow, aShadow, ctx);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (ctx.options.weightExplicitness !== false && eShadow === null !== (aShadow === null)) {
|
|
265
|
+
ctx.diff(
|
|
266
|
+
"weightColumn",
|
|
267
|
+
eShadow !== null,
|
|
268
|
+
aShadow !== null,
|
|
269
|
+
"one snapshot has a role-weight column, the other does not"
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
const ew = expected.edgeList().weights;
|
|
273
|
+
const aw = actual.edgeList().weights;
|
|
274
|
+
for (let e3 = 0; e3 < expected.edgeCount; e3++) {
|
|
275
|
+
const ev = ew === null ? 1 : ew[e3];
|
|
276
|
+
const av = aw === null ? 1 : aw[e3];
|
|
277
|
+
if (!ctx.same(ev, av)) {
|
|
278
|
+
ctx.diff(`weight[${e3}]`, ev, av);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function compareExactWeights(edgeCount, expected, actual, ctx) {
|
|
283
|
+
for (let e3 = 0; e3 < edgeCount; e3++) {
|
|
284
|
+
const eSet = expected.isSet(e3);
|
|
285
|
+
const aSet = actual.isSet(e3);
|
|
286
|
+
if (ctx.options.weightExplicitness !== false && eSet !== aSet) {
|
|
287
|
+
ctx.diff(`weightExplicit[${e3}]`, eSet, aSet);
|
|
288
|
+
} else if (eSet && aSet && !ctx.same(expected.value(e3), actual.value(e3))) {
|
|
289
|
+
ctx.diff(`weight[${e3}]`, expected.value(e3), actual.value(e3));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function compareExtensions(expected, actual, ctx) {
|
|
294
|
+
for (const [name, table] of expected.extensions) {
|
|
295
|
+
const other = actual.extensions.get(name);
|
|
296
|
+
if (other === void 0) {
|
|
297
|
+
ctx.diff(`extensions.${name}`, "present", "absent");
|
|
298
|
+
} else if (table.rowCount === other.rowCount) {
|
|
299
|
+
compareTables(`extensions.${name}`, table, other, ctx);
|
|
300
|
+
} else {
|
|
301
|
+
ctx.diff(`extensions.${name}.rowCount`, table.rowCount, other.rowCount);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
if (ctx.options.allowExtraColumns === false) {
|
|
305
|
+
for (const name of actual.extensions.keys()) {
|
|
306
|
+
if (!expected.extensions.has(name)) {
|
|
307
|
+
ctx.diff(`extensions.${name}`, "absent", "present");
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function compareTables(label, expected, actual, ctx) {
|
|
313
|
+
const ignoreNames = new Set(ctx.options.ignoreColumns ?? []);
|
|
314
|
+
const ignoreRoles = new Set(ctx.options.ignoreRoles ?? []);
|
|
315
|
+
const skip = (column) => {
|
|
316
|
+
const { name, role } = column.meta;
|
|
317
|
+
return ignoreNames.has(name) || role !== null && (ignoreRoles.has(role) || label === "edges" && role === "weight");
|
|
318
|
+
};
|
|
319
|
+
for (const column of expected) {
|
|
320
|
+
if (skip(column)) {
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
const path = `${label}.${column.meta.name}`;
|
|
324
|
+
const other = actual.get(column.meta.name);
|
|
325
|
+
if (other === null) {
|
|
326
|
+
ctx.diff(path, "present", "absent", `${path}: column missing after round trip`);
|
|
327
|
+
} else {
|
|
328
|
+
compareColumn(path, column, other, ctx);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (ctx.options.allowExtraColumns === false) {
|
|
332
|
+
for (const column of actual) {
|
|
333
|
+
if (!skip(column) && expected.get(column.meta.name) === null) {
|
|
334
|
+
const path = `${label}.${column.meta.name}`;
|
|
335
|
+
ctx.diff(path, "absent", "present", `${path}: extra column after round trip`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function compareColumn(path, column, other, ctx) {
|
|
341
|
+
compareDeclaration(path, column, other, ctx);
|
|
342
|
+
if (column.length !== other.length) {
|
|
343
|
+
ctx.diff(`${path}.length`, column.length, other.length);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
for (let r2 = 0; r2 < column.length; r2++) {
|
|
347
|
+
const eSet = column.isSet(r2);
|
|
348
|
+
const aSet = other.isSet(r2);
|
|
349
|
+
if (eSet !== aSet) {
|
|
350
|
+
ctx.diff(`${path}[${r2}]`, eSet ? column.value(r2) : void 0, aSet ? other.value(r2) : void 0);
|
|
351
|
+
} else if (eSet) {
|
|
352
|
+
const ev = cellValue(column, r2);
|
|
353
|
+
const av = cellValue(other, r2);
|
|
354
|
+
if (!ctx.same(ev, av)) {
|
|
355
|
+
ctx.diff(`${path}[${r2}]`, ev, av);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function compareDeclaration(path, column, other, ctx) {
|
|
361
|
+
const { options, diff } = ctx;
|
|
362
|
+
const e3 = column.meta;
|
|
363
|
+
const a16 = other.meta;
|
|
364
|
+
if (options.dtypes !== false) {
|
|
365
|
+
for (const key of ["dtype", "itemDtype", "components"]) {
|
|
366
|
+
if (e3[key] !== a16[key]) {
|
|
367
|
+
diff(`${path}.${key}`, e3[key], a16[key]);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (options.roles !== false && e3.role !== a16.role) {
|
|
372
|
+
diff(`${path}.role`, e3.role, a16.role);
|
|
373
|
+
}
|
|
374
|
+
const eType = e3.origin?.type ?? null;
|
|
375
|
+
const aType = a16.origin?.type ?? null;
|
|
376
|
+
if (options.originType === true && eType !== aType) {
|
|
377
|
+
diff(`${path}.origin.type`, eType, aType);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function cellValue(column, row) {
|
|
381
|
+
switch (column.dtype) {
|
|
382
|
+
case "list":
|
|
383
|
+
return [...column.sliceOf(row)];
|
|
384
|
+
case "json":
|
|
385
|
+
return column.values[row];
|
|
386
|
+
default: {
|
|
387
|
+
const value = column.value(row);
|
|
388
|
+
return ArrayBuffer.isView(value) ? Array.from(value) : value;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function valuesEqual(e3, a16, tolerance) {
|
|
393
|
+
if (typeof e3 === "number" && typeof a16 === "number") {
|
|
394
|
+
if (Object.is(e3, a16)) {
|
|
395
|
+
return true;
|
|
396
|
+
}
|
|
397
|
+
return Number.isFinite(e3) && Number.isFinite(a16) && Math.abs(e3 - a16) <= tolerance;
|
|
398
|
+
}
|
|
399
|
+
if (Array.isArray(e3) || ArrayBuffer.isView(e3)) {
|
|
400
|
+
const ea = Array.from(e3);
|
|
401
|
+
if (!(Array.isArray(a16) || ArrayBuffer.isView(a16))) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
const aa2 = Array.from(a16);
|
|
405
|
+
return ea.length === aa2.length && ea.every((v2, i4) => valuesEqual(v2, aa2[i4], tolerance));
|
|
406
|
+
}
|
|
407
|
+
if (typeof e3 === "object" && e3 !== null && typeof a16 === "object" && a16 !== null) {
|
|
408
|
+
const eo = e3;
|
|
409
|
+
const ao = a16;
|
|
410
|
+
const keys = Object.keys(eo);
|
|
411
|
+
if (keys.length !== Object.keys(ao).length) {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
return keys.every((k2) => Object.hasOwn(ao, k2) && valuesEqual(eo[k2], ao[k2], tolerance));
|
|
415
|
+
}
|
|
416
|
+
return Object.is(e3, a16);
|
|
417
|
+
}
|
|
418
|
+
function typedEqual(a16, b14) {
|
|
419
|
+
if (a16.length !== b14.length) {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
for (let i4 = 0; i4 < a16.length; i4++) {
|
|
423
|
+
if (a16[i4] !== b14[i4]) {
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
function show(v2) {
|
|
430
|
+
if (ArrayBuffer.isView(v2)) {
|
|
431
|
+
const items = Array.from(v2);
|
|
432
|
+
return `[${items.slice(0, 8).join(", ")}${items.length > 8 ? ", ..." : ""}]`;
|
|
433
|
+
}
|
|
434
|
+
try {
|
|
435
|
+
const text = JSON.stringify(v2);
|
|
436
|
+
return text ?? String(v2);
|
|
437
|
+
} catch {
|
|
438
|
+
return String(v2);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
function describeDiffs(diffs) {
|
|
442
|
+
return diffs.length === 0 ? "no differences" : diffs.map((d4) => ` - ${d4.message}`).join("\n");
|
|
443
|
+
}
|
|
39
444
|
const TOO_MANY_EMPTY_CELLS_CODE = "E_TOO_MANY_EMPTY_CELLS";
|
|
40
445
|
const DEFAULT_MAX_EMPTY_CELLS = 2 ** 24;
|
|
41
446
|
function maxEmptyCellsOption(value) {
|
|
@@ -152,7 +557,7 @@ class CellBudgetBuilder extends GraphBuilder {
|
|
|
152
557
|
if (empty > this.maxEmptyCells) {
|
|
153
558
|
new ImportReportBuilder(this.format, Infinity).fail(
|
|
154
559
|
TOO_MANY_EMPTY_CELLS_CODE,
|
|
155
|
-
`the attributes are too sparse: ${this.nodeColumns.size} node and ${this.edgeColumns.size} edge attribute
|
|
560
|
+
`the attributes are too sparse: ${this.nodeColumns.size} node and ${this.edgeColumns.size} edge attribute columns over ${this.nodeBound} node${plural(this.nodeBound)} and ${this.edgeBound} edge${plural(this.edgeBound)} would allocate more than ${this.maxEmptyCells} slots that hold no value; pass a larger maxEmptyCells (or Infinity) to read the file anyway`,
|
|
156
561
|
void 0,
|
|
157
562
|
{ emptyCells: empty, maxEmptyCells: this.maxEmptyCells }
|
|
158
563
|
);
|
|
@@ -160,6 +565,35 @@ class CellBudgetBuilder extends GraphBuilder {
|
|
|
160
565
|
}
|
|
161
566
|
}
|
|
162
567
|
const UNKNOWN_FORMAT_CODE = "E_UNKNOWN_FORMAT";
|
|
568
|
+
const SNIFF_FAILED_CODE = "W_SNIFF_FAILED";
|
|
569
|
+
const FUNCTION_OPTIONS = /* @__PURE__ */ new Set([
|
|
570
|
+
"addMissingNodes",
|
|
571
|
+
"builder",
|
|
572
|
+
"defaultDirected",
|
|
573
|
+
"duplicateEdges",
|
|
574
|
+
"encoding",
|
|
575
|
+
"errorLimit",
|
|
576
|
+
"filename",
|
|
577
|
+
"format",
|
|
578
|
+
"freeze",
|
|
579
|
+
"graphIndex",
|
|
580
|
+
"graphName",
|
|
581
|
+
"hyperedges",
|
|
582
|
+
"ids",
|
|
583
|
+
"long",
|
|
584
|
+
"maxEmptyCells",
|
|
585
|
+
"mimeType",
|
|
586
|
+
"nodeIdFrom",
|
|
587
|
+
"onMixedDirection",
|
|
588
|
+
"onProgress",
|
|
589
|
+
"request",
|
|
590
|
+
"restoreMangledIds",
|
|
591
|
+
"sanitizeIds",
|
|
592
|
+
"selfLoops",
|
|
593
|
+
"signal",
|
|
594
|
+
"weightDtype",
|
|
595
|
+
"weightFrom"
|
|
596
|
+
]);
|
|
163
597
|
const REGISTRY_KEYS = /* @__PURE__ */ new Set([
|
|
164
598
|
"format",
|
|
165
599
|
"filename",
|
|
@@ -254,10 +688,10 @@ class FormatRegistry {
|
|
|
254
688
|
return [.../* @__PURE__ */ new Set([...this.importerMap.keys(), ...this.exporterMap.keys()])];
|
|
255
689
|
}
|
|
256
690
|
/**
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* @param hints -
|
|
260
|
-
* @returns the candidates, best first; empty when
|
|
691
|
+
* Every format that could be the input, best first, from the same hints as sniff(): use it to
|
|
692
|
+
* offer the user a choice when the best guess is not certain.
|
|
693
|
+
* @param hints - `{ filename, mimeType, head }`, any of them
|
|
694
|
+
* @returns the candidates, best first; empty when no format claims the input
|
|
261
695
|
*/
|
|
262
696
|
sniffAll(hints) {
|
|
263
697
|
return rankFormats(hints, this.importerMap.values());
|
|
@@ -272,39 +706,112 @@ class FormatRegistry {
|
|
|
272
706
|
return ranked.length > 0 ? ranked[0] : null;
|
|
273
707
|
}
|
|
274
708
|
/**
|
|
275
|
-
* Read
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* An input holding several graphs yields the first, with a warning naming how many were
|
|
280
|
-
* skipped; importAllGraphs() returns every one.
|
|
709
|
+
* Read a graph from a string, bytes or a stream. The format is the one you name in `format`,
|
|
710
|
+
* else it is detected from `filename`, `mimeType` and the first bytes of the content. From an
|
|
711
|
+
* input that holds several graphs, it reads the one `graphIndex` or `graphName` chooses, else
|
|
712
|
+
* the first, with a W_MULTIPLE_GRAPHS warning; importAllGraphs() returns every one.
|
|
281
713
|
* @param input - the text, bytes, stream or chunks to read
|
|
282
714
|
* @param options - the format, hints, common and format-specific import options
|
|
283
|
-
* @returns the snapshot, the
|
|
715
|
+
* @returns the graph (`snapshot`), the format it was read as, and the import report
|
|
284
716
|
*/
|
|
285
717
|
async importGraph(input, options = {}) {
|
|
286
|
-
const
|
|
287
|
-
const
|
|
718
|
+
const opts = options;
|
|
719
|
+
const picked = await this.choose(input, opts);
|
|
720
|
+
const unknown = this.unknownOptions(opts).map(
|
|
721
|
+
(name) => Object.freeze({
|
|
722
|
+
category: "unsupported",
|
|
723
|
+
severity: "warning",
|
|
724
|
+
code: UNKNOWN_OPTION_CODE,
|
|
725
|
+
message: unknownOptionText(name),
|
|
726
|
+
line: null,
|
|
727
|
+
element: name
|
|
728
|
+
})
|
|
729
|
+
);
|
|
730
|
+
const chosen = unknown.length === 0 ? picked : { ...picked, warnings: [...picked.warnings, ...unknown] };
|
|
731
|
+
const { importer } = chosen;
|
|
732
|
+
if ((opts.graphIndex !== void 0 || opts.graphName !== void 0) && importer.importAll !== void 0 && importer.listGraphs === void 0) {
|
|
733
|
+
const all = await this.readAll(chosen, opts);
|
|
734
|
+
const names = all.map((r2) => r2.snapshot.meta.name);
|
|
735
|
+
return all[chooseGraph(names, opts, new ImportReportBuilder(importer.format, 0))];
|
|
736
|
+
}
|
|
737
|
+
let builder;
|
|
288
738
|
let report;
|
|
289
739
|
try {
|
|
290
|
-
|
|
740
|
+
builder = seededBuilder(opts, chosen.importer.format);
|
|
741
|
+
report = await chosen.importer.import(chosen.source, builder, importerOptions(opts));
|
|
291
742
|
} catch (err) {
|
|
292
743
|
await chosen.peeked?.close();
|
|
293
|
-
throw err;
|
|
744
|
+
throw chosen.sniff === null ? notReadableAs(err, importer.format, opts.filename) : err;
|
|
745
|
+
}
|
|
746
|
+
return result(chosen, builder, report, opts);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Fetch a graph file from a URL and load it; see the top-level loadFromUrl() for the full
|
|
750
|
+
* description.
|
|
751
|
+
* @param url - an absolute URL, or in a browser one relative to the page
|
|
752
|
+
* @param options - import options, plus `request` for fetch
|
|
753
|
+
* @returns the graph, the format it was read as, and the import report
|
|
754
|
+
*/
|
|
755
|
+
async loadFromUrl(url, options = {}) {
|
|
756
|
+
const opts = options;
|
|
757
|
+
const { request, ...rest } = opts;
|
|
758
|
+
const signal = request?.signal ?? rest.signal ?? null;
|
|
759
|
+
const method = request?.method ?? "GET";
|
|
760
|
+
const where = `${method} ${String(url)}`;
|
|
761
|
+
let response;
|
|
762
|
+
try {
|
|
763
|
+
response = await fetch(url, { signal: rest.signal, ...request });
|
|
764
|
+
} catch (err) {
|
|
765
|
+
if (signal?.aborted === true || isAbortError(err)) {
|
|
766
|
+
throw err;
|
|
767
|
+
}
|
|
768
|
+
return fetchFailed(rest, url, `${where} failed: ${fetchErrorText(url, err)}`, null, err);
|
|
769
|
+
}
|
|
770
|
+
if (!response.ok) {
|
|
771
|
+
await response.body?.cancel().catch(() => void 0);
|
|
772
|
+
const status = `${String(response.status)} ${response.statusText}`.trim();
|
|
773
|
+
return fetchFailed(rest, url, `${where} failed: ${status}`, response.status, null);
|
|
294
774
|
}
|
|
295
|
-
return
|
|
775
|
+
return this.importGraph(response.body ?? new Uint8Array(0), {
|
|
776
|
+
...rest,
|
|
777
|
+
filename: rest.filename ?? urlFilename(url),
|
|
778
|
+
mimeType: rest.mimeType ?? response.headers.get("content-type")
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Load a graph from a File or Blob; see the top-level loadFromFile() for the full description.
|
|
783
|
+
* @param file - the File or Blob to read
|
|
784
|
+
* @param options - the same options as importGraph()
|
|
785
|
+
* @returns the graph, the format it was read as, and the import report
|
|
786
|
+
*/
|
|
787
|
+
loadFromFile(file, options = {}) {
|
|
788
|
+
const opts = options;
|
|
789
|
+
const { name } = file;
|
|
790
|
+
return this.importGraph(file.stream(), {
|
|
791
|
+
...opts,
|
|
792
|
+
filename: opts.filename ?? (typeof name === "string" ? name : null),
|
|
793
|
+
mimeType: opts.mimeType ?? (file.type === "" ? null : file.type)
|
|
794
|
+
});
|
|
296
795
|
}
|
|
297
796
|
/**
|
|
298
797
|
* Read every graph of an input (a DOT file with several graphs, a Pajek project with several
|
|
299
|
-
* networks, a JGF document with a `graphs` array), each
|
|
300
|
-
*
|
|
301
|
-
* entry. Options, sniffing and the builder seed are those of importGraph().
|
|
798
|
+
* networks, a JGF document with a `graphs` array), each as its own snapshot. A format that holds
|
|
799
|
+
* one graph per file gives one result. Options and detection are those of importGraph().
|
|
302
800
|
* @param input - the text, bytes, stream or chunks to read
|
|
303
801
|
* @param options - the format, hints, common and format-specific import options
|
|
304
802
|
* @returns one result per graph, in document order
|
|
305
803
|
*/
|
|
306
804
|
async importAllGraphs(input, options = {}) {
|
|
307
|
-
const
|
|
805
|
+
const opts = options;
|
|
806
|
+
return this.readAll(await this.choose(input, opts), opts);
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Read every graph of an input with the chosen importer.
|
|
810
|
+
* @param chosen - the importer and the input to hand it
|
|
811
|
+
* @param options - the importGraph options
|
|
812
|
+
* @returns one result per graph, in document order
|
|
813
|
+
*/
|
|
814
|
+
async readAll(chosen, options) {
|
|
308
815
|
const { importer } = chosen;
|
|
309
816
|
const builders = [];
|
|
310
817
|
let reports;
|
|
@@ -325,9 +832,18 @@ class FormatRegistry {
|
|
|
325
832
|
}
|
|
326
833
|
} catch (err) {
|
|
327
834
|
await chosen.peeked?.close();
|
|
328
|
-
throw
|
|
835
|
+
throw inGraph(
|
|
836
|
+
chosen.sniff === null ? notReadableAs(err, importer.format, options.filename) : err,
|
|
837
|
+
builders.length - 1
|
|
838
|
+
);
|
|
329
839
|
}
|
|
330
|
-
return reports.map((report,
|
|
840
|
+
return reports.map((report, i4) => {
|
|
841
|
+
try {
|
|
842
|
+
return result(chosen, builders[i4], report, options);
|
|
843
|
+
} catch (err) {
|
|
844
|
+
throw inGraph(err, i4);
|
|
845
|
+
}
|
|
846
|
+
});
|
|
331
847
|
}
|
|
332
848
|
/**
|
|
333
849
|
* The graphs of an input that can hold several, without importing them (a Cytoscape session's
|
|
@@ -339,39 +855,84 @@ class FormatRegistry {
|
|
|
339
855
|
* list its graphs (importGraph() then reads the first)
|
|
340
856
|
*/
|
|
341
857
|
async listGraphs(input, options = {}) {
|
|
342
|
-
const
|
|
858
|
+
const opts = options;
|
|
859
|
+
const chosen = await this.choose(input, opts);
|
|
343
860
|
try {
|
|
344
|
-
return chosen.importer.listGraphs === void 0 ? null : await chosen.importer.listGraphs(chosen.source, importerOptions(
|
|
861
|
+
return chosen.importer.listGraphs === void 0 ? null : await chosen.importer.listGraphs(chosen.source, importerOptions(opts));
|
|
345
862
|
} finally {
|
|
346
863
|
await chosen.peeked?.close();
|
|
347
864
|
}
|
|
348
865
|
}
|
|
349
866
|
/**
|
|
350
867
|
* The importer for an input: the named format, or the sniffed one.
|
|
351
|
-
* @param
|
|
868
|
+
* @param rawInput - the input as the caller passed it
|
|
352
869
|
* @param options - the importGraph options
|
|
353
870
|
* @returns the importer, the sniff, and the input to read (replayed for a stream)
|
|
354
871
|
*/
|
|
355
|
-
async choose(
|
|
872
|
+
async choose(rawInput, options) {
|
|
873
|
+
const input = normalizeInput(rawInput);
|
|
356
874
|
const requested = options.format ?? "auto";
|
|
357
875
|
if (requested !== "auto") {
|
|
358
|
-
return { importer: this.importer(requested), sniff: null, source: input, peeked: null };
|
|
359
|
-
}
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
876
|
+
return { importer: this.importer(requested), sniff: null, source: input, peeked: null, warnings: [] };
|
|
877
|
+
}
|
|
878
|
+
const common = resolveImportOptions(options, { ids: "keep", defaultDirected: true, weightFrom: null });
|
|
879
|
+
maxEmptyCellsOption(options.maxEmptyCells);
|
|
880
|
+
const peeked = await peekHead(input, SNIFF_HEAD_BYTES, common.signal);
|
|
881
|
+
const head = common.encoding !== null && peeked.head instanceof Uint8Array ? new TextDecoder(common.encoding).decode(peeked.head, { stream: true }) : peeked.head;
|
|
882
|
+
let sniff2;
|
|
883
|
+
const failures = new ImportReportBuilder("unknown", 0);
|
|
884
|
+
const warnings = [];
|
|
885
|
+
try {
|
|
886
|
+
const hints = { filename: options.filename, mimeType: options.mimeType, head };
|
|
887
|
+
const ranked = rankFormats(hints, this.importerMap.values(), (format, err) => {
|
|
888
|
+
warnings.push(
|
|
889
|
+
failures.warning(
|
|
890
|
+
"unsupported",
|
|
891
|
+
SNIFF_FAILED_CODE,
|
|
892
|
+
`the ${format} importer's sniff() threw (${messageOf(err)}); it was treated as not recognizing the input`,
|
|
893
|
+
{ element: format }
|
|
894
|
+
)
|
|
895
|
+
);
|
|
896
|
+
});
|
|
897
|
+
sniff2 = ranked.length > 0 ? ranked[0] : null;
|
|
898
|
+
} catch (err) {
|
|
899
|
+
await peeked.close();
|
|
900
|
+
throw err;
|
|
901
|
+
}
|
|
902
|
+
const foreign = foreignKind(peeked.head);
|
|
903
|
+
const claimed = sniff2 !== null && sniff2.content > 0 && !(foreign?.startsWith("an HTML") ?? false);
|
|
904
|
+
if (sniff2 === null || foreign !== null && !claimed) {
|
|
905
|
+
await peeked.close();
|
|
906
|
+
return this.refuseUndetected(failures, head, foreign, options);
|
|
907
|
+
}
|
|
908
|
+
return { importer: this.importer(sniff2.format), sniff: sniff2, source: peeked.input, peeked, warnings };
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Refuse an input no importer recognizes: empty, or not in a known graph format.
|
|
912
|
+
* @param failures - the report the error is recorded in
|
|
913
|
+
* @param head - the head, as sniffed
|
|
914
|
+
* @param foreign - what known non-graph file the head is, or null
|
|
915
|
+
* @param options - the importGraph options
|
|
916
|
+
* @returns never: always throws
|
|
917
|
+
*/
|
|
918
|
+
refuseUndetected(failures, head, foreign, options) {
|
|
919
|
+
const text = typeof head === "string" ? head : new TextDecoder().decode(head ?? new Uint8Array(0));
|
|
920
|
+
if (text.trim() === "" && text.length < SNIFF_HEAD_BYTES) {
|
|
921
|
+
return failures.fail(
|
|
922
|
+
EMPTY_INPUT_CODE,
|
|
923
|
+
text === "" ? "the input is empty" : "the input holds only whitespace"
|
|
369
924
|
);
|
|
370
925
|
}
|
|
371
|
-
|
|
926
|
+
const what = foreign === null ? "" : `: it is ${foreign}`;
|
|
927
|
+
return failures.fail(
|
|
928
|
+
UNKNOWN_FORMAT_CODE,
|
|
929
|
+
`the input is not in a graph format graph-io recognizes${describeHints(options)}${what}; if you know its format, pass it as the format option`,
|
|
930
|
+
void 0,
|
|
931
|
+
{ formats: this.formats() }
|
|
932
|
+
);
|
|
372
933
|
}
|
|
373
934
|
/**
|
|
374
|
-
* Write a snapshot in a format, as UTF-8 chunks
|
|
935
|
+
* Write a snapshot in a format, as UTF-8 chunks.
|
|
375
936
|
* @param snapshot - the snapshot
|
|
376
937
|
* @param format - the format name
|
|
377
938
|
* @param options - the exporter's common and format-specific options
|
|
@@ -390,6 +951,33 @@ class FormatRegistry {
|
|
|
390
951
|
async exportGraphToString(snapshot, format, options) {
|
|
391
952
|
return this.exporter(format).exportToString(snapshot, options);
|
|
392
953
|
}
|
|
954
|
+
/**
|
|
955
|
+
* Write a snapshot in a format as one buffer of UTF-8 bytes; see the top-level
|
|
956
|
+
* exportGraphToBytes().
|
|
957
|
+
* @param snapshot - the graph to write
|
|
958
|
+
* @param format - a format name where `canExport` is true
|
|
959
|
+
* @param options - sanitizeIds, onMixedDirection and the format's own options
|
|
960
|
+
* @returns the encoded file
|
|
961
|
+
*/
|
|
962
|
+
exportGraphToBytes(snapshot, format, options) {
|
|
963
|
+
return collectBytes(this.exportGraph(snapshot, format, options));
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Write a snapshot in a format as a Blob typed with the format's first MIME type; see the
|
|
967
|
+
* top-level exportGraphToBlob().
|
|
968
|
+
* @param snapshot - the graph to write
|
|
969
|
+
* @param format - a format name where `canExport` is true
|
|
970
|
+
* @param options - sanitizeIds, onMixedDirection and the format's own options
|
|
971
|
+
* @returns the file as a Blob
|
|
972
|
+
*/
|
|
973
|
+
async exportGraphToBlob(snapshot, format, options) {
|
|
974
|
+
const parts = [];
|
|
975
|
+
for await (const chunk of this.exportGraph(snapshot, format, options)) {
|
|
976
|
+
parts.push(chunk);
|
|
977
|
+
}
|
|
978
|
+
const info = this.listFormats().find((f3) => f3.format === format);
|
|
979
|
+
return new Blob(parts, { type: info?.mimeTypes[0] ?? "application/octet-stream" });
|
|
980
|
+
}
|
|
393
981
|
/**
|
|
394
982
|
* What exporting a snapshot in a format would lose, without writing anything.
|
|
395
983
|
* @param snapshot - the snapshot
|
|
@@ -398,13 +986,96 @@ class FormatRegistry {
|
|
|
398
986
|
* @returns the loss notes, empty when the export is exact
|
|
399
987
|
*/
|
|
400
988
|
checkExport(snapshot, format, options) {
|
|
401
|
-
|
|
989
|
+
const notes = this.exporter(format).check(snapshot, options);
|
|
990
|
+
const unknown = this.unknownOptions(options);
|
|
991
|
+
if (unknown.length === 0) {
|
|
992
|
+
return notes;
|
|
993
|
+
}
|
|
994
|
+
return Object.freeze([
|
|
995
|
+
...notes,
|
|
996
|
+
...unknown.map(
|
|
997
|
+
(name) => Object.freeze({
|
|
998
|
+
code: UNKNOWN_OPTION_CODE,
|
|
999
|
+
message: unknownOptionText(name),
|
|
1000
|
+
column: null,
|
|
1001
|
+
count: null
|
|
1002
|
+
})
|
|
1003
|
+
)
|
|
1004
|
+
]);
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* The option names no registered format and no load or save function takes (misspellings), or none while a
|
|
1008
|
+
* registered format does not list its options.
|
|
1009
|
+
* @param options - the caller's options
|
|
1010
|
+
* @returns the unknown names
|
|
1011
|
+
*/
|
|
1012
|
+
unknownOptions(options) {
|
|
1013
|
+
if (options === null || options === void 0) {
|
|
1014
|
+
return [];
|
|
1015
|
+
}
|
|
1016
|
+
const known = new Set(FUNCTION_OPTIONS);
|
|
1017
|
+
for (const plugin of [...this.importerMap.values(), ...this.exporterMap.values()]) {
|
|
1018
|
+
if (plugin.options === void 0) {
|
|
1019
|
+
return [];
|
|
1020
|
+
}
|
|
1021
|
+
for (const name of plugin.options) {
|
|
1022
|
+
known.add(name);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
return Object.entries(options).filter(([name, value]) => value !== void 0 && !known.has(name)).map(([name]) => name);
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Browser only: write a graph in a format and have the browser save it as a file; see the
|
|
1029
|
+
* top-level downloadGraph(). Use this method on a registry from createRegistry() to download
|
|
1030
|
+
* without bundling every built-in format.
|
|
1031
|
+
* @param snapshot - the graph to write
|
|
1032
|
+
* @param format - a format name from listFormats() where `canExport` is true
|
|
1033
|
+
* @param options - the export options, plus `filename`
|
|
1034
|
+
* @returns resolves once the download has been handed to the browser
|
|
1035
|
+
*/
|
|
1036
|
+
async downloadGraph(snapshot, format, options = {}) {
|
|
1037
|
+
if (typeof document === "undefined") {
|
|
1038
|
+
throw new GraphFormatError(
|
|
1039
|
+
"E_UNSUPPORTED",
|
|
1040
|
+
"downloadGraph() needs a browser document; use exportGraphToBytes() and write the bytes yourself"
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
const { filename, ...rest } = options;
|
|
1044
|
+
const blob = await this.exportGraphToBlob(snapshot, format, rest);
|
|
1045
|
+
const extension = this.listFormats().find((f3) => f3.format === format)?.extensions[0] ?? `.${format}`;
|
|
1046
|
+
const href = URL.createObjectURL(blob);
|
|
1047
|
+
const anchor = document.createElement("a");
|
|
1048
|
+
anchor.href = href;
|
|
1049
|
+
anchor.download = filename ?? `graph${extension}`;
|
|
1050
|
+
anchor.click();
|
|
1051
|
+
setTimeout(() => {
|
|
1052
|
+
URL.revokeObjectURL(href);
|
|
1053
|
+
}, 0);
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Every format this registry can read or write, in registration order; see the top-level
|
|
1057
|
+
* listFormats().
|
|
1058
|
+
* @returns one entry per format
|
|
1059
|
+
*/
|
|
1060
|
+
listFormats() {
|
|
1061
|
+
return this.formats().map((format) => {
|
|
1062
|
+
const importer = this.importerMap.get(format);
|
|
1063
|
+
const exporter = this.exporterMap.get(format);
|
|
1064
|
+
return Object.freeze({
|
|
1065
|
+
format,
|
|
1066
|
+
extensions: importer?.extensions ?? exporter?.extensions ?? [],
|
|
1067
|
+
mimeTypes: importer?.mimeTypes ?? exporter?.mimeTypes ?? [],
|
|
1068
|
+
canImport: importer !== void 0,
|
|
1069
|
+
canExport: exporter !== void 0,
|
|
1070
|
+
capabilities: exporter?.capabilities ?? null
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
402
1073
|
}
|
|
403
1074
|
}
|
|
404
1075
|
function createRegistry() {
|
|
405
|
-
return new FormatRegistry().registerImporter(jsonImporter).registerExporter(jsonExporter).registerImporter(graphmlImporter).registerExporter(graphmlExporter).registerImporter(gexfImporter).registerExporter(gexfExporter).registerImporter(csvImporter).registerExporter(csvExporter).registerImporter(gmlImporter).registerExporter(gmlExporter).registerImporter(dotImporter).registerExporter(dotExporter).registerImporter(pajekImporter).registerExporter(pajekExporter).registerImporter(neo4jImporter).registerExporter(neo4jExporter).registerImporter(xgmmlImporter).registerExporter(xgmmlExporter).registerImporter(cx2Importer).registerExporter(cx2Exporter).registerImporter(cxImporter).registerImporter(oboImporter).registerImporter(cysImporter);
|
|
1076
|
+
return new FormatRegistry().registerImporter(jsonImporter).registerExporter(jsonExporter).registerImporter(graphmlImporter).registerExporter(graphmlExporter).registerImporter(gexfImporter).registerExporter(gexfExporter).registerImporter(csvImporter).registerExporter(csvExporter).registerImporter(gmlImporter).registerExporter(gmlExporter).registerImporter(dotImporter).registerExporter(dotExporter).registerImporter(pajekImporter).registerExporter(pajekExporter).registerImporter(neo4jImporter).registerExporter(neo4jExporter).registerImporter(xgmmlImporter).registerExporter(xgmmlExporter).registerImporter(cx2Importer).registerExporter(cx2Exporter).registerImporter(cxImporter).registerExporter(cxExporter).registerImporter(oboImporter).registerExporter(oboExporter).registerImporter(cysImporter).registerExporter(cysExporter);
|
|
406
1077
|
}
|
|
407
|
-
const registry = createRegistry();
|
|
1078
|
+
const registry = /* @__PURE__ */ createRegistry();
|
|
408
1079
|
function importGraph(input, options) {
|
|
409
1080
|
return registry.importGraph(input, options);
|
|
410
1081
|
}
|
|
@@ -423,9 +1094,59 @@ async function exportGraphToString(snapshot, format, options) {
|
|
|
423
1094
|
function checkExport(snapshot, format, options) {
|
|
424
1095
|
return registry.checkExport(snapshot, format, options);
|
|
425
1096
|
}
|
|
1097
|
+
function loadFromUrl(url, options) {
|
|
1098
|
+
return registry.loadFromUrl(url, options);
|
|
1099
|
+
}
|
|
1100
|
+
function loadFromFile(file, options) {
|
|
1101
|
+
return registry.loadFromFile(file, options);
|
|
1102
|
+
}
|
|
1103
|
+
function exportGraphToBytes(snapshot, format, options) {
|
|
1104
|
+
return registry.exportGraphToBytes(snapshot, format, options);
|
|
1105
|
+
}
|
|
1106
|
+
function exportGraphToBlob(snapshot, format, options) {
|
|
1107
|
+
return registry.exportGraphToBlob(snapshot, format, options);
|
|
1108
|
+
}
|
|
1109
|
+
async function downloadGraph(snapshot, format, options = {}) {
|
|
1110
|
+
return registry.downloadGraph(snapshot, format, options);
|
|
1111
|
+
}
|
|
1112
|
+
function listFormats() {
|
|
1113
|
+
return registry.listFormats();
|
|
1114
|
+
}
|
|
426
1115
|
function sniff(hints) {
|
|
427
1116
|
return registry.sniff(hints);
|
|
428
1117
|
}
|
|
1118
|
+
function fetchFailed(options, url, message, status, cause) {
|
|
1119
|
+
const format = options.format === void 0 || options.format === "auto" ? "unknown" : options.format;
|
|
1120
|
+
return new ImportReportBuilder(format, 0).fail(FETCH_CODE, message, void 0, { url: String(url), status, cause });
|
|
1121
|
+
}
|
|
1122
|
+
function notReadableAs(err, format, filename) {
|
|
1123
|
+
if (!(err instanceof ImportError) || err.issue?.category !== "parse-error" || err.report.errorCount > 1 || err.report.counts.nodes + err.report.counts.edges > 0) {
|
|
1124
|
+
return err;
|
|
1125
|
+
}
|
|
1126
|
+
const what = filename === void 0 || filename === null ? "the input" : JSON.stringify(filename);
|
|
1127
|
+
return new ImportError(`${what} could not be read as ${format}: ${err.message}`, err.report, err.details);
|
|
1128
|
+
}
|
|
1129
|
+
function fetchErrorText(url, err) {
|
|
1130
|
+
let absolute = null;
|
|
1131
|
+
try {
|
|
1132
|
+
absolute = new URL(url);
|
|
1133
|
+
} catch {
|
|
1134
|
+
}
|
|
1135
|
+
if (absolute === null && globalThis.location === void 0) {
|
|
1136
|
+
return "a relative URL needs a web page to resolve against; outside a browser pass an absolute http(s) URL, or read a local file with loadFromFile() or importGraph()";
|
|
1137
|
+
}
|
|
1138
|
+
if (absolute?.protocol === "file:") {
|
|
1139
|
+
return "fetch() cannot read file: URLs here; read a local file with loadFromFile() or importGraph()";
|
|
1140
|
+
}
|
|
1141
|
+
const cause = err?.cause?.message;
|
|
1142
|
+
const detail = typeof cause === "string" && cause !== "" ? ` (${cause})` : "";
|
|
1143
|
+
return `the server could not be reached, or (in a browser) it does not allow this page to read the file (CORS)${detail}`;
|
|
1144
|
+
}
|
|
1145
|
+
function urlFilename(url) {
|
|
1146
|
+
const path = new URL(url, "http://localhost/").pathname;
|
|
1147
|
+
const name = path.slice(path.lastIndexOf("/") + 1);
|
|
1148
|
+
return name === "" ? null : name;
|
|
1149
|
+
}
|
|
429
1150
|
function importerOptions(options) {
|
|
430
1151
|
const out = {};
|
|
431
1152
|
for (const [key, value] of Object.entries(options)) {
|
|
@@ -437,6 +1158,21 @@ function importerOptions(options) {
|
|
|
437
1158
|
}
|
|
438
1159
|
function seededBuilder(options, format) {
|
|
439
1160
|
const maxEmptyCells = maxEmptyCellsOption(options.maxEmptyCells);
|
|
1161
|
+
try {
|
|
1162
|
+
return newBuilder(options, format, maxEmptyCells);
|
|
1163
|
+
} catch (err) {
|
|
1164
|
+
if (err instanceof GraphFormatError && err.code === "E_UNSUPPORTED" && typeof err.details.field === "string") {
|
|
1165
|
+
const option = err.details.field;
|
|
1166
|
+
throw new GraphFormatError(
|
|
1167
|
+
"E_UNSUPPORTED",
|
|
1168
|
+
`option ${option}: ${JSON.stringify(err.details.found)} is not one of the values it takes`,
|
|
1169
|
+
{ option, found: err.details.found }
|
|
1170
|
+
);
|
|
1171
|
+
}
|
|
1172
|
+
throw err;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
function newBuilder(options, format, maxEmptyCells) {
|
|
440
1176
|
return new CellBudgetBuilder(
|
|
441
1177
|
{
|
|
442
1178
|
weightDtype: options.weightDtype ?? "f64",
|
|
@@ -450,16 +1186,108 @@ function seededBuilder(options, format) {
|
|
|
450
1186
|
maxEmptyCells
|
|
451
1187
|
);
|
|
452
1188
|
}
|
|
1189
|
+
function inGraph(err, index) {
|
|
1190
|
+
if (!(err instanceof ImportError) || index < 0) {
|
|
1191
|
+
return err;
|
|
1192
|
+
}
|
|
1193
|
+
return new ImportError(`graph ${index}: ${err.message}`, err.report, { ...err.details, graphIndex: index });
|
|
1194
|
+
}
|
|
453
1195
|
function result(chosen, builder, report, options) {
|
|
454
|
-
|
|
455
|
-
|
|
1196
|
+
let frozen;
|
|
1197
|
+
try {
|
|
1198
|
+
frozen = builder.freezeWithReport(options.freeze);
|
|
1199
|
+
} catch (err) {
|
|
1200
|
+
throw freezeFailure(err, report);
|
|
1201
|
+
}
|
|
1202
|
+
const { warnings } = chosen;
|
|
1203
|
+
const result2 = {
|
|
456
1204
|
format: chosen.importer.format,
|
|
457
1205
|
sniff: chosen.sniff,
|
|
458
1206
|
snapshot: frozen.snapshot,
|
|
459
|
-
report
|
|
460
|
-
|
|
1207
|
+
report: withFreezeWarnings(
|
|
1208
|
+
weightNotFound(
|
|
1209
|
+
warnings.length === 0 ? report : Object.freeze({
|
|
1210
|
+
...report,
|
|
1211
|
+
issues: Object.freeze([...warnings, ...report.issues]),
|
|
1212
|
+
warningCount: report.warningCount + warnings.length
|
|
1213
|
+
}),
|
|
1214
|
+
frozen.snapshot,
|
|
1215
|
+
options.weightFrom
|
|
1216
|
+
),
|
|
1217
|
+
frozen.report
|
|
1218
|
+
)
|
|
1219
|
+
};
|
|
1220
|
+
Object.defineProperty(result2, "freeze", { value: frozen.report, enumerable: false });
|
|
1221
|
+
return Object.freeze(result2);
|
|
1222
|
+
}
|
|
1223
|
+
function unknownOptionText(name) {
|
|
1224
|
+
return `option ${JSON.stringify(name)} is not an option of any format or of the load and save functions, so it has no effect; check its spelling`;
|
|
1225
|
+
}
|
|
1226
|
+
function weightNotFound(report, snapshot, weightFrom) {
|
|
1227
|
+
if (typeof weightFrom !== "string" || snapshot.edgeCount === 0 || snapshot.edgeList().weights !== null || report.issues.some((i4) => i4.code === OPTION_IGNORED_CODE && i4.element === "weightFrom")) {
|
|
1228
|
+
return report;
|
|
1229
|
+
}
|
|
1230
|
+
const issue = Object.freeze({
|
|
1231
|
+
category: "missing-value",
|
|
1232
|
+
severity: "warning",
|
|
1233
|
+
code: WEIGHT_NOT_FOUND_CODE,
|
|
1234
|
+
message: `weightFrom: ${JSON.stringify(weightFrom)} names no attribute an edge has a value for, so the graph has no weights`,
|
|
1235
|
+
line: null,
|
|
1236
|
+
element: "weightFrom"
|
|
1237
|
+
});
|
|
1238
|
+
return Object.freeze({
|
|
1239
|
+
...report,
|
|
1240
|
+
issues: Object.freeze([...report.issues, issue]),
|
|
1241
|
+
warningCount: report.warningCount + 1
|
|
461
1242
|
});
|
|
462
1243
|
}
|
|
1244
|
+
function withFreezeWarnings(report, freeze) {
|
|
1245
|
+
const added = [];
|
|
1246
|
+
const warn = (category, code, message) => {
|
|
1247
|
+
added.push(Object.freeze({ category, severity: "warning", code, message, line: null, element: null }));
|
|
1248
|
+
};
|
|
1249
|
+
if (freeze.mergedEdges > 0) {
|
|
1250
|
+
warn(
|
|
1251
|
+
"merged",
|
|
1252
|
+
EDGES_MERGED_CODE,
|
|
1253
|
+
`${freeze.mergedEdges} parallel edge${plural(freeze.mergedEdges)} ${agree(freeze.mergedEdges, "was", "were")} merged into one edge per pair by the duplicateEdges policy; whatever told them apart (a relation, a label) is lost`
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
if (freeze.droppedSelfLoops > 0) {
|
|
1257
|
+
warn(
|
|
1258
|
+
"validation-error",
|
|
1259
|
+
SELF_LOOPS_DROPPED_CODE,
|
|
1260
|
+
`${freeze.droppedSelfLoops} self-loop${plural(freeze.droppedSelfLoops)} ${agree(freeze.droppedSelfLoops, "was", "were")} removed by selfLoops: "drop"`
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
if (added.length === 0) {
|
|
1264
|
+
return report;
|
|
1265
|
+
}
|
|
1266
|
+
return Object.freeze({
|
|
1267
|
+
...report,
|
|
1268
|
+
issues: Object.freeze([...report.issues, ...added]),
|
|
1269
|
+
warningCount: report.warningCount + added.length
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
function freezeFailure(err, report) {
|
|
1273
|
+
if (!(err instanceof GraphFormatError) || err instanceof ImportError) {
|
|
1274
|
+
return err;
|
|
1275
|
+
}
|
|
1276
|
+
const issue = Object.freeze({
|
|
1277
|
+
category: "validation-error",
|
|
1278
|
+
severity: "error",
|
|
1279
|
+
code: err.code,
|
|
1280
|
+
message: err.message,
|
|
1281
|
+
line: null,
|
|
1282
|
+
element: null
|
|
1283
|
+
});
|
|
1284
|
+
const failed = Object.freeze({
|
|
1285
|
+
...report,
|
|
1286
|
+
issues: Object.freeze([...report.issues, issue]),
|
|
1287
|
+
errorCount: report.errorCount + 1
|
|
1288
|
+
});
|
|
1289
|
+
return new ImportError(`the graph cannot be frozen: ${err.message}`, failed, { code: err.code, ...err.details });
|
|
1290
|
+
}
|
|
463
1291
|
function unknownFormat(kind, format, known) {
|
|
464
1292
|
const supported = [...known];
|
|
465
1293
|
return new GraphFormatError(
|
|
@@ -486,7 +1314,7 @@ async function peekHead(input, bytes, signal) {
|
|
|
486
1314
|
return { head: input.subarray(0, bytes), input, close: () => Promise.resolve() };
|
|
487
1315
|
}
|
|
488
1316
|
throwIfAborted(signal);
|
|
489
|
-
const source = typeof input.getReader === "function" ? readerIterator(input) : input[Symbol.asyncIterator]();
|
|
1317
|
+
const source = typeof input.getReader === "function" ? readerIterator(input, signal) : input[Symbol.asyncIterator]();
|
|
490
1318
|
const buffered = [];
|
|
491
1319
|
let size = 0;
|
|
492
1320
|
let finished = false;
|
|
@@ -511,10 +1339,10 @@ async function peekHead(input, bytes, signal) {
|
|
|
511
1339
|
return { head: joinHead(buffered, bytes), input: replayed, close: () => replayed.close() };
|
|
512
1340
|
}
|
|
513
1341
|
function joinHead(chunks, bytes) {
|
|
514
|
-
if (chunks.every((
|
|
1342
|
+
if (chunks.every((c3) => c3 instanceof Uint8Array)) {
|
|
515
1343
|
const total = Math.min(
|
|
516
1344
|
bytes,
|
|
517
|
-
chunks.reduce((sum,
|
|
1345
|
+
chunks.reduce((sum, c3) => sum + c3.byteLength, 0)
|
|
518
1346
|
);
|
|
519
1347
|
const head = new Uint8Array(total);
|
|
520
1348
|
let offset = 0;
|
|
@@ -573,15 +1401,23 @@ function replay(buffered, source, finished) {
|
|
|
573
1401
|
}
|
|
574
1402
|
};
|
|
575
1403
|
}
|
|
576
|
-
function readerIterator(stream) {
|
|
577
|
-
const reader = stream
|
|
1404
|
+
function readerIterator(stream, signal) {
|
|
1405
|
+
const reader = lockReader(stream);
|
|
578
1406
|
let done = false;
|
|
579
1407
|
return {
|
|
580
1408
|
async next() {
|
|
581
1409
|
if (done) {
|
|
582
1410
|
return { done: true, value: void 0 };
|
|
583
1411
|
}
|
|
584
|
-
|
|
1412
|
+
let result2;
|
|
1413
|
+
try {
|
|
1414
|
+
result2 = await abortable(reader.read(), signal);
|
|
1415
|
+
} catch (err) {
|
|
1416
|
+
done = true;
|
|
1417
|
+
await reader.cancel(signal?.reason).catch(() => void 0);
|
|
1418
|
+
reader.releaseLock();
|
|
1419
|
+
throw err;
|
|
1420
|
+
}
|
|
585
1421
|
if (result2.done) {
|
|
586
1422
|
done = true;
|
|
587
1423
|
reader.releaseLock();
|
|
@@ -592,7 +1428,7 @@ function readerIterator(stream) {
|
|
|
592
1428
|
async return() {
|
|
593
1429
|
if (!done) {
|
|
594
1430
|
done = true;
|
|
595
|
-
await reader.cancel().catch(() => void 0);
|
|
1431
|
+
await reader.cancel(signal?.reason).catch(() => void 0);
|
|
596
1432
|
reader.releaseLock();
|
|
597
1433
|
}
|
|
598
1434
|
return { done: true, value: void 0 };
|
|
@@ -600,204 +1436,260 @@ function readerIterator(stream) {
|
|
|
600
1436
|
};
|
|
601
1437
|
}
|
|
602
1438
|
export {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
1439
|
+
ae as AMBIGUOUS_GRAPH_NAME_CODE,
|
|
1440
|
+
Y as ASPECT_ORDER_CODE,
|
|
1441
|
+
V as BAD_ASPECT_BLOCK_CODE,
|
|
1442
|
+
B as BAD_DEFAULT_CODE,
|
|
1443
|
+
BAD_LINE_CODE,
|
|
1444
|
+
a_ as BAD_OPTIONS_CODE,
|
|
1445
|
+
a3 as BAD_VALUE_CODE,
|
|
1446
|
+
at as COLUMN_AS_PROPERTY_VALUE_CODE,
|
|
1447
|
+
a$ as COLUMN_DROPPED_CODE,
|
|
609
1448
|
C as COLUMN_RENAMED_CODE,
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
1449
|
+
b0 as COLUMN_RENAMED_LOSS_CODE,
|
|
1450
|
+
A as COLUMN_TYPE_CODE,
|
|
1451
|
+
b1 as CONTROL_CHARACTER_CODE,
|
|
1452
|
+
k as COUNT_HINT_CODE,
|
|
1453
|
+
j as COUNT_MISMATCH_CODE,
|
|
613
1454
|
CSV_CAPABILITIES,
|
|
614
1455
|
CSV_ISSUE,
|
|
615
1456
|
CSV_LOSS,
|
|
616
1457
|
C4 as CX2_CAPABILITIES,
|
|
617
1458
|
C5 as CX2_ISSUE,
|
|
618
|
-
|
|
619
|
-
C3 as
|
|
620
|
-
|
|
1459
|
+
a8 as CX2_LOSS,
|
|
1460
|
+
C3 as CX_CAPABILITIES,
|
|
1461
|
+
a7 as CX_ISSUE,
|
|
1462
|
+
b as CX_LOSS,
|
|
1463
|
+
C6 as CYS_CAPABILITIES,
|
|
1464
|
+
a9 as CYS_ISSUE,
|
|
1465
|
+
b10 as CYS_LOSS,
|
|
621
1466
|
C2 as ChildrenCsr,
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
1467
|
+
i as DANGLING_REFERENCE_CODE,
|
|
1468
|
+
D2 as DEFAULT_CHUNK_BYTES,
|
|
1469
|
+
b2 as DEFAULT_ERROR_LIMIT,
|
|
1470
|
+
b3 as DIRECTED_COLUMN,
|
|
1471
|
+
b4 as DIRECTION_DROPPED_CODE,
|
|
626
1472
|
D as DIRECTION_FORCED_CODE,
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
1473
|
+
d as DIRECTION_REFUSED_CODE,
|
|
1474
|
+
D3 as DOT_ISSUE,
|
|
1475
|
+
a10 as DOT_LOSS,
|
|
1476
|
+
o as DUPLICATE_ATTRIBUTE_CODE,
|
|
1477
|
+
b5 as DUPLICATE_EDGE_CODE,
|
|
1478
|
+
m as DUPLICATE_EDGE_ID_CODE,
|
|
1479
|
+
u as DUPLICATE_KEY_CODE,
|
|
1480
|
+
n as DUPLICATE_NODE_CODE,
|
|
1481
|
+
DirectionResolver,
|
|
1482
|
+
EDGES_MERGED_CODE,
|
|
1483
|
+
F as ELEMENT_ISSUE,
|
|
1484
|
+
b6 as EMPTY_COLUMN_DROPPED_CODE,
|
|
1485
|
+
EMPTY_INPUT_CODE,
|
|
1486
|
+
v as ENCODING_CONFLICT_CODE,
|
|
1487
|
+
x as ENCODING_FALLBACK_CODE,
|
|
1488
|
+
b7 as EQUATION_AS_TEXT_CODE,
|
|
1489
|
+
FETCH_CODE,
|
|
1490
|
+
b8 as FOREIGN_FORMAT_CODE,
|
|
639
1491
|
FormatRegistry,
|
|
640
1492
|
GEXF_1_2_CAPABILITIES,
|
|
641
1493
|
GEXF_ISSUE,
|
|
642
1494
|
GEXF_LOSS,
|
|
643
1495
|
GML_ISSUE,
|
|
644
1496
|
GML_LOSS,
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
1497
|
+
G3 as GRAPHML_ISSUE,
|
|
1498
|
+
a15 as GRAPHML_LOSS,
|
|
1499
|
+
aB as GRAPH_COLUMN_AS_METADATA_CODE,
|
|
1500
|
+
G2 as GRAPH_FORMATS,
|
|
1501
|
+
af as GRAPH_NOT_FOUND_CODE,
|
|
1502
|
+
GraphBuilder2 as GraphBuilder,
|
|
1503
|
+
GraphFormatError2 as GraphFormatError,
|
|
1504
|
+
H as HYPEREDGE_CODE,
|
|
650
1505
|
I as ID_MERGED_CODE,
|
|
651
1506
|
ID_SPACE_COLUMN,
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
1507
|
+
b9 as ID_TEXT_COLLISION_CODE,
|
|
1508
|
+
J as ID_TEXT_TYPE_CODE,
|
|
1509
|
+
G as INPUT_ISSUE,
|
|
1510
|
+
ba as INTEGRAL_F64_CODE,
|
|
1511
|
+
y as INVALID_ENCODING_CODE,
|
|
1512
|
+
INVALID_INDEX2 as INVALID_INDEX,
|
|
1513
|
+
z as INVALID_UTF8_CODE,
|
|
1514
|
+
bb as ISSUES_SUPPRESSED_CODE,
|
|
1515
|
+
IdCoercer,
|
|
1516
|
+
ImportError,
|
|
659
1517
|
ImportReportBuilder,
|
|
660
1518
|
J2 as JSON_DIALECTS,
|
|
661
|
-
|
|
662
|
-
|
|
1519
|
+
a11 as JSON_ISSUE,
|
|
1520
|
+
b11 as JSON_LOSS,
|
|
1521
|
+
a2 as JSON_NONSTANDARD_NUMBER_CODE,
|
|
663
1522
|
LABELS_COLUMN,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
1523
|
+
L as LOSS,
|
|
1524
|
+
LineReader,
|
|
1525
|
+
s as MISSING_ENDPOINT_CODE,
|
|
1526
|
+
t as MISSING_ID_CODE,
|
|
1527
|
+
M as MIXED_DIRECTION_CODE,
|
|
1528
|
+
l as MULTIPLE_GRAPHS_CODE,
|
|
1529
|
+
W as MULTI_ASPECT_FRAGMENT_CODE,
|
|
1530
|
+
T as MUTUAL_AS_UNDIRECTED_CODE,
|
|
1531
|
+
bc as MUTUAL_COLUMN,
|
|
1532
|
+
bd as MUTUAL_EXPANDED_CODE,
|
|
673
1533
|
NEO4J_CAPABILITIES,
|
|
674
1534
|
NEO4J_ISSUE,
|
|
675
1535
|
NEO4J_LOSS,
|
|
676
|
-
|
|
1536
|
+
aA as NODE_ORDER_CODE,
|
|
1537
|
+
be as NONFINITE_AS_NULL_CODE,
|
|
1538
|
+
bf as NO_CAPABILITIES,
|
|
677
1539
|
N as NO_GRAPH_CODE,
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
1540
|
+
O as OBO_CAPABILITIES,
|
|
1541
|
+
a12 as OBO_ISSUE,
|
|
1542
|
+
b12 as OBO_LOSS,
|
|
1543
|
+
bg as OPTIONS_GAINED_CODE,
|
|
1544
|
+
OPTION_IGNORED_CODE,
|
|
681
1545
|
ORIGINAL_ID_COLUMN,
|
|
682
|
-
|
|
1546
|
+
bh as PAIR_COLUMN,
|
|
683
1547
|
P2 as PAJEK_ISSUE,
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
1548
|
+
a13 as PAJEK_LOSS,
|
|
1549
|
+
Q as PARENTS_DROPPED_CODE,
|
|
1550
|
+
ai as PARENT_CYCLE_CODE,
|
|
1551
|
+
bi as PARSE_ERROR_CODE,
|
|
688
1552
|
P as PRECISION_CODE,
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
1553
|
+
aD as RELATION_ASSUMED_CODE,
|
|
1554
|
+
ay as RENAMED_CODE,
|
|
1555
|
+
au as ROLE_ASSUMED_CODE,
|
|
1556
|
+
K as ROLE_DROPPED_CODE,
|
|
692
1557
|
R as ROLE_TAKEN_CODE,
|
|
1558
|
+
SELF_LOOPS_DROPPED_CODE,
|
|
1559
|
+
bj as SELF_LOOP_CODE,
|
|
1560
|
+
ag as SINGLE_OBJECT_ASPECT_CODE,
|
|
693
1561
|
S as SINK_OPTION_CODE,
|
|
1562
|
+
SNIFF_FAILED_CODE,
|
|
694
1563
|
SNIFF_HEAD_BYTES,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
1564
|
+
Z as STATUS_FAILED_CODE,
|
|
1565
|
+
_ as STATUS_WARNING_CODE,
|
|
1566
|
+
bk as STORAGE_CLASS_CODE,
|
|
1567
|
+
f as STRAY_TEXT_CODE,
|
|
1568
|
+
ah as STYLES_NOT_IMPORTED_CODE,
|
|
1569
|
+
ak as SYNTAX_CODE,
|
|
1570
|
+
bl as TEMPORAL_DROPPED_CODE,
|
|
1571
|
+
bm as TEMPORAL_TEXT_DROPPED_CODE,
|
|
1572
|
+
bn as TEXT_INFERRED_CODE,
|
|
1573
|
+
ad as TOO_LARGE_CODE,
|
|
1574
|
+
aC as TYPEDEF_NODES_CODE,
|
|
705
1575
|
TYPE_COLUMN,
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
1576
|
+
TextCellWriter,
|
|
1577
|
+
U as UNKNOWN_ATTR_TYPE_CODE,
|
|
1578
|
+
g as UNKNOWN_ELEMENT_CODE,
|
|
1579
|
+
w as UNKNOWN_ENCODING_CODE,
|
|
710
1580
|
UNKNOWN_FORMAT_CODE,
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
1581
|
+
UNKNOWN_OPTION_CODE,
|
|
1582
|
+
q as UNKNOWN_PARENT_CODE,
|
|
1583
|
+
bo as UNKNOWN_TYPE_CODE,
|
|
1584
|
+
h as UNKNOWN_XML_ATTRIBUTE_CODE,
|
|
1585
|
+
bp as WEIGHTS_DROPPED_CODE,
|
|
1586
|
+
bq as WEIGHT_KEY_CLASH_CODE,
|
|
1587
|
+
WEIGHT_NOT_FOUND_CODE,
|
|
1588
|
+
aj as WIDENED_CODE,
|
|
715
1589
|
W2 as WIDENING_UNSUPPORTED_CODE,
|
|
716
1590
|
X2 as XGMML_ISSUE,
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
1591
|
+
a14 as XGMML_LOSS,
|
|
1592
|
+
ax as XML_ILLEGAL_CHAR_CODE,
|
|
1593
|
+
X as XML_SYNTAX_CODE,
|
|
720
1594
|
X3 as XmlSyntaxError,
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
1595
|
+
b13 as XmlTokenizer,
|
|
1596
|
+
aH as canonicalId,
|
|
1597
|
+
c as capabilities,
|
|
1598
|
+
a as checkCapabilities,
|
|
725
1599
|
checkExport,
|
|
726
1600
|
c2 as childrenCsr,
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1601
|
+
a6 as childrenFromColumn,
|
|
1602
|
+
chooseGraph,
|
|
1603
|
+
br as coerceId,
|
|
1604
|
+
aI as coerceIdText,
|
|
1605
|
+
collectBytes,
|
|
1606
|
+
compareSnapshots,
|
|
732
1607
|
createRegistry,
|
|
733
1608
|
csvExporter,
|
|
734
1609
|
csvImporter,
|
|
735
1610
|
cx2Exporter,
|
|
736
1611
|
cx2Importer,
|
|
1612
|
+
cxExporter,
|
|
737
1613
|
cxImporter,
|
|
1614
|
+
cysExporter,
|
|
738
1615
|
cysImporter,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
1616
|
+
bs as declareCompanion,
|
|
1617
|
+
a1 as declareResolved,
|
|
1618
|
+
d2 as decodeChunks,
|
|
1619
|
+
bt as decodeEntryName,
|
|
1620
|
+
defineLineFormat,
|
|
1621
|
+
describeDiffs,
|
|
1622
|
+
d3 as dialectCapabilities,
|
|
744
1623
|
dotExporter,
|
|
745
1624
|
dotImporter,
|
|
746
|
-
|
|
747
|
-
|
|
1625
|
+
downloadGraph,
|
|
1626
|
+
bu as edgeWeights,
|
|
1627
|
+
e2 as encodeChunks,
|
|
1628
|
+
e as explicitWeights,
|
|
748
1629
|
exportGraph,
|
|
1630
|
+
exportGraphToBlob,
|
|
1631
|
+
exportGraphToBytes,
|
|
749
1632
|
exportGraphToString,
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
1633
|
+
exportNeo4jFiles,
|
|
1634
|
+
g2 as extensionOf,
|
|
1635
|
+
bv as forDecodedText,
|
|
1636
|
+
aF as formatDecimal,
|
|
1637
|
+
aa as formatF32,
|
|
1638
|
+
ab as formatF64,
|
|
1639
|
+
bw as formatGmlReal,
|
|
1640
|
+
aG as formatInteger,
|
|
756
1641
|
gexfExporter,
|
|
757
1642
|
gexfImporter,
|
|
758
1643
|
gmlExporter,
|
|
759
1644
|
gmlImporter,
|
|
1645
|
+
ap as graphChosen,
|
|
760
1646
|
graphmlExporter,
|
|
761
1647
|
graphmlImporter,
|
|
762
1648
|
h3 as hasIllegalXmlChar,
|
|
763
1649
|
h2 as headBytes,
|
|
764
1650
|
importAllGraphs,
|
|
765
1651
|
importGraph,
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
1652
|
+
i2 as inferTextDtype,
|
|
1653
|
+
bx as inputLength,
|
|
1654
|
+
isAbortError,
|
|
1655
|
+
by as isCanonicalIntegerText,
|
|
1656
|
+
bz as isImportInput,
|
|
1657
|
+
bA as isNmtoken,
|
|
1658
|
+
a5 as isNumericText,
|
|
1659
|
+
aK as isWeightField,
|
|
1660
|
+
j2 as joinText,
|
|
1661
|
+
j3 as jsonCapabilities,
|
|
776
1662
|
jsonExporter,
|
|
777
1663
|
jsonImporter,
|
|
1664
|
+
f2 as jsonShapeOf,
|
|
1665
|
+
listFormats,
|
|
778
1666
|
listGraphs,
|
|
779
|
-
|
|
1667
|
+
loadFromFile,
|
|
1668
|
+
loadFromUrl,
|
|
1669
|
+
bB as mangleNmtoken,
|
|
780
1670
|
neo4jExporter,
|
|
781
1671
|
neo4jImporter,
|
|
782
1672
|
n2 as normalizeMimeType,
|
|
1673
|
+
oboExporter,
|
|
783
1674
|
oboImporter,
|
|
784
|
-
|
|
1675
|
+
p as pairFolding,
|
|
785
1676
|
pajekExporter,
|
|
786
1677
|
pajekImporter,
|
|
787
|
-
|
|
788
|
-
|
|
1678
|
+
p2 as parseTextCell,
|
|
1679
|
+
parseWeightText,
|
|
789
1680
|
rankFormats,
|
|
790
|
-
|
|
1681
|
+
bC as readText,
|
|
1682
|
+
bD as refusedSave,
|
|
791
1683
|
registry,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
1684
|
+
reportSinkOptions,
|
|
1685
|
+
reportUnusedOptions,
|
|
1686
|
+
r as resolveExportOptions,
|
|
1687
|
+
resolveImportOptions,
|
|
1688
|
+
aE as sanitizeIds,
|
|
797
1689
|
sniff,
|
|
798
1690
|
s2 as sniffFormat,
|
|
799
|
-
|
|
800
|
-
|
|
1691
|
+
i3 as sniffJsonDialectHead,
|
|
1692
|
+
a4 as textChunks,
|
|
801
1693
|
throwIfAborted,
|
|
802
1694
|
t2 as toReadableStream,
|
|
803
1695
|
t3 as tokenizeXml,
|