@graphty/graph-io 0.3.16 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +29 -3
  3. package/dist/chunks/{escape-D1f9-cwf.js → escape-D-gZWO26.js} +3 -2
  4. package/dist/chunks/{escape-D1f9-cwf.js.map → escape-D-gZWO26.js.map} +1 -1
  5. package/dist/chunks/{importer-D7ZcGCeb.js → importer-Br_QeAeE.js} +4 -3
  6. package/dist/chunks/{importer-D7ZcGCeb.js.map → importer-Br_QeAeE.js.map} +1 -1
  7. package/dist/chunks/{importer-CXEiicAN.js → importer-DHagxvDD.js} +4 -3
  8. package/dist/chunks/{importer-CXEiicAN.js.map → importer-DHagxvDD.js.map} +1 -1
  9. package/dist/chunks/{importer-C7mnGdr_.js → importer-Du5crN9l.js} +510 -26
  10. package/dist/chunks/importer-Du5crN9l.js.map +1 -0
  11. package/dist/chunks/importer-aNJfe0qu.js +1614 -0
  12. package/dist/chunks/importer-aNJfe0qu.js.map +1 -0
  13. package/dist/chunks/{importer-B8lsjFWx.js → importer-d0uQxFp6.js} +4 -3
  14. package/dist/chunks/{importer-B8lsjFWx.js.map → importer-d0uQxFp6.js.map} +1 -1
  15. package/dist/chunks/ontology-BnrJ4I98.js +113 -0
  16. package/dist/chunks/ontology-BnrJ4I98.js.map +1 -0
  17. package/dist/chunks/{records-IHsCfv7s.js → records-Bk9jgodz.js} +2 -2
  18. package/dist/chunks/{records-IHsCfv7s.js.map → records-Bk9jgodz.js.map} +1 -1
  19. package/dist/chunks/{writer-BtWpUaiH.js → report-BOk0p5y8.js} +181 -912
  20. package/dist/chunks/report-BOk0p5y8.js.map +1 -0
  21. package/dist/chunks/writer-GAdltGmC.js +827 -0
  22. package/dist/chunks/writer-GAdltGmC.js.map +1 -0
  23. package/dist/csv.js +4 -3
  24. package/dist/csv.js.map +1 -1
  25. package/dist/dot.js +1 -1
  26. package/dist/gexf.js +3 -2
  27. package/dist/gexf.js.map +1 -1
  28. package/dist/gml.js +3 -2
  29. package/dist/gml.js.map +1 -1
  30. package/dist/graph-io.js +191 -134
  31. package/dist/graph-io.js.map +1 -1
  32. package/dist/graphml.js +1 -1
  33. package/dist/json.js +1 -1
  34. package/dist/neo4j.js +4 -3
  35. package/dist/neo4j.js.map +1 -1
  36. package/dist/obo.d.ts +1 -0
  37. package/dist/obo.js +6 -0
  38. package/dist/obo.js.map +1 -0
  39. package/dist/pajek.js +1 -1
  40. package/dist/src/common/codes.d.ts +43 -0
  41. package/dist/src/common/codes.d.ts.map +1 -1
  42. package/dist/src/common/codes.js +43 -0
  43. package/dist/src/common/codes.js.map +1 -1
  44. package/dist/src/common/input.d.ts +9 -0
  45. package/dist/src/common/input.d.ts.map +1 -1
  46. package/dist/src/common/input.js +16 -0
  47. package/dist/src/common/input.js.map +1 -1
  48. package/dist/src/common/ontology.d.ts +59 -0
  49. package/dist/src/common/ontology.d.ts.map +1 -0
  50. package/dist/src/common/ontology.js +147 -0
  51. package/dist/src/common/ontology.js.map +1 -0
  52. package/dist/src/common/options.d.ts +12 -1
  53. package/dist/src/common/options.d.ts.map +1 -1
  54. package/dist/src/common/options.js +51 -1
  55. package/dist/src/common/options.js.map +1 -1
  56. package/dist/src/formats/json/dialect.d.ts +8 -6
  57. package/dist/src/formats/json/dialect.d.ts.map +1 -1
  58. package/dist/src/formats/json/dialect.js +26 -3
  59. package/dist/src/formats/json/dialect.js.map +1 -1
  60. package/dist/src/formats/json/importer.d.ts +324 -7
  61. package/dist/src/formats/json/importer.d.ts.map +1 -1
  62. package/dist/src/formats/json/importer.js +154 -23
  63. package/dist/src/formats/json/importer.js.map +1 -1
  64. package/dist/src/formats/json/obographs.d.ts +21 -0
  65. package/dist/src/formats/json/obographs.d.ts.map +1 -0
  66. package/dist/src/formats/json/obographs.js +476 -0
  67. package/dist/src/formats/json/obographs.js.map +1 -0
  68. package/dist/src/formats/obo/importer.d.ts +90 -0
  69. package/dist/src/formats/obo/importer.d.ts.map +1 -0
  70. package/dist/src/formats/obo/importer.js +1248 -0
  71. package/dist/src/formats/obo/importer.js.map +1 -0
  72. package/dist/src/formats/obo/index.d.ts +7 -0
  73. package/dist/src/formats/obo/index.d.ts.map +1 -0
  74. package/dist/src/formats/obo/index.js +7 -0
  75. package/dist/src/formats/obo/index.js.map +1 -0
  76. package/dist/src/formats/obo/syntax.d.ts +121 -0
  77. package/dist/src/formats/obo/syntax.d.ts.map +1 -0
  78. package/dist/src/formats/obo/syntax.js +424 -0
  79. package/dist/src/formats/obo/syntax.js.map +1 -0
  80. package/dist/src/index.d.ts +5 -4
  81. package/dist/src/index.d.ts.map +1 -1
  82. package/dist/src/index.js +4 -3
  83. package/dist/src/index.js.map +1 -1
  84. package/dist/src/registry.d.ts +21 -3
  85. package/dist/src/registry.d.ts.map +1 -1
  86. package/dist/src/registry.js +32 -1
  87. package/dist/src/registry.js.map +1 -1
  88. package/dist/src/sniff.d.ts +1 -1
  89. package/dist/src/sniff.d.ts.map +1 -1
  90. package/dist/src/sniff.js +23 -3
  91. package/dist/src/sniff.js.map +1 -1
  92. package/dist/src/types.d.ts +31 -0
  93. package/dist/src/types.d.ts.map +1 -1
  94. package/dist/src/types.js.map +1 -1
  95. package/package.json +6 -1
  96. package/src/common/codes.ts +58 -0
  97. package/src/common/input.ts +16 -0
  98. package/src/common/ontology.ts +169 -0
  99. package/src/common/options.ts +78 -2
  100. package/src/formats/json/dialect.ts +37 -7
  101. package/src/formats/json/importer.ts +206 -28
  102. package/src/formats/json/obographs.ts +563 -0
  103. package/src/formats/obo/importer.ts +1695 -0
  104. package/src/formats/obo/index.ts +7 -0
  105. package/src/formats/obo/syntax.ts +466 -0
  106. package/src/index.ts +6 -0
  107. package/src/registry.ts +38 -3
  108. package/src/sniff.ts +35 -5
  109. package/src/types.ts +40 -1
  110. package/dist/chunks/importer-C7mnGdr_.js.map +0 -1
  111. package/dist/chunks/writer-BtWpUaiH.js.map +0 -1
@@ -30,6 +30,21 @@ const UNKNOWN_ATTR_TYPE_CODE = "W_UNKNOWN_ATTR_TYPE";
30
30
  const BAD_DEFAULT_CODE = "W_BAD_DEFAULT";
31
31
  const BAD_OPTIONS_CODE = "W_BAD_OPTIONS";
32
32
  const DUPLICATE_EDGE_ID_CODE = "E_DUPLICATE_EDGE_ID";
33
+ const BAD_VALUE_CODE = "E_BAD_VALUE";
34
+ const WIDENED_CODE = "W_WIDENED";
35
+ const DANGLING_REFERENCE_CODE = "W_DANGLING_REFERENCE";
36
+ const DUPLICATE_ATTRIBUTE_CODE = "W_DUPLICATE_ATTRIBUTE";
37
+ const PARENT_CYCLE_CODE = "E_PARENT_CYCLE";
38
+ const EQUATION_AS_TEXT_CODE = "W_EQUATION_AS_TEXT";
39
+ const STYLES_NOT_IMPORTED_CODE = "W_STYLES_NOT_IMPORTED";
40
+ const BAD_ASPECT_BLOCK_CODE = "E_BAD_ASPECT_BLOCK";
41
+ const ASPECT_ORDER_CODE = "W_ASPECT_ORDER";
42
+ const COUNT_MISMATCH_CODE = "W_COUNT_MISMATCH";
43
+ const STATUS_FAILED_CODE = "E_STATUS_FAILED";
44
+ const STATUS_WARNING_CODE = "W_STATUS_WARNING";
45
+ const TOO_LARGE_CODE = "E_TOO_LARGE";
46
+ const GRAPH_NOT_FOUND_CODE = "E_GRAPH_NOT_FOUND";
47
+ const AMBIGUOUS_GRAPH_NAME_CODE = "E_AMBIGUOUS_GRAPH_NAME";
33
48
  const ROLE_DROPPED_CODE = "W_ROLE_DROPPED";
34
49
  const PARENTS_DROPPED_CODE = "W_PARENTS_DROPPED";
35
50
  const TEMPORAL_DROPPED_CODE = "W_TEMPORAL_DROPPED";
@@ -1451,6 +1466,13 @@ function startsWithUtf8(bytes) {
1451
1466
  return false;
1452
1467
  }
1453
1468
  }
1469
+ function decodeEntryName(bytes) {
1470
+ try {
1471
+ return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
1472
+ } catch {
1473
+ return new TextDecoder("windows-1252").decode(bytes);
1474
+ }
1475
+ }
1454
1476
  function concatBytes(chunks) {
1455
1477
  if (chunks.length === 1) {
1456
1478
  return chunks[0];
@@ -1792,6 +1814,58 @@ function reportUnusedOptions(options, report, used) {
1792
1814
  }
1793
1815
  return recorded;
1794
1816
  }
1817
+ function chooseGraph(names, options, report) {
1818
+ const { graphIndex, graphName } = options ?? {};
1819
+ if (graphIndex !== void 0 && (typeof graphIndex !== "number" || !Number.isInteger(graphIndex) || graphIndex < 0)) {
1820
+ throw new GraphFormatError(
1821
+ "E_UNSUPPORTED",
1822
+ `option graphIndex: ${describe(graphIndex)} is not a non-negative integer`,
1823
+ {
1824
+ option: "graphIndex",
1825
+ found: graphIndex
1826
+ }
1827
+ );
1828
+ }
1829
+ if (graphName !== void 0 && typeof graphName !== "string") {
1830
+ throw new GraphFormatError("E_UNSUPPORTED", `option graphName: ${describe(graphName)} is not a string`, {
1831
+ option: "graphName",
1832
+ found: graphName
1833
+ });
1834
+ }
1835
+ if (graphIndex !== void 0 && graphName !== void 0) {
1836
+ throw new GraphFormatError("E_UNSUPPORTED", "options graphIndex and graphName both choose a graph; pass one", {
1837
+ option: "graphName",
1838
+ found: graphName
1839
+ });
1840
+ }
1841
+ if (names.length === 0) {
1842
+ return report.fail(NO_GRAPH_CODE, "the input holds no graph");
1843
+ }
1844
+ if (graphName !== void 0) {
1845
+ const matches = names.flatMap((name, i) => name === graphName ? [i] : []);
1846
+ if (matches.length > 1) {
1847
+ return report.fail(
1848
+ AMBIGUOUS_GRAPH_NAME_CODE,
1849
+ `graphName ${JSON.stringify(graphName)} names the graphs at indexes ${matches.join(", ")}; pass graphIndex`,
1850
+ { element: graphName }
1851
+ );
1852
+ }
1853
+ if (matches.length === 0) {
1854
+ return report.fail(
1855
+ GRAPH_NOT_FOUND_CODE,
1856
+ `graphName ${JSON.stringify(graphName)} names none of the ${names.length} graph(s)`,
1857
+ { element: graphName },
1858
+ { names: [...names] }
1859
+ );
1860
+ }
1861
+ return matches[0];
1862
+ }
1863
+ const index = graphIndex ?? 0;
1864
+ if (index >= names.length) {
1865
+ return report.fail(GRAPH_NOT_FOUND_CODE, `graphIndex ${index} is beyond the ${names.length} graph(s)`);
1866
+ }
1867
+ return index;
1868
+ }
1795
1869
  function resolveImportOptions(options, defaults) {
1796
1870
  const o = options ?? {};
1797
1871
  return Object.freeze({
@@ -2148,924 +2222,119 @@ function isAbortError(err) {
2148
2222
  function now() {
2149
2223
  return typeof performance === "object" ? performance.now() : Date.now();
2150
2224
  }
2151
- function formatF32(value) {
2152
- if (!Number.isFinite(value)) {
2153
- return String(value);
2154
- }
2155
- if (value === 0) {
2156
- return Object.is(value, -0) ? "-0" : "0";
2157
- }
2158
- for (let digits = 1; digits <= 9; digits++) {
2159
- const text = value.toPrecision(digits);
2160
- if (Math.fround(Number(text)) === value) {
2161
- return String(Number(text));
2162
- }
2163
- }
2164
- return String(value);
2165
- }
2166
- function formatF64(value) {
2167
- return Object.is(value, -0) ? "-0" : String(value);
2168
- }
2169
- function formatDecimal(value, dtype = "f64") {
2170
- if (!Number.isFinite(value)) {
2171
- return String(value);
2172
- }
2173
- if (Object.is(value, -0)) {
2174
- return "-0.0";
2175
- }
2176
- const text = formatNumber(value, dtype);
2177
- return text.includes(".") || text.includes("e") ? text : `${text}.0`;
2178
- }
2179
- function formatGmlReal(value, dtype = "f64") {
2180
- if (Number.isNaN(value)) {
2181
- return "NAN";
2182
- }
2183
- if (!Number.isFinite(value)) {
2184
- return value > 0 ? "+INF" : "-INF";
2185
- }
2186
- const text = formatDecimal(value, dtype);
2187
- if (text.includes(".")) {
2188
- return text;
2189
- }
2190
- const e = text.indexOf("e");
2191
- return `${text.slice(0, e)}.0${text.slice(e)}`;
2192
- }
2193
- function formatInteger(value) {
2194
- if (Number.isSafeInteger(value) || !Number.isFinite(value)) {
2195
- return String(value);
2196
- }
2197
- return BigInt(value).toString();
2198
- }
2199
- function formatNumber(value, dtype) {
2200
- return dtype === "f32" ? formatF32(value) : formatF64(value);
2201
- }
2202
- const DEFAULT_WEIGHT = 1;
2203
- function isWeightField(name, weightFrom) {
2204
- return weightFrom !== null && name === weightFrom;
2205
- }
2206
- function parseWeightText(text) {
2207
- const trimmed = text.trim();
2208
- if (trimmed.length === 0) {
2209
- return void 0;
2210
- }
2211
- let value;
2212
- try {
2213
- value = parseDecimalText(trimmed);
2214
- } catch (err) {
2215
- throw invalidWeight(text, err);
2216
- }
2217
- if (Number.isNaN(value)) {
2218
- throw invalidWeight(text, null);
2219
- }
2220
- return value;
2221
- }
2222
- function weightFromValue(value) {
2223
- if (value === void 0 || value === null) {
2224
- return void 0;
2225
- }
2226
- if (typeof value === "number") {
2227
- if (Number.isNaN(value)) {
2228
- throw invalidWeight(value, null);
2229
- }
2230
- return value;
2231
- }
2232
- if (typeof value === "string") {
2233
- return parseWeightText(value);
2234
- }
2235
- throw invalidWeight(value, null);
2236
- }
2237
- function invalidWeight(value, cause) {
2238
- let shown;
2239
- switch (typeof value) {
2240
- case "string":
2241
- shown = JSON.stringify(value);
2242
- break;
2243
- case "number":
2244
- shown = String(value);
2245
- break;
2246
- default:
2247
- shown = typeof value;
2248
- }
2249
- return new GraphFormatError("E_INVALID_WEIGHT", `invalid edge weight ${shown}`, {
2250
- value: typeof value === "object" ? typeof value : value,
2251
- cause: cause instanceof Error ? cause.message : null
2252
- });
2253
- }
2254
- const NEGATIVE_ZERO_TEXT = "-0";
2255
- const NUMERIC_DTYPES = /* @__PURE__ */ new Set(["f32", "f64", "i32", "u32", "u8"]);
2256
- function weightFormatter(dtype) {
2257
- switch (dtype) {
2258
- case "f32":
2259
- return formatF32;
2260
- case "f64":
2261
- return formatF64;
2262
- default:
2263
- return formatInteger;
2264
- }
2265
- }
2266
- function explicitWeights(snapshot) {
2267
- const shadowColumn = snapshot.edges.byRole("weight");
2268
- const shadow = shadowColumn !== null && NUMERIC_DTYPES.has(shadowColumn.dtype) ? shadowColumn : null;
2269
- if (shadow !== null) {
2270
- const dtype = shadow.dtype === "f32" ? "f32" : "f64";
2271
- const format = weightFormatter(shadow.dtype);
2272
- return {
2273
- weighted: true,
2274
- dtype,
2275
- isExplicit: (e) => shadow.isSet(e),
2276
- value: (e) => shadow.value(e),
2277
- text: (e, integral = false) => {
2278
- if (!shadow.isSet(e)) {
2279
- return null;
2280
- }
2281
- const value = shadow.value(e);
2282
- if (Object.is(value, -0)) {
2283
- return NEGATIVE_ZERO_TEXT;
2284
- }
2285
- return integral && Number.isInteger(value) ? formatInteger(value) : format(value);
2286
- }
2287
- };
2288
- }
2289
- const { weights } = snapshot.edgeList();
2290
- if (weights === null || !snapshot.flags.weighted) {
2291
- return {
2292
- weighted: false,
2293
- dtype: "f32",
2294
- isExplicit: () => false,
2295
- value: () => DEFAULT_WEIGHT,
2296
- text: () => null
2297
- };
2298
- }
2299
- return {
2300
- weighted: true,
2301
- dtype: "f32",
2302
- isExplicit: () => true,
2303
- value: (e) => weights[e],
2304
- text: (e, integral = false) => {
2305
- const value = weights[e];
2306
- if (Object.is(value, -0)) {
2307
- return NEGATIVE_ZERO_TEXT;
2308
- }
2309
- return integral && Number.isInteger(value) ? formatInteger(value) : formatF32(value);
2310
- }
2311
- };
2312
- }
2313
- const LOSS = Object.freeze({
2314
- /** The format has no mixed direction; expanded pairs are written per onMixedDirection. */
2315
- MIXED_DIRECTION: "W_MIXED_DIRECTION",
2316
- /** The format has no mixed direction and onMixedDirection is "error": export() will throw E_DIRECTED. */
2317
- MIXED_DIRECTION_ERROR: MIXED_DIRECTION_CODE,
2318
- /** Parallel edges in a format without them. */
2319
- MULTI_EDGES: "W_MULTI_EDGES",
2320
- /** Self-loops in a format without them. */
2321
- SELF_LOOPS: "W_SELF_LOOPS",
2322
- /** The format requires edge ids and the snapshot has none; canonical e0..e{E-1} are generated. */
2323
- EDGE_IDS_GENERATED: "W_EDGE_IDS_GENERATED",
2324
- /** The snapshot has an edge id column and the format cannot write one. */
2325
- EDGE_IDS_DROPPED: "W_EDGE_IDS_DROPPED",
2326
- /** Ids outside the format's charset are rewritten (sanitizeIds "mangle"). */
2327
- ID_MANGLED: "W_ID_MANGLED",
2328
- /** Ids outside the format's charset and sanitizeIds "error": export() will throw E_INVALID_ID. */
2329
- ID_CHARSET: "E_ID_CHARSET",
2330
- /** The format numbers nodes 1..N; ids that are not their 1-based index are kept as labels only. */
2331
- ID_RENUMBERED: "W_ID_RENUMBERED",
2332
- /** A column dtype the format does not keep as declared. */
2333
- DTYPE: "W_DTYPE_UNSUPPORTED",
2334
- /** A multi-component column in a format without strides. */
2335
- COMPONENTS: "W_COMPONENTS_FLATTENED",
2336
- /** A list column in a format without lists. */
2337
- LIST: "W_LIST_UNSUPPORTED",
2338
- /** A json column in a format without nested values. */
2339
- JSON: "W_JSON_UNSUPPORTED",
2340
- /** A declared default in a format without defaults. */
2341
- DEFAULT: "W_DEFAULT_DROPPED",
2342
- /** Declared options in a format without enumerations. */
2343
- OPTIONS: "W_OPTIONS_DROPPED",
2344
- /** A parent / parents column in a format without containment. */
2345
- HIERARCHY: "W_HIERARCHY_DROPPED",
2346
- /** A start / end / timestamp column in a format without temporal support. */
2347
- TEMPORAL: TEMPORAL_DROPPED_CODE,
2348
- /** A `<column>.text` companion (design section 5.1) the format cannot carry. */
2349
- TEMPORAL_TEXT: TEMPORAL_TEXT_DROPPED_CODE,
2350
- /** A role column the format has no slot for; written as a plain attribute, the role lost. */
2351
- ROLE: ROLE_DROPPED_CODE,
2352
- /** A parents (multi-parent) column in a format with single containment only. */
2353
- PARENTS: PARENTS_DROPPED_CODE,
2354
- /** A mutual pair written as two directed edges without the mutual mark. */
2355
- MUTUAL_EXPANDED: MUTUAL_EXPANDED_CODE,
2356
- /** A mutual pair written as one undirected edge; the mark is lost and the pair reads back undirected. */
2357
- MUTUAL_AS_UNDIRECTED: MUTUAL_AS_UNDIRECTED_CODE,
2358
- /** Node ids whose written text reads back as the other type under the importer's id rule. */
2359
- ID_TEXT_TYPE: ID_TEXT_TYPE_CODE,
2360
- /** Two node ids share one written text; export() throws E_INVALID_ID. */
2361
- ID_TEXT_COLLISION: ID_TEXT_COLLISION_CODE,
2362
- /** A plain column named like the importer's weight key reads back as THE weight. */
2363
- WEIGHT_KEY_CLASH: WEIGHT_KEY_CLASH_CODE,
2364
- /** A role-less column whose written name the importer maps to a role. */
2365
- ROLE_ASSUMED: ROLE_ASSUMED_CODE,
2366
- /** A role column written into the format's slot reads back under the importer's fixed name. */
2367
- COLUMN_NAME_CHANGED: COLUMN_RENAMED_LOSS_CODE,
2368
- /** A declared column whose every row is unset vanishes through a format without declarations. */
2369
- EMPTY_COLUMN: EMPTY_COLUMN_DROPPED_CODE,
2370
- /** A string / dict column that reads back as the other storage class (the dictionary heuristic). */
2371
- STORAGE_CLASS: STORAGE_CLASS_CODE,
2372
- /** An f64 column whose set values are all integral reads back as i32 through an untyped format. */
2373
- INTEGRAL_F64: INTEGRAL_F64_CODE,
2374
- /** Text cells that read back as numbers or booleans under the 5.1 grammar. */
2375
- TEXT_INFERRED: TEXT_INFERRED_CODE,
2376
- /** A string cell holding a character XML 1.0 forbids; export() throws E_COLUMN_TYPE. */
2377
- XML_ILLEGAL_CHAR: XML_ILLEGAL_CHAR_CODE,
2378
- /** A dict column without declared options gains one on re-import. */
2379
- OPTIONS_GAINED: OPTIONS_GAINED_CODE,
2380
- /** A spells column in a format without spells. */
2381
- SPELLS: "W_SPELLS_DROPPED",
2382
- /** Dynamic attribute values (extension tables) in a format without them. */
2383
- DYNAMIC_VALUES: "W_DYNAMIC_VALUES_DROPPED",
2384
- /** An open-interval column in a format without open intervals (design section 5.1). */
2385
- OPEN_INTERVAL: "W_OPEN_INTERVAL",
2386
- /** Graph-level attributes in a format without them. */
2387
- GRAPH_ATTRIBUTES: "W_GRAPH_ATTRIBUTES_DROPPED",
2388
- /** A position column in a format without positions. */
2389
- POSITIONS: "W_POSITIONS_DROPPED",
2390
- /** Visual columns in a format without them. */
2391
- VIZ: "W_VIZ_DROPPED",
2392
- /** An extension table the format cannot carry. */
2393
- EXTENSION_TABLE: "W_EXTENSION_TABLE_DROPPED"
2394
- });
2395
- const NO_CAPABILITIES = Object.freeze({
2396
- mixedDirection: false,
2397
- multiEdges: false,
2398
- selfLoops: false,
2399
- edgeIds: "none",
2400
- idCharset: "any",
2401
- dtypes: Object.freeze([]),
2402
- components: false,
2403
- lists: false,
2404
- json: false,
2405
- defaults: false,
2406
- options: false,
2407
- hierarchy: false,
2408
- temporal: "none",
2409
- graphAttributes: false,
2410
- positions: false,
2411
- viz: false
2412
- });
2413
- function capabilities(supported) {
2414
- return Object.freeze({ ...NO_CAPABILITIES, ...supported, dtypes: Object.freeze([...supported.dtypes ?? []]) });
2415
- }
2416
- const STRUCTURAL_ROLES = /* @__PURE__ */ new Set(["directed", "pair", "mutual", "weight", "originalId"]);
2417
- const VIZ_ROLES = /* @__PURE__ */ new Set(["color", "size", "shape", "thickness"]);
2418
- const TEMPORAL_ROLES = /* @__PURE__ */ new Set(["start", "end", "timestamp", "timestamps"]);
2419
- const HIERARCHY_ROLES = /* @__PURE__ */ new Set(["parent", "parents"]);
2420
- function checkCapabilities(snapshot, caps, options, extras = {}) {
2421
- const notes = [];
2422
- const note = (code, message, column = null, count = null) => {
2423
- notes.push(Object.freeze({ code, message, column, count }));
2424
- };
2425
- const mixed = countMixedEdges(snapshot);
2426
- if (mixed > 0 && !caps.mixedDirection) {
2427
- if (options.onMixedDirection === "error") {
2428
- note(
2429
- LOSS.MIXED_DIRECTION_ERROR,
2430
- `${mixed} undirected edge(s) in a directed graph; the format has no mixed direction and onMixedDirection is "error"`,
2431
- null,
2432
- mixed
2433
- );
2434
- } else {
2435
- note(
2436
- LOSS.MIXED_DIRECTION,
2437
- `${mixed} undirected edge(s) in a directed graph written as ${options.onMixedDirection}`,
2438
- null,
2439
- mixed
2440
- );
2441
- }
2442
- }
2443
- if (snapshot.flags.multigraph && !caps.multiEdges) {
2444
- const parallel = countParallelArcs(snapshot);
2445
- note(LOSS.MULTI_EDGES, `${parallel} parallel edge(s); the format has no parallel edges`, null, parallel);
2446
- }
2447
- if (snapshot.selfLoopCount > 0 && !caps.selfLoops) {
2448
- note(
2449
- LOSS.SELF_LOOPS,
2450
- `${snapshot.selfLoopCount} self-loop(s); the format has no self-loops`,
2451
- null,
2452
- snapshot.selfLoopCount
2453
- );
2454
- }
2455
- const edgeIds = snapshot.edges.byRole("id");
2456
- if (caps.edgeIds === "required" && edgeIds === null && snapshot.edgeCount > 0) {
2457
- note(
2458
- LOSS.EDGE_IDS_GENERATED,
2459
- "the format requires edge ids; canonical e0..e{E-1} are generated and not written back",
2460
- null,
2461
- snapshot.edgeCount
2462
- );
2463
- } else if (caps.edgeIds === "none" && edgeIds !== null) {
2464
- note(
2465
- LOSS.EDGE_IDS_DROPPED,
2466
- `edge id column "${edgeIds.meta.name}" cannot be written`,
2467
- edgeIds.meta.name,
2468
- snapshot.edgeCount
2469
- );
2470
- }
2471
- const unrepresentable = countUnrepresentableIds(snapshot, caps.idCharset);
2472
- if (unrepresentable > 0) {
2473
- if (caps.idCharset === "dense-1-based") {
2474
- note(
2475
- LOSS.ID_RENUMBERED,
2476
- options.sanitizeIds === "mangle" ? `${unrepresentable} node id(s) are not their 1-based index; nodes are numbered 1..N, the originals kept in the exporter's originalId attribute (restored by restoreMangledIds) and as labels of the nodes without a label value` : `${unrepresentable} node id(s) are not their 1-based index; nodes are numbered 1..N and ids kept as labels of the nodes without a label value (a node with one loses its id)`,
2477
- null,
2478
- unrepresentable
2479
- );
2480
- } else if (options.sanitizeIds === "mangle") {
2481
- note(
2482
- LOSS.ID_MANGLED,
2483
- `${unrepresentable} node id(s) outside the ${caps.idCharset} charset are rewritten; originals kept in the originalId attribute`,
2484
- null,
2485
- unrepresentable
2486
- );
2487
- } else {
2488
- note(
2489
- LOSS.ID_CHARSET,
2490
- `${unrepresentable} node id(s) outside the ${caps.idCharset} charset; export() will throw unless sanitizeIds is "mangle"`,
2491
- null,
2492
- unrepresentable
2493
- );
2494
- }
2495
- }
2496
- checkColumns(snapshot.nodes, "node", caps, extras, note);
2497
- checkColumns(snapshot.edges, "edge", caps, extras, note);
2498
- const graphColumns = snapshot.graph.names();
2499
- if (graphColumns.length > 0) {
2500
- if (caps.graphAttributes) {
2501
- checkColumns(snapshot.graph, "graph", caps, extras, note);
2502
- } else {
2503
- note(
2504
- LOSS.GRAPH_ATTRIBUTES,
2505
- `${graphColumns.length} graph attribute(s) cannot be written`,
2506
- null,
2507
- graphColumns.length
2508
- );
2509
- }
2510
- }
2511
- for (const [name, table] of snapshot.extensions) {
2512
- if (name.startsWith("temporal:")) {
2513
- if (caps.temporal !== "dynamic-values") {
2514
- note(
2515
- LOSS.DYNAMIC_VALUES,
2516
- `dynamic values of "${name}" (${table.rowCount} row(s)) cannot be written`,
2517
- name,
2518
- table.rowCount
2519
- );
2520
- }
2521
- } else {
2522
- note(
2523
- LOSS.EXTENSION_TABLE,
2524
- `extension table "${name}" (${table.rowCount} row(s)) cannot be written`,
2525
- name,
2526
- table.rowCount
2527
- );
2528
- }
2529
- }
2530
- return notes;
2531
- }
2532
- function checkColumns(table, domain, caps, extras, note) {
2533
- for (const column of table) {
2534
- const { meta } = column;
2535
- const { name, role } = meta;
2536
- if (role !== null && STRUCTURAL_ROLES.has(role)) {
2537
- continue;
2538
- }
2539
- const label = `${domain} column "${name}"`;
2540
- if (role !== null && extras.roleNames !== void 0) {
2541
- const fixed = extras.roleNames[role];
2542
- if (fixed !== void 0 && fixed !== name) {
2543
- note(
2544
- LOSS.COLUMN_NAME_CHANGED,
2545
- `${label} (${role}) is written into the format's ${role} slot and reads back as "${fixed}"`,
2546
- name,
2547
- column.length - column.nullCount
2548
- );
2549
- }
2550
- }
2551
- if (domain === "edge" && role === "id") {
2552
- continue;
2553
- }
2554
- if (role === "timeText") {
2555
- if (extras.temporalText !== true) {
2556
- note(
2557
- LOSS.TEMPORAL_TEXT,
2558
- `${label} (the lexical form of a temporal column, design section 5.1) cannot be written`,
2559
- name,
2560
- column.length - column.nullCount
2561
- );
2562
- }
2563
- continue;
2564
- }
2565
- if (role === "position") {
2566
- if (!caps.positions) {
2567
- note(LOSS.POSITIONS, `${label} (positions) cannot be written`, name, column.length - column.nullCount);
2568
- } else if (extras.positionDtype !== void 0 && meta.dtype !== extras.positionDtype) {
2569
- note(
2570
- LOSS.DTYPE,
2571
- `${label} (positions) is ${meta.dtype}; the format reads positions back as ${extras.positionDtype}`,
2572
- name,
2573
- column.length - column.nullCount
2574
- );
2575
- }
2576
- continue;
2577
- }
2578
- if (role !== null && VIZ_ROLES.has(role)) {
2579
- if (!caps.viz) {
2580
- note(LOSS.VIZ, `${label} (${role}) cannot be written`, name, column.length - column.nullCount);
2581
- }
2582
- continue;
2583
- }
2584
- if (role !== null && HIERARCHY_ROLES.has(role)) {
2585
- if (!caps.hierarchy) {
2586
- note(LOSS.HIERARCHY, `${label} (${role}) cannot be written`, name, column.length - column.nullCount);
2587
- }
2588
- continue;
2589
- }
2590
- if (role !== null && TEMPORAL_ROLES.has(role)) {
2591
- if (caps.temporal === "none") {
2592
- note(LOSS.TEMPORAL, `${label} (${role}) cannot be written`, name, column.length - column.nullCount);
2593
- }
2594
- continue;
2595
- }
2596
- if (role === "spells") {
2597
- if (caps.temporal !== "spells" && caps.temporal !== "dynamic-values") {
2598
- note(LOSS.SPELLS, `${label} (spells) cannot be written`, name, column.length - column.nullCount);
2599
- }
2600
- continue;
2601
- }
2602
- if (role === "open" || role === "spellsOpen") {
2603
- if (extras.openIntervals !== true) {
2604
- note(
2605
- LOSS.OPEN_INTERVAL,
2606
- `${label} (open intervals) cannot be written`,
2607
- name,
2608
- column.length - column.nullCount
2609
- );
2610
- }
2611
- continue;
2612
- }
2613
- if (role !== null && !(extras.roles?.has(role) ?? false)) {
2614
- note(
2615
- LOSS.ROLE,
2616
- `${label} (${role}) is written as a plain attribute; the format has no ${role} slot and the role is lost`,
2617
- name,
2618
- column.length - column.nullCount
2619
- );
2620
- }
2621
- if (meta.dynamic && caps.temporal !== "dynamic-values") {
2622
- note(LOSS.DYNAMIC_VALUES, `${label} is dynamic; only its static value can be written`, name, null);
2623
- }
2624
- checkDtype(column, label, caps, note);
2625
- if (meta.default !== void 0 && !caps.defaults) {
2626
- note(LOSS.DEFAULT, `${label} declares a default; the format has no defaults`, name, null);
2627
- }
2628
- if (meta.options !== null && !caps.options) {
2629
- note(LOSS.OPTIONS, `${label} declares options; the format has no enumerations`, name, null);
2630
- }
2631
- }
2632
- }
2633
- function checkDtype(column, label, caps, note) {
2634
- const { meta } = column;
2635
- const { name } = meta;
2636
- const set = column.length - column.nullCount;
2637
- switch (meta.dtype) {
2638
- case "list":
2639
- if (!caps.lists) {
2640
- note(LOSS.LIST, `${label} is a list; the format has no lists`, name, set);
2641
- } else if (meta.itemDtype !== null && !caps.dtypes.includes(meta.itemDtype)) {
2642
- note(
2643
- LOSS.DTYPE,
2644
- `${label} holds ${meta.itemDtype} items; the format cannot keep that dtype`,
2645
- name,
2646
- set
2647
- );
2648
- } else if (meta.itemDtype === "dict") {
2649
- note(LOSS.DTYPE, `${label} holds dict items; list items read back as string`, name, set);
2650
- }
2651
- break;
2652
- case "json":
2653
- if (!caps.json) {
2654
- note(LOSS.JSON, `${label} holds nested values; the format has no nested values`, name, set);
2655
- }
2656
- break;
2657
- default:
2658
- if (!caps.dtypes.includes(meta.dtype)) {
2659
- note(LOSS.DTYPE, `${label} is ${meta.dtype}; the format cannot keep that dtype`, name, set);
2660
- }
2661
- if (meta.components > 1 && !caps.components) {
2662
- note(
2663
- LOSS.COMPONENTS,
2664
- `${label} has ${meta.components} components; the format has no strides`,
2665
- name,
2666
- set
2667
- );
2668
- }
2669
- break;
2670
- }
2671
- }
2672
- function countMixedEdges(snapshot) {
2673
- if (!snapshot.directed) {
2674
- return 0;
2675
- }
2676
- const directed = snapshot.edges.byRole("directed");
2677
- if (directed === null || directed.dtype !== "bool") {
2678
- return 0;
2679
- }
2680
- const pair = snapshot.edges.byRole("pair");
2681
- let undirectedRows = 0;
2682
- let paired = 0;
2683
- for (let e = 0; e < snapshot.edgeCount; e++) {
2684
- if (directed.isSet(e) && directed.value(e) === false) {
2685
- undirectedRows++;
2686
- if (pair !== null && pair.dtype === "u32" && pair.isSet(e) && pair.data[e] !== INVALID_INDEX) {
2687
- paired++;
2688
- }
2689
- }
2690
- }
2691
- return paired / 2 + (undirectedRows - paired);
2692
- }
2693
- function countParallelArcs(snapshot) {
2694
- const { rowPtr, colIdx, nodeCount } = snapshot;
2695
- let count = 0;
2696
- for (let u = 0; u < nodeCount; u++) {
2697
- for (let a = rowPtr[u] + 1; a < rowPtr[u + 1]; a++) {
2698
- if (colIdx[a] === colIdx[a - 1]) {
2699
- count++;
2700
- }
2701
- }
2702
- }
2703
- return snapshot.directed ? count : Math.ceil(count / 2);
2704
- }
2705
- const NAME_CHAR_RANGES = [
2706
- [45, 46],
2707
- [48, 58],
2708
- [65, 90],
2709
- [95, 95],
2710
- [97, 122],
2711
- [183, 183],
2712
- [192, 214],
2713
- [216, 246],
2714
- [248, 893],
2715
- [895, 8191],
2716
- [8204, 8205],
2717
- [8255, 8256],
2718
- [8304, 8591],
2719
- [11264, 12271],
2720
- [12289, 55295],
2721
- [63744, 64975],
2722
- [65008, 65533],
2723
- [65536, 983039]
2724
- ];
2725
- function isNameChar(cp) {
2726
- for (const [lo, hi] of NAME_CHAR_RANGES) {
2727
- if (cp < lo) {
2728
- return false;
2729
- }
2730
- if (cp <= hi) {
2731
- return true;
2732
- }
2733
- }
2734
- return false;
2735
- }
2736
- function isNmtoken(text) {
2737
- if (text.length === 0) {
2738
- return false;
2739
- }
2740
- for (const ch of text) {
2741
- const cp = ch.codePointAt(0);
2742
- if (cp === void 0 || !isNameChar(cp)) {
2743
- return false;
2744
- }
2745
- }
2746
- return true;
2747
- }
2748
- function isRepresentableId(id, charset) {
2749
- switch (charset) {
2750
- case "any":
2751
- return true;
2752
- case "nmtoken":
2753
- return isNmtoken(String(id));
2754
- case "integer":
2755
- return typeof id === "number" && Number.isSafeInteger(id);
2756
- case "dense-1-based":
2757
- return false;
2758
- default: {
2759
- const name = charset;
2760
- throw new GraphFormatError("E_UNSUPPORTED", `unknown id charset ${name}`, { charset: name });
2761
- }
2762
- }
2763
- }
2764
- function countUnrepresentableIds(snapshot, charset) {
2765
- const { ids } = snapshot;
2766
- if (charset === "any") {
2767
- return 0;
2768
- }
2769
- if (charset === "dense-1-based") {
2770
- if (ids.kind === "identity" && ids.offset === 1) {
2771
- return 0;
2772
- }
2773
- let changed = 0;
2774
- for (let i = 0; i < ids.size; i++) {
2775
- if (ids.idOf(i) !== i + 1) {
2776
- changed++;
2777
- }
2778
- }
2779
- return changed;
2780
- }
2781
- let count = 0;
2782
- for (let i = 0; i < ids.size; i++) {
2783
- if (!isRepresentableId(ids.idOf(i), charset)) {
2784
- count++;
2785
- }
2786
- }
2787
- return count;
2788
- }
2789
- function sanitizeIds(snapshot, charset, mode) {
2790
- const { ids } = snapshot;
2791
- const n = ids.size;
2792
- if (charset === "dense-1-based") {
2793
- const changed = countUnrepresentableIds(snapshot, charset);
2794
- return {
2795
- charset,
2796
- changed,
2797
- idAt: (i) => i + 1,
2798
- isChanged: (i) => ids.idOf(i) !== i + 1,
2799
- originalAt: (i) => ids.idOf(i)
2800
- };
2801
- }
2802
- const unchanged = {
2803
- charset,
2804
- changed: 0,
2805
- idAt: (i) => ids.idOf(i),
2806
- isChanged: () => false,
2807
- originalAt: (i) => ids.idOf(i)
2808
- };
2809
- if (charset === "any") {
2810
- return unchanged;
2811
- }
2812
- const bad = [];
2813
- for (let i = 0; i < n; i++) {
2814
- if (!isRepresentableId(ids.idOf(i), charset)) {
2815
- bad.push(i);
2816
- }
2817
- }
2818
- if (bad.length === 0) {
2819
- return unchanged;
2820
- }
2821
- if (mode === "error") {
2822
- const first = ids.idOf(bad[0]);
2823
- throw new GraphFormatError(
2824
- "E_INVALID_ID",
2825
- `${bad.length} node id(s) cannot be written as ${charset} (first: ${JSON.stringify(first)} at index ${bad[0]}); pass sanitizeIds: "mangle" to rewrite them`,
2826
- { reason: "charset", charset, count: bad.length, id: first, index: bad[0] }
2827
- );
2828
- }
2829
- const written = /* @__PURE__ */ new Map();
2830
- if (charset === "nmtoken") {
2831
- const used = /* @__PURE__ */ new Set();
2832
- for (let i = 0; i < n; i++) {
2833
- const id = ids.idOf(i);
2834
- if (isRepresentableId(id, charset)) {
2835
- used.add(String(id));
2836
- }
2837
- }
2838
- for (const i of bad) {
2839
- const base = mangleNmtoken(String(ids.idOf(i)));
2840
- let candidate = base;
2841
- for (let k = 2; used.has(candidate); k++) {
2842
- candidate = `${base}_${k}`;
2843
- }
2844
- used.add(candidate);
2845
- written.set(i, candidate);
2846
- }
2847
- } else {
2848
- const used = /* @__PURE__ */ new Set();
2849
- for (let i = 0; i < n; i++) {
2850
- const id = ids.idOf(i);
2851
- if (typeof id === "number" && Number.isSafeInteger(id)) {
2852
- used.add(id);
2853
- }
2854
- }
2855
- let next = 0;
2856
- for (const i of bad) {
2857
- while (used.has(next)) {
2858
- next++;
2859
- }
2860
- used.add(next);
2861
- written.set(i, next);
2862
- next++;
2863
- }
2864
- }
2865
- return {
2866
- charset,
2867
- changed: bad.length,
2868
- idAt: (i) => written.get(i) ?? ids.idOf(i),
2869
- isChanged: (i) => written.has(i),
2870
- originalAt: (i) => ids.idOf(i)
2871
- };
2872
- }
2873
- function mangleNmtoken(text) {
2874
- let out = "";
2875
- for (const ch of text) {
2876
- const cp = ch.codePointAt(0);
2877
- out += cp !== void 0 && isNameChar(cp) ? ch : "_";
2878
- }
2879
- return out.length === 0 ? "_" : out;
2880
- }
2881
- const DEFAULT_CHUNK_BYTES = 64 * 1024;
2882
- async function* encodeChunks(parts, chunkBytes = DEFAULT_CHUNK_BYTES) {
2883
- const encoder = new TextEncoder();
2884
- let pending = [];
2885
- let pendingUnits = 0;
2886
- for await (const part of parts) {
2887
- if (part.length === 0) {
2888
- continue;
2889
- }
2890
- pending.push(part);
2891
- pendingUnits += part.length;
2892
- if (pendingUnits >= chunkBytes) {
2893
- yield encoder.encode(pending.length === 1 ? pending[0] : pending.join(""));
2894
- pending = [];
2895
- pendingUnits = 0;
2896
- }
2897
- }
2898
- if (pending.length > 0) {
2899
- yield encoder.encode(pending.length === 1 ? pending[0] : pending.join(""));
2900
- }
2901
- }
2902
- async function joinText(parts) {
2903
- const collected = [];
2904
- for await (const part of parts) {
2905
- collected.push(part);
2906
- }
2907
- return collected.join("");
2908
- }
2909
- async function decodeChunks(chunks) {
2910
- const decoder = new TextDecoder("utf-8", { fatal: true });
2911
- const parts = [];
2912
- for await (const chunk of chunks) {
2913
- parts.push(decoder.decode(chunk, { stream: true }));
2914
- }
2915
- parts.push(decoder.decode());
2916
- return parts.join("");
2917
- }
2918
- async function collectBytes(chunks) {
2919
- const parts = [];
2920
- let total = 0;
2921
- for await (const chunk of chunks) {
2922
- parts.push(chunk);
2923
- total += chunk.byteLength;
2924
- }
2925
- const out = new Uint8Array(total);
2926
- let offset = 0;
2927
- for (const part of parts) {
2928
- out.set(part, offset);
2929
- offset += part.byteLength;
2930
- }
2931
- return out;
2932
- }
2933
- function toReadableStream(chunks) {
2934
- const iterator = chunks[Symbol.asyncIterator]();
2935
- return new ReadableStream({
2936
- async pull(controller) {
2937
- const { done, value } = await iterator.next();
2938
- if (done) {
2939
- controller.close();
2940
- return;
2941
- }
2942
- controller.enqueue(value);
2943
- },
2944
- async cancel() {
2945
- await iterator.return?.(void 0);
2946
- }
2947
- });
2948
- }
2949
2225
  export {
2950
- SYNTAX_CODE as $,
2951
- MULTIPLE_GRAPHS_CODE as A,
2952
- BAD_DEFAULT_CODE as B,
2226
+ RENAMED_CODE as $,
2227
+ AMBIGUOUS_GRAPH_NAME_CODE as A,
2228
+ BAD_ASPECT_BLOCK_CODE as B,
2953
2229
  COLUMN_RENAMED_CODE as C,
2954
- DEFAULT_CHUNK_BYTES as D,
2230
+ DANGLING_REFERENCE_CODE as D,
2955
2231
  EMPTY_COLUMN_DROPPED_CODE as E,
2956
- MUTUAL_AS_UNDIRECTED_CODE as F,
2957
- MUTUAL_COLUMN as G,
2232
+ INVALID_UTF8_CODE as F,
2233
+ GRAPH_NOT_FOUND_CODE as G,
2958
2234
  HYPEREDGE_CODE as H,
2959
2235
  ImportReportBuilder as I,
2960
- MUTUAL_EXPANDED_CODE as J,
2961
- NO_GRAPH_CODE as K,
2962
- LOSS as L,
2236
+ IdCoercer as J,
2237
+ ImportError as K,
2238
+ LineReader as L,
2963
2239
  MISSING_ENDPOINT_CODE as M,
2964
- NO_CAPABILITIES as N,
2965
- OPTIONS_GAINED_CODE as O,
2966
- OPTION_IGNORED_CODE as P,
2967
- PAIR_COLUMN as Q,
2968
- PARENTS_DROPPED_CODE as R,
2969
- PARSE_ERROR_CODE as S,
2970
- PRECISION_CODE as T,
2971
- RENAMED_CODE as U,
2972
- ROLE_ASSUMED_CODE as V,
2973
- ROLE_DROPPED_CODE as W,
2974
- ROLE_TAKEN_CODE as X,
2975
- SINK_OPTION_CODE as Y,
2976
- STORAGE_CLASS_CODE as Z,
2977
- STRAY_TEXT_CODE as _,
2240
+ MISSING_ID_CODE as N,
2241
+ MIXED_DIRECTION_CODE as O,
2242
+ MULTIPLE_GRAPHS_CODE as P,
2243
+ MUTUAL_AS_UNDIRECTED_CODE as Q,
2244
+ MUTUAL_COLUMN as R,
2245
+ MUTUAL_EXPANDED_CODE as S,
2246
+ NO_GRAPH_CODE as T,
2247
+ OPTIONS_GAINED_CODE as U,
2248
+ OPTION_IGNORED_CODE as V,
2249
+ PAIR_COLUMN as W,
2250
+ PARENTS_DROPPED_CODE as X,
2251
+ PARENT_CYCLE_CODE as Y,
2252
+ PARSE_ERROR_CODE as Z,
2253
+ PRECISION_CODE as _,
2978
2254
  throwIfAborted as a,
2979
- DICT_SAMPLE_ROWS as a$,
2980
- TEMPORAL_DROPPED_CODE as a0,
2981
- TEMPORAL_TEXT_DROPPED_CODE as a1,
2982
- TEXT_INFERRED_CODE as a2,
2983
- UNKNOWN_ATTR_TYPE_CODE as a3,
2984
- UNKNOWN_ELEMENT_CODE as a4,
2985
- UNKNOWN_ENCODING_CODE as a5,
2986
- UNKNOWN_PARENT_CODE as a6,
2987
- UNKNOWN_TYPE_CODE as a7,
2988
- WEIGHT_KEY_CLASH_CODE as a8,
2989
- XML_ILLEGAL_CHAR_CODE as a9,
2990
- parseWeightText as aA,
2991
- readText as aB,
2992
- reportSinkOptions as aC,
2993
- reportUnusedOptions as aD,
2994
- resolveExportOptions as aE,
2995
- resolveImportOptions as aF,
2996
- sanitizeIds as aG,
2997
- toReadableStream as aH,
2998
- isNameChar as aI,
2999
- countMixedEdges as aJ,
3000
- weightFromValue as aK,
3001
- uniqueColumnName as aL,
3002
- TIME_TEXT_ROLE as aM,
3003
- TIME_TEXT_SUFFIX as aN,
3004
- declareAttribute as aO,
3005
- parseDeclaredTemporal as aP,
3006
- parseDeclaredValue as aQ,
3007
- losesPrecision as aR,
3008
- parseTimeText as aS,
3009
- splitListText as aT,
3010
- timeTextCompanion as aU,
3011
- parseDecimalText as aV,
3012
- formatTimeValue as aW,
3013
- mapDeclaredType as aX,
3014
- joinListText as aY,
3015
- formatTemporal as aZ,
3016
- DictHeuristic as a_,
3017
- XML_SYNTAX_CODE as aa,
3018
- canonicalId as ab,
3019
- capabilities as ac,
3020
- checkCapabilities as ad,
3021
- coerceId as ae,
3022
- coerceIdText as af,
3023
- collectBytes as ag,
3024
- declareCompanion as ah,
3025
- declareResolved as ai,
3026
- decodeChunks as aj,
3027
- encodeChunks as ak,
3028
- explicitWeights as al,
3029
- formatDecimal as am,
3030
- formatF32 as an,
3031
- formatF64 as ao,
3032
- formatGmlReal as ap,
3033
- formatInteger as aq,
3034
- inputLength as ar,
3035
- isAbortError as as,
3036
- isCanonicalIntegerText as at,
3037
- isImportInput as au,
3038
- isNmtoken as av,
3039
- isWeightField as aw,
3040
- joinText as ax,
3041
- mangleNmtoken as ay,
3042
- pairFolding as az,
3043
- BAD_OPTIONS_CODE as b,
3044
- declareOn as b0,
3045
- takenIn as b1,
3046
- COLUMN_RENAMED_LOSS_CODE as c,
3047
- COUNT_HINT_CODE as d,
3048
- DEFAULT_ERROR_LIMIT as e,
3049
- DIRECTED_COLUMN as f,
3050
- DIRECTION_FORCED_CODE as g,
3051
- DIRECTION_REFUSED_CODE as h,
3052
- DUPLICATE_EDGE_ID_CODE as i,
3053
- DUPLICATE_KEY_CODE as j,
3054
- DUPLICATE_NODE_CODE as k,
3055
- DirectionResolver as l,
3056
- EMPTY_INPUT_CODE as m,
3057
- ENCODING_FALLBACK_CODE as n,
3058
- ID_MERGED_CODE as o,
3059
- ID_TEXT_COLLISION_CODE as p,
3060
- ID_TEXT_TYPE_CODE as q,
3061
- INTEGRAL_F64_CODE as r,
3062
- INVALID_ENCODING_CODE as s,
2255
+ ROLE_ASSUMED_CODE as a0,
2256
+ ROLE_DROPPED_CODE as a1,
2257
+ ROLE_TAKEN_CODE as a2,
2258
+ SINK_OPTION_CODE as a3,
2259
+ STATUS_FAILED_CODE as a4,
2260
+ STATUS_WARNING_CODE as a5,
2261
+ STORAGE_CLASS_CODE as a6,
2262
+ STRAY_TEXT_CODE as a7,
2263
+ STYLES_NOT_IMPORTED_CODE as a8,
2264
+ SYNTAX_CODE as a9,
2265
+ reportSinkOptions as aA,
2266
+ reportUnusedOptions as aB,
2267
+ resolveExportOptions as aC,
2268
+ resolveImportOptions as aD,
2269
+ uniqueColumnName as aE,
2270
+ TIME_TEXT_ROLE as aF,
2271
+ TIME_TEXT_SUFFIX as aG,
2272
+ declareAttribute as aH,
2273
+ parseDeclaredTemporal as aI,
2274
+ parseDeclaredValue as aJ,
2275
+ losesPrecision as aK,
2276
+ parseTimeText as aL,
2277
+ splitListText as aM,
2278
+ timeTextCompanion as aN,
2279
+ parseDecimalText as aO,
2280
+ formatTimeValue as aP,
2281
+ mapDeclaredType as aQ,
2282
+ joinListText as aR,
2283
+ formatTemporal as aS,
2284
+ DictHeuristic as aT,
2285
+ DICT_SAMPLE_ROWS as aU,
2286
+ declareOn as aV,
2287
+ takenIn as aW,
2288
+ TEMPORAL_DROPPED_CODE as aa,
2289
+ TEMPORAL_TEXT_DROPPED_CODE as ab,
2290
+ TEXT_INFERRED_CODE as ac,
2291
+ TOO_LARGE_CODE as ad,
2292
+ UNKNOWN_ATTR_TYPE_CODE as ae,
2293
+ UNKNOWN_ELEMENT_CODE as af,
2294
+ UNKNOWN_ENCODING_CODE as ag,
2295
+ UNKNOWN_PARENT_CODE as ah,
2296
+ UNKNOWN_TYPE_CODE as ai,
2297
+ WEIGHT_KEY_CLASH_CODE as aj,
2298
+ WIDENED_CODE as ak,
2299
+ XML_ILLEGAL_CHAR_CODE as al,
2300
+ XML_SYNTAX_CODE as am,
2301
+ canonicalId as an,
2302
+ chooseGraph as ao,
2303
+ coerceId as ap,
2304
+ coerceIdText as aq,
2305
+ declareCompanion as ar,
2306
+ declareResolved as as,
2307
+ decodeEntryName as at,
2308
+ inputLength as au,
2309
+ isAbortError as av,
2310
+ isCanonicalIntegerText as aw,
2311
+ isImportInput as ax,
2312
+ pairFolding as ay,
2313
+ readText as az,
2314
+ ASPECT_ORDER_CODE as b,
2315
+ BAD_DEFAULT_CODE as c,
2316
+ BAD_OPTIONS_CODE as d,
2317
+ BAD_VALUE_CODE as e,
2318
+ COLUMN_RENAMED_LOSS_CODE as f,
2319
+ COUNT_HINT_CODE as g,
2320
+ COUNT_MISMATCH_CODE as h,
2321
+ DEFAULT_ERROR_LIMIT as i,
2322
+ DIRECTED_COLUMN as j,
2323
+ DIRECTION_FORCED_CODE as k,
2324
+ DIRECTION_REFUSED_CODE as l,
2325
+ DUPLICATE_ATTRIBUTE_CODE as m,
2326
+ DUPLICATE_EDGE_ID_CODE as n,
2327
+ DUPLICATE_KEY_CODE as o,
2328
+ DUPLICATE_NODE_CODE as p,
2329
+ DirectionResolver as q,
2330
+ EMPTY_INPUT_CODE as r,
2331
+ ENCODING_FALLBACK_CODE as s,
3063
2332
  textChunks as t,
3064
- INVALID_UTF8_CODE as u,
3065
- IdCoercer as v,
3066
- ImportError as w,
3067
- LineReader as x,
3068
- MISSING_ID_CODE as y,
3069
- MIXED_DIRECTION_CODE as z
2333
+ EQUATION_AS_TEXT_CODE as u,
2334
+ ID_MERGED_CODE as v,
2335
+ ID_TEXT_COLLISION_CODE as w,
2336
+ ID_TEXT_TYPE_CODE as x,
2337
+ INTEGRAL_F64_CODE as y,
2338
+ INVALID_ENCODING_CODE as z
3070
2339
  };
3071
- //# sourceMappingURL=writer-BtWpUaiH.js.map
2340
+ //# sourceMappingURL=report-BOk0p5y8.js.map