@graphty/graph-io 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +250 -28
- package/dist/chunks/children-CL3Cy0ez.js +238 -0
- package/dist/chunks/children-CL3Cy0ez.js.map +1 -0
- package/dist/chunks/escape-DyI8JofU.js +938 -0
- package/dist/chunks/escape-DyI8JofU.js.map +1 -0
- package/dist/chunks/importer-CQnJuWJw.js +2987 -0
- package/dist/chunks/importer-CQnJuWJw.js.map +1 -0
- package/dist/chunks/importer-CpCpfbxr.js +2015 -0
- package/dist/chunks/importer-CpCpfbxr.js.map +1 -0
- package/dist/chunks/importer-DbnGYr3_.js +2342 -0
- package/dist/chunks/importer-DbnGYr3_.js.map +1 -0
- package/dist/chunks/importer-GozH8DkN.js +3050 -0
- package/dist/chunks/importer-GozH8DkN.js.map +1 -0
- package/dist/chunks/records-CGpxszm1.js +605 -0
- package/dist/chunks/records-CGpxszm1.js.map +1 -0
- package/dist/chunks/text-CajMdVFy.js +189 -0
- package/dist/chunks/text-CajMdVFy.js.map +1 -0
- package/dist/chunks/writer-DxSKC7TL.js +2842 -0
- package/dist/chunks/writer-DxSKC7TL.js.map +1 -0
- package/dist/csv.d.ts +1 -0
- package/dist/csv.js +1702 -0
- package/dist/csv.js.map +1 -0
- package/dist/dot.d.ts +1 -0
- package/dist/dot.js +8 -0
- package/dist/dot.js.map +1 -0
- package/dist/gexf.d.ts +1 -0
- package/dist/gexf.js +3466 -0
- package/dist/gexf.js.map +1 -0
- package/dist/gml.d.ts +1 -0
- package/dist/gml.js +2647 -0
- package/dist/gml.js.map +1 -0
- package/dist/graph-io.d.ts +1 -0
- package/dist/graph-io.js +790 -0
- package/dist/graph-io.js.map +1 -0
- package/dist/graphml.d.ts +1 -0
- package/dist/graphml.js +8 -0
- package/dist/graphml.js.map +1 -0
- package/dist/json.d.ts +1 -0
- package/dist/json.js +11 -0
- package/dist/json.js.map +1 -0
- package/dist/neo4j.d.ts +1 -0
- package/dist/neo4j.js +2046 -0
- package/dist/neo4j.js.map +1 -0
- package/dist/pajek.d.ts +1 -0
- package/dist/pajek.js +8 -0
- package/dist/pajek.js.map +1 -0
- package/dist/src/children.d.ts +134 -0
- package/dist/src/children.d.ts.map +1 -0
- package/dist/src/children.js +274 -0
- package/dist/src/children.js.map +1 -0
- package/dist/src/common/attributes.d.ts +229 -0
- package/dist/src/common/attributes.d.ts.map +1 -0
- package/dist/src/common/attributes.js +368 -0
- package/dist/src/common/attributes.js.map +1 -0
- package/dist/src/common/codes.d.ts +105 -0
- package/dist/src/common/codes.d.ts.map +1 -0
- package/dist/src/common/codes.js +107 -0
- package/dist/src/common/codes.js.map +1 -0
- package/dist/src/common/declared-types.d.ts +84 -0
- package/dist/src/common/declared-types.d.ts.map +1 -0
- package/dist/src/common/declared-types.js +326 -0
- package/dist/src/common/declared-types.js.map +1 -0
- package/dist/src/common/direction.d.ts +206 -0
- package/dist/src/common/direction.d.ts.map +1 -0
- package/dist/src/common/direction.js +370 -0
- package/dist/src/common/direction.js.map +1 -0
- package/dist/src/common/escape.d.ts +92 -0
- package/dist/src/common/escape.d.ts.map +1 -0
- package/dist/src/common/escape.js +212 -0
- package/dist/src/common/escape.js.map +1 -0
- package/dist/src/common/export.d.ts +249 -0
- package/dist/src/common/export.d.ts.map +1 -0
- package/dist/src/common/export.js +594 -0
- package/dist/src/common/export.js.map +1 -0
- package/dist/src/common/format.d.ts +59 -0
- package/dist/src/common/format.d.ts.map +1 -0
- package/dist/src/common/format.js +106 -0
- package/dist/src/common/format.js.map +1 -0
- package/dist/src/common/ids.d.ts +83 -0
- package/dist/src/common/ids.d.ts.map +1 -0
- package/dist/src/common/ids.js +158 -0
- package/dist/src/common/ids.js.map +1 -0
- package/dist/src/common/input.d.ts +100 -0
- package/dist/src/common/input.d.ts.map +1 -0
- package/dist/src/common/input.js +335 -0
- package/dist/src/common/input.js.map +1 -0
- package/dist/src/common/lists.d.ts +34 -0
- package/dist/src/common/lists.d.ts.map +1 -0
- package/dist/src/common/lists.js +185 -0
- package/dist/src/common/lists.js.map +1 -0
- package/dist/src/common/options.d.ts +108 -0
- package/dist/src/common/options.d.ts.map +1 -0
- package/dist/src/common/options.js +265 -0
- package/dist/src/common/options.js.map +1 -0
- package/dist/src/common/report.d.ts +187 -0
- package/dist/src/common/report.d.ts.map +1 -0
- package/dist/src/common/report.js +274 -0
- package/dist/src/common/report.js.map +1 -0
- package/dist/src/common/temporal.d.ts +71 -0
- package/dist/src/common/temporal.d.ts.map +1 -0
- package/dist/src/common/temporal.js +266 -0
- package/dist/src/common/temporal.js.map +1 -0
- package/dist/src/common/text.d.ts +104 -0
- package/dist/src/common/text.d.ts.map +1 -0
- package/dist/src/common/text.js +255 -0
- package/dist/src/common/text.js.map +1 -0
- package/dist/src/common/weights.d.ts +77 -0
- package/dist/src/common/weights.d.ts.map +1 -0
- package/dist/src/common/weights.js +156 -0
- package/dist/src/common/weights.js.map +1 -0
- package/dist/src/common/writer.d.ts +51 -0
- package/dist/src/common/writer.d.ts.map +1 -0
- package/dist/src/common/writer.js +108 -0
- package/dist/src/common/writer.js.map +1 -0
- package/dist/src/common/xml.d.ts +245 -0
- package/dist/src/common/xml.d.ts.map +1 -0
- package/dist/src/common/xml.js +942 -0
- package/dist/src/common/xml.js.map +1 -0
- package/dist/src/formats/csv/exporter.d.ts +70 -0
- package/dist/src/formats/csv/exporter.d.ts.map +1 -0
- package/dist/src/formats/csv/exporter.js +682 -0
- package/dist/src/formats/csv/exporter.js.map +1 -0
- package/dist/src/formats/csv/header.d.ts +66 -0
- package/dist/src/formats/csv/header.d.ts.map +1 -0
- package/dist/src/formats/csv/header.js +152 -0
- package/dist/src/formats/csv/header.js.map +1 -0
- package/dist/src/formats/csv/importer.d.ts +82 -0
- package/dist/src/formats/csv/importer.d.ts.map +1 -0
- package/dist/src/formats/csv/importer.js +849 -0
- package/dist/src/formats/csv/importer.js.map +1 -0
- package/dist/src/formats/csv/index.d.ts +60 -0
- package/dist/src/formats/csv/index.d.ts.map +1 -0
- package/dist/src/formats/csv/index.js +63 -0
- package/dist/src/formats/csv/index.js.map +1 -0
- package/dist/src/formats/csv/records.d.ts +188 -0
- package/dist/src/formats/csv/records.d.ts.map +1 -0
- package/dist/src/formats/csv/records.js +702 -0
- package/dist/src/formats/csv/records.js.map +1 -0
- package/dist/src/formats/csv/values.d.ts +105 -0
- package/dist/src/formats/csv/values.d.ts.map +1 -0
- package/dist/src/formats/csv/values.js +192 -0
- package/dist/src/formats/csv/values.js.map +1 -0
- package/dist/src/formats/dot/exporter.d.ts +52 -0
- package/dist/src/formats/dot/exporter.d.ts.map +1 -0
- package/dist/src/formats/dot/exporter.js +836 -0
- package/dist/src/formats/dot/exporter.js.map +1 -0
- package/dist/src/formats/dot/importer.d.ts +102 -0
- package/dist/src/formats/dot/importer.d.ts.map +1 -0
- package/dist/src/formats/dot/importer.js +1291 -0
- package/dist/src/formats/dot/importer.js.map +1 -0
- package/dist/src/formats/dot/index.d.ts +7 -0
- package/dist/src/formats/dot/index.d.ts.map +1 -0
- package/dist/src/formats/dot/index.js +7 -0
- package/dist/src/formats/dot/index.js.map +1 -0
- package/dist/src/formats/dot/names.d.ts +29 -0
- package/dist/src/formats/dot/names.d.ts.map +1 -0
- package/dist/src/formats/dot/names.js +28 -0
- package/dist/src/formats/dot/names.js.map +1 -0
- package/dist/src/formats/dot/tokenizer.d.ts +114 -0
- package/dist/src/formats/dot/tokenizer.d.ts.map +1 -0
- package/dist/src/formats/dot/tokenizer.js +341 -0
- package/dist/src/formats/dot/tokenizer.js.map +1 -0
- package/dist/src/formats/gexf/exporter.d.ts +56 -0
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -0
- package/dist/src/formats/gexf/exporter.js +1395 -0
- package/dist/src/formats/gexf/exporter.js.map +1 -0
- package/dist/src/formats/gexf/importer.d.ts +73 -0
- package/dist/src/formats/gexf/importer.d.ts.map +1 -0
- package/dist/src/formats/gexf/importer.js +1880 -0
- package/dist/src/formats/gexf/importer.js.map +1 -0
- package/dist/src/formats/gexf/index.d.ts +96 -0
- package/dist/src/formats/gexf/index.d.ts.map +1 -0
- package/dist/src/formats/gexf/index.js +97 -0
- package/dist/src/formats/gexf/index.js.map +1 -0
- package/dist/src/formats/gexf/schema.d.ts +135 -0
- package/dist/src/formats/gexf/schema.d.ts.map +1 -0
- package/dist/src/formats/gexf/schema.js +323 -0
- package/dist/src/formats/gexf/schema.js.map +1 -0
- package/dist/src/formats/gml/exporter.d.ts +69 -0
- package/dist/src/formats/gml/exporter.d.ts.map +1 -0
- package/dist/src/formats/gml/exporter.js +1093 -0
- package/dist/src/formats/gml/exporter.js.map +1 -0
- package/dist/src/formats/gml/importer.d.ts +66 -0
- package/dist/src/formats/gml/importer.d.ts.map +1 -0
- package/dist/src/formats/gml/importer.js +1331 -0
- package/dist/src/formats/gml/importer.js.map +1 -0
- package/dist/src/formats/gml/index.d.ts +85 -0
- package/dist/src/formats/gml/index.d.ts.map +1 -0
- package/dist/src/formats/gml/index.js +88 -0
- package/dist/src/formats/gml/index.js.map +1 -0
- package/dist/src/formats/gml/syntax.d.ts +186 -0
- package/dist/src/formats/gml/syntax.d.ts.map +1 -0
- package/dist/src/formats/gml/syntax.js +467 -0
- package/dist/src/formats/gml/syntax.js.map +1 -0
- package/dist/src/formats/graphml/constants.d.ts +169 -0
- package/dist/src/formats/graphml/constants.d.ts.map +1 -0
- package/dist/src/formats/graphml/constants.js +165 -0
- package/dist/src/formats/graphml/constants.js.map +1 -0
- package/dist/src/formats/graphml/exporter.d.ts +34 -0
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -0
- package/dist/src/formats/graphml/exporter.js +1176 -0
- package/dist/src/formats/graphml/exporter.js.map +1 -0
- package/dist/src/formats/graphml/importer.d.ts +31 -0
- package/dist/src/formats/graphml/importer.d.ts.map +1 -0
- package/dist/src/formats/graphml/importer.js +1607 -0
- package/dist/src/formats/graphml/importer.js.map +1 -0
- package/dist/src/formats/graphml/index.d.ts +8 -0
- package/dist/src/formats/graphml/index.d.ts.map +1 -0
- package/dist/src/formats/graphml/index.js +8 -0
- package/dist/src/formats/graphml/index.js.map +1 -0
- package/dist/src/formats/graphml/tree.d.ts +72 -0
- package/dist/src/formats/graphml/tree.d.ts.map +1 -0
- package/dist/src/formats/graphml/tree.js +290 -0
- package/dist/src/formats/graphml/tree.js.map +1 -0
- package/dist/src/formats/json/dialect.d.ts +125 -0
- package/dist/src/formats/json/dialect.d.ts.map +1 -0
- package/dist/src/formats/json/dialect.js +262 -0
- package/dist/src/formats/json/dialect.js.map +1 -0
- package/dist/src/formats/json/exporter.d.ts +89 -0
- package/dist/src/formats/json/exporter.d.ts.map +1 -0
- package/dist/src/formats/json/exporter.js +1358 -0
- package/dist/src/formats/json/exporter.js.map +1 -0
- package/dist/src/formats/json/importer.d.ts +108 -0
- package/dist/src/formats/json/importer.d.ts.map +1 -0
- package/dist/src/formats/json/importer.js +1838 -0
- package/dist/src/formats/json/importer.js.map +1 -0
- package/dist/src/formats/json/index.d.ts +8 -0
- package/dist/src/formats/json/index.d.ts.map +1 -0
- package/dist/src/formats/json/index.js +8 -0
- package/dist/src/formats/json/index.js.map +1 -0
- package/dist/src/formats/neo4j/exporter.d.ts +68 -0
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -0
- package/dist/src/formats/neo4j/exporter.js +1055 -0
- package/dist/src/formats/neo4j/exporter.js.map +1 -0
- package/dist/src/formats/neo4j/header.d.ts +52 -0
- package/dist/src/formats/neo4j/header.d.ts.map +1 -0
- package/dist/src/formats/neo4j/header.js +131 -0
- package/dist/src/formats/neo4j/header.js.map +1 -0
- package/dist/src/formats/neo4j/importer.d.ts +73 -0
- package/dist/src/formats/neo4j/importer.d.ts.map +1 -0
- package/dist/src/formats/neo4j/importer.js +932 -0
- package/dist/src/formats/neo4j/importer.js.map +1 -0
- package/dist/src/formats/neo4j/index.d.ts +79 -0
- package/dist/src/formats/neo4j/index.d.ts.map +1 -0
- package/dist/src/formats/neo4j/index.js +83 -0
- package/dist/src/formats/neo4j/index.js.map +1 -0
- package/dist/src/formats/pajek/exporter.d.ts +58 -0
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -0
- package/dist/src/formats/pajek/exporter.js +825 -0
- package/dist/src/formats/pajek/exporter.js.map +1 -0
- package/dist/src/formats/pajek/importer.d.ts +88 -0
- package/dist/src/formats/pajek/importer.d.ts.map +1 -0
- package/dist/src/formats/pajek/importer.js +1047 -0
- package/dist/src/formats/pajek/importer.js.map +1 -0
- package/dist/src/formats/pajek/index.d.ts +7 -0
- package/dist/src/formats/pajek/index.d.ts.map +1 -0
- package/dist/src/formats/pajek/index.js +7 -0
- package/dist/src/formats/pajek/index.js.map +1 -0
- package/dist/src/formats/pajek/syntax.d.ts +112 -0
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -0
- package/dist/src/formats/pajek/syntax.js +269 -0
- package/dist/src/formats/pajek/syntax.js.map +1 -0
- package/dist/src/index.d.ts +35 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +39 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/registry.d.ts +207 -0
- package/dist/src/registry.d.ts.map +1 -0
- package/dist/src/registry.js +481 -0
- package/dist/src/registry.js.map +1 -0
- package/dist/src/sniff.d.ts +104 -0
- package/dist/src/sniff.d.ts.map +1 -0
- package/dist/src/sniff.js +357 -0
- package/dist/src/sniff.js.map +1 -0
- package/dist/src/types.d.ts +238 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +29 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +122 -7
- package/src/children.ts +335 -0
- package/src/common/attributes.ts +520 -0
- package/src/common/codes.ts +153 -0
- package/src/common/declared-types.ts +374 -0
- package/src/common/direction.ts +518 -0
- package/src/common/escape.ts +231 -0
- package/src/common/export.ts +817 -0
- package/src/common/format.ts +111 -0
- package/src/common/ids.ts +176 -0
- package/src/common/input.ts +378 -0
- package/src/common/lists.ts +196 -0
- package/src/common/options.ts +377 -0
- package/src/common/report.ts +352 -0
- package/src/common/temporal.ts +302 -0
- package/src/common/text.ts +294 -0
- package/src/common/weights.ts +202 -0
- package/src/common/writer.ts +123 -0
- package/src/common/xml.ts +1053 -0
- package/src/formats/csv/exporter.ts +894 -0
- package/src/formats/csv/header.ts +172 -0
- package/src/formats/csv/importer.ts +1104 -0
- package/src/formats/csv/index.ts +88 -0
- package/src/formats/csv/records.ts +813 -0
- package/src/formats/csv/values.ts +224 -0
- package/src/formats/dot/exporter.ts +1014 -0
- package/src/formats/dot/importer.ts +1549 -0
- package/src/formats/dot/index.ts +7 -0
- package/src/formats/dot/names.ts +40 -0
- package/src/formats/dot/tokenizer.ts +384 -0
- package/src/formats/gexf/exporter.ts +1696 -0
- package/src/formats/gexf/importer.ts +2333 -0
- package/src/formats/gexf/index.ts +142 -0
- package/src/formats/gexf/schema.ts +361 -0
- package/src/formats/gml/exporter.ts +1404 -0
- package/src/formats/gml/importer.ts +1591 -0
- package/src/formats/gml/index.ts +128 -0
- package/src/formats/gml/syntax.ts +545 -0
- package/src/formats/graphml/constants.ts +225 -0
- package/src/formats/graphml/exporter.ts +1458 -0
- package/src/formats/graphml/importer.ts +2027 -0
- package/src/formats/graphml/index.ts +8 -0
- package/src/formats/graphml/tree.ts +318 -0
- package/src/formats/json/dialect.ts +317 -0
- package/src/formats/json/exporter.ts +1616 -0
- package/src/formats/json/importer.ts +2271 -0
- package/src/formats/json/index.ts +8 -0
- package/src/formats/neo4j/exporter.ts +1287 -0
- package/src/formats/neo4j/header.ts +156 -0
- package/src/formats/neo4j/importer.ts +1220 -0
- package/src/formats/neo4j/index.ts +116 -0
- package/src/formats/pajek/exporter.ts +1000 -0
- package/src/formats/pajek/importer.ts +1311 -0
- package/src/formats/pajek/index.ts +7 -0
- package/src/formats/pajek/syntax.ts +307 -0
- package/src/index.ts +244 -0
- package/src/registry.ts +617 -0
- package/src/sniff.ts +397 -0
- package/src/types.ts +262 -0
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exporter-side machinery of design section 8.5: the ExportCapabilities table helper, the
|
|
3
|
+
* generic check() that turns capability gaps into LossNotes with shared codes, and id sanitising
|
|
4
|
+
* (`sanitizeIds: "error"` by default; an exporter never silently renames a node; "mangle" rewrites
|
|
5
|
+
* the ids the format cannot hold and hands the exporter the originals to write into its
|
|
6
|
+
* `graphty:originalId` attribute).
|
|
7
|
+
*
|
|
8
|
+
* Every exporter's check() calls checkCapabilities() first and appends its format-specific notes
|
|
9
|
+
* (design section 8.5 names W_GML_RECORD_NUMBER_TYPE and W_OPEN_INTERVAL); export() calls
|
|
10
|
+
* sanitizeIds() before writing anything.
|
|
11
|
+
*/
|
|
12
|
+
import { GraphFormatError, INVALID_INDEX, } from "@graphty/graph-format";
|
|
13
|
+
import { COLUMN_RENAMED_LOSS_CODE, EMPTY_COLUMN_DROPPED_CODE, ID_TEXT_COLLISION_CODE, ID_TEXT_TYPE_CODE, INTEGRAL_F64_CODE, MIXED_DIRECTION_CODE, MUTUAL_AS_UNDIRECTED_CODE, MUTUAL_EXPANDED_CODE, OPTIONS_GAINED_CODE, PARENTS_DROPPED_CODE, ROLE_ASSUMED_CODE, ROLE_DROPPED_CODE, STORAGE_CLASS_CODE, TEMPORAL_DROPPED_CODE, TEMPORAL_TEXT_DROPPED_CODE, TEXT_INFERRED_CODE, WEIGHT_KEY_CLASH_CODE, XML_ILLEGAL_CHAR_CODE, } from "./codes.js";
|
|
14
|
+
/** The shared LossNote codes of checkCapabilities(). */
|
|
15
|
+
export const LOSS = Object.freeze({
|
|
16
|
+
/** The format has no mixed direction; expanded pairs are written per onMixedDirection. */
|
|
17
|
+
MIXED_DIRECTION: "W_MIXED_DIRECTION",
|
|
18
|
+
/** The format has no mixed direction and onMixedDirection is "error": export() will throw E_DIRECTED. */
|
|
19
|
+
MIXED_DIRECTION_ERROR: MIXED_DIRECTION_CODE,
|
|
20
|
+
/** Parallel edges in a format without them. */
|
|
21
|
+
MULTI_EDGES: "W_MULTI_EDGES",
|
|
22
|
+
/** Self-loops in a format without them. */
|
|
23
|
+
SELF_LOOPS: "W_SELF_LOOPS",
|
|
24
|
+
/** The format requires edge ids and the snapshot has none; canonical e0..e{E-1} are generated. */
|
|
25
|
+
EDGE_IDS_GENERATED: "W_EDGE_IDS_GENERATED",
|
|
26
|
+
/** The snapshot has an edge id column and the format cannot write one. */
|
|
27
|
+
EDGE_IDS_DROPPED: "W_EDGE_IDS_DROPPED",
|
|
28
|
+
/** Ids outside the format's charset are rewritten (sanitizeIds "mangle"). */
|
|
29
|
+
ID_MANGLED: "W_ID_MANGLED",
|
|
30
|
+
/** Ids outside the format's charset and sanitizeIds "error": export() will throw E_INVALID_ID. */
|
|
31
|
+
ID_CHARSET: "E_ID_CHARSET",
|
|
32
|
+
/** The format numbers nodes 1..N; ids that are not their 1-based index are kept as labels only. */
|
|
33
|
+
ID_RENUMBERED: "W_ID_RENUMBERED",
|
|
34
|
+
/** A column dtype the format does not keep as declared. */
|
|
35
|
+
DTYPE: "W_DTYPE_UNSUPPORTED",
|
|
36
|
+
/** A multi-component column in a format without strides. */
|
|
37
|
+
COMPONENTS: "W_COMPONENTS_FLATTENED",
|
|
38
|
+
/** A list column in a format without lists. */
|
|
39
|
+
LIST: "W_LIST_UNSUPPORTED",
|
|
40
|
+
/** A json column in a format without nested values. */
|
|
41
|
+
JSON: "W_JSON_UNSUPPORTED",
|
|
42
|
+
/** A declared default in a format without defaults. */
|
|
43
|
+
DEFAULT: "W_DEFAULT_DROPPED",
|
|
44
|
+
/** Declared options in a format without enumerations. */
|
|
45
|
+
OPTIONS: "W_OPTIONS_DROPPED",
|
|
46
|
+
/** A parent / parents column in a format without containment. */
|
|
47
|
+
HIERARCHY: "W_HIERARCHY_DROPPED",
|
|
48
|
+
/** A start / end / timestamp column in a format without temporal support. */
|
|
49
|
+
TEMPORAL: TEMPORAL_DROPPED_CODE,
|
|
50
|
+
/** A `<column>.text` companion (design section 5.1) the format cannot carry. */
|
|
51
|
+
TEMPORAL_TEXT: TEMPORAL_TEXT_DROPPED_CODE,
|
|
52
|
+
/** A role column the format has no slot for; written as a plain attribute, the role lost. */
|
|
53
|
+
ROLE: ROLE_DROPPED_CODE,
|
|
54
|
+
/** A parents (multi-parent) column in a format with single containment only. */
|
|
55
|
+
PARENTS: PARENTS_DROPPED_CODE,
|
|
56
|
+
/** A mutual pair written as two directed edges without the mutual mark. */
|
|
57
|
+
MUTUAL_EXPANDED: MUTUAL_EXPANDED_CODE,
|
|
58
|
+
/** A mutual pair written as one undirected edge; the mark is lost and the pair reads back undirected. */
|
|
59
|
+
MUTUAL_AS_UNDIRECTED: MUTUAL_AS_UNDIRECTED_CODE,
|
|
60
|
+
/** Node ids whose written text reads back as the other type under the importer's id rule. */
|
|
61
|
+
ID_TEXT_TYPE: ID_TEXT_TYPE_CODE,
|
|
62
|
+
/** Two node ids share one written text; export() throws E_INVALID_ID. */
|
|
63
|
+
ID_TEXT_COLLISION: ID_TEXT_COLLISION_CODE,
|
|
64
|
+
/** A plain column named like the importer's weight key reads back as THE weight. */
|
|
65
|
+
WEIGHT_KEY_CLASH: WEIGHT_KEY_CLASH_CODE,
|
|
66
|
+
/** A role-less column whose written name the importer maps to a role. */
|
|
67
|
+
ROLE_ASSUMED: ROLE_ASSUMED_CODE,
|
|
68
|
+
/** A role column written into the format's slot reads back under the importer's fixed name. */
|
|
69
|
+
COLUMN_NAME_CHANGED: COLUMN_RENAMED_LOSS_CODE,
|
|
70
|
+
/** A declared column whose every row is unset vanishes through a format without declarations. */
|
|
71
|
+
EMPTY_COLUMN: EMPTY_COLUMN_DROPPED_CODE,
|
|
72
|
+
/** A string / dict column that reads back as the other storage class (the dictionary heuristic). */
|
|
73
|
+
STORAGE_CLASS: STORAGE_CLASS_CODE,
|
|
74
|
+
/** An f64 column whose set values are all integral reads back as i32 through an untyped format. */
|
|
75
|
+
INTEGRAL_F64: INTEGRAL_F64_CODE,
|
|
76
|
+
/** Text cells that read back as numbers or booleans under the 5.1 grammar. */
|
|
77
|
+
TEXT_INFERRED: TEXT_INFERRED_CODE,
|
|
78
|
+
/** A string cell holding a character XML 1.0 forbids; export() throws E_COLUMN_TYPE. */
|
|
79
|
+
XML_ILLEGAL_CHAR: XML_ILLEGAL_CHAR_CODE,
|
|
80
|
+
/** A dict column without declared options gains one on re-import. */
|
|
81
|
+
OPTIONS_GAINED: OPTIONS_GAINED_CODE,
|
|
82
|
+
/** A spells column in a format without spells. */
|
|
83
|
+
SPELLS: "W_SPELLS_DROPPED",
|
|
84
|
+
/** Dynamic attribute values (extension tables) in a format without them. */
|
|
85
|
+
DYNAMIC_VALUES: "W_DYNAMIC_VALUES_DROPPED",
|
|
86
|
+
/** An open-interval column in a format without open intervals (design section 5.1). */
|
|
87
|
+
OPEN_INTERVAL: "W_OPEN_INTERVAL",
|
|
88
|
+
/** Graph-level attributes in a format without them. */
|
|
89
|
+
GRAPH_ATTRIBUTES: "W_GRAPH_ATTRIBUTES_DROPPED",
|
|
90
|
+
/** A position column in a format without positions. */
|
|
91
|
+
POSITIONS: "W_POSITIONS_DROPPED",
|
|
92
|
+
/** Visual columns in a format without them. */
|
|
93
|
+
VIZ: "W_VIZ_DROPPED",
|
|
94
|
+
/** An extension table the format cannot carry. */
|
|
95
|
+
EXTENSION_TABLE: "W_EXTENSION_TABLE_DROPPED",
|
|
96
|
+
});
|
|
97
|
+
/** The capabilities of a format that keeps nothing beyond plain topology; the base every exporter overrides. */
|
|
98
|
+
export const NO_CAPABILITIES = Object.freeze({
|
|
99
|
+
mixedDirection: false,
|
|
100
|
+
multiEdges: false,
|
|
101
|
+
selfLoops: false,
|
|
102
|
+
edgeIds: "none",
|
|
103
|
+
idCharset: "any",
|
|
104
|
+
dtypes: Object.freeze([]),
|
|
105
|
+
components: false,
|
|
106
|
+
lists: false,
|
|
107
|
+
json: false,
|
|
108
|
+
defaults: false,
|
|
109
|
+
options: false,
|
|
110
|
+
hierarchy: false,
|
|
111
|
+
temporal: "none",
|
|
112
|
+
graphAttributes: false,
|
|
113
|
+
positions: false,
|
|
114
|
+
viz: false,
|
|
115
|
+
});
|
|
116
|
+
/**
|
|
117
|
+
* Build a capabilities table from the fields a format supports; every field left out is the
|
|
118
|
+
* conservative NO_CAPABILITIES value, so an exporter states what it keeps and nothing is assumed.
|
|
119
|
+
* @param supported - the fields the format supports
|
|
120
|
+
* @returns a frozen table
|
|
121
|
+
*/
|
|
122
|
+
export function capabilities(supported) {
|
|
123
|
+
return Object.freeze({ ...NO_CAPABILITIES, ...supported, dtypes: Object.freeze([...(supported.dtypes ?? [])]) });
|
|
124
|
+
}
|
|
125
|
+
/** The roles checkCapabilities() treats structurally rather than as attribute columns. */
|
|
126
|
+
const STRUCTURAL_ROLES = new Set(["directed", "pair", "mutual", "weight", "originalId"]);
|
|
127
|
+
const VIZ_ROLES = new Set(["color", "size", "shape", "thickness"]);
|
|
128
|
+
const TEMPORAL_ROLES = new Set(["start", "end", "timestamp", "timestamps"]);
|
|
129
|
+
const HIERARCHY_ROLES = new Set(["parent", "parents"]);
|
|
130
|
+
/**
|
|
131
|
+
* The generic pre-flight of design section 8.5: compare a snapshot with a format's capabilities
|
|
132
|
+
* and return one LossNote per gap, with the shared codes of LOSS. Format-specific notes are the
|
|
133
|
+
* exporter's to append.
|
|
134
|
+
* @param snapshot - the snapshot about to be exported
|
|
135
|
+
* @param caps - the exporter's capabilities
|
|
136
|
+
* @param options - the resolved common export options
|
|
137
|
+
* @param extras - format facts the capabilities table does not carry
|
|
138
|
+
* @returns the notes, empty when the export is exact
|
|
139
|
+
*/
|
|
140
|
+
export function checkCapabilities(snapshot, caps, options, extras = {}) {
|
|
141
|
+
const notes = [];
|
|
142
|
+
const note = (code, message, column = null, count = null) => {
|
|
143
|
+
notes.push(Object.freeze({ code, message, column, count }));
|
|
144
|
+
};
|
|
145
|
+
// mixed direction (design section 3.6): an expanded snapshot carries the pair / directed roles
|
|
146
|
+
const mixed = countMixedEdges(snapshot);
|
|
147
|
+
if (mixed > 0 && !caps.mixedDirection) {
|
|
148
|
+
if (options.onMixedDirection === "error") {
|
|
149
|
+
note(LOSS.MIXED_DIRECTION_ERROR, `${mixed} undirected edge(s) in a directed graph; the format has no mixed direction and onMixedDirection is "error"`, null, mixed);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
note(LOSS.MIXED_DIRECTION, `${mixed} undirected edge(s) in a directed graph written as ${options.onMixedDirection}`, null, mixed);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (snapshot.flags.multigraph && !caps.multiEdges) {
|
|
156
|
+
const parallel = countParallelArcs(snapshot);
|
|
157
|
+
note(LOSS.MULTI_EDGES, `${parallel} parallel edge(s); the format has no parallel edges`, null, parallel);
|
|
158
|
+
}
|
|
159
|
+
if (snapshot.selfLoopCount > 0 && !caps.selfLoops) {
|
|
160
|
+
note(LOSS.SELF_LOOPS, `${snapshot.selfLoopCount} self-loop(s); the format has no self-loops`, null, snapshot.selfLoopCount);
|
|
161
|
+
}
|
|
162
|
+
const edgeIds = snapshot.edges.byRole("id");
|
|
163
|
+
if (caps.edgeIds === "required" && edgeIds === null && snapshot.edgeCount > 0) {
|
|
164
|
+
note(LOSS.EDGE_IDS_GENERATED, "the format requires edge ids; canonical e0..e{E-1} are generated and not written back", null, snapshot.edgeCount);
|
|
165
|
+
}
|
|
166
|
+
else if (caps.edgeIds === "none" && edgeIds !== null) {
|
|
167
|
+
note(LOSS.EDGE_IDS_DROPPED, `edge id column "${edgeIds.meta.name}" cannot be written`, edgeIds.meta.name, snapshot.edgeCount);
|
|
168
|
+
}
|
|
169
|
+
const unrepresentable = countUnrepresentableIds(snapshot, caps.idCharset);
|
|
170
|
+
if (unrepresentable > 0) {
|
|
171
|
+
if (caps.idCharset === "dense-1-based") {
|
|
172
|
+
note(LOSS.ID_RENUMBERED, options.sanitizeIds === "mangle"
|
|
173
|
+
? `${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`
|
|
174
|
+
: `${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)`, null, unrepresentable);
|
|
175
|
+
}
|
|
176
|
+
else if (options.sanitizeIds === "mangle") {
|
|
177
|
+
note(LOSS.ID_MANGLED, `${unrepresentable} node id(s) outside the ${caps.idCharset} charset are rewritten; originals kept in the originalId attribute`, null, unrepresentable);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
note(LOSS.ID_CHARSET, `${unrepresentable} node id(s) outside the ${caps.idCharset} charset; export() will throw unless sanitizeIds is "mangle"`, null, unrepresentable);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
checkColumns(snapshot.nodes, "node", caps, extras, note);
|
|
184
|
+
checkColumns(snapshot.edges, "edge", caps, extras, note);
|
|
185
|
+
const graphColumns = snapshot.graph.names();
|
|
186
|
+
if (graphColumns.length > 0) {
|
|
187
|
+
if (caps.graphAttributes) {
|
|
188
|
+
checkColumns(snapshot.graph, "graph", caps, extras, note);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
note(LOSS.GRAPH_ATTRIBUTES, `${graphColumns.length} graph attribute(s) cannot be written`, null, graphColumns.length);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
for (const [name, table] of snapshot.extensions) {
|
|
195
|
+
if (name.startsWith("temporal:")) {
|
|
196
|
+
if (caps.temporal !== "dynamic-values") {
|
|
197
|
+
note(LOSS.DYNAMIC_VALUES, `dynamic values of "${name}" (${table.rowCount} row(s)) cannot be written`, name, table.rowCount);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
note(LOSS.EXTENSION_TABLE, `extension table "${name}" (${table.rowCount} row(s)) cannot be written`, name, table.rowCount);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return notes;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The per-column checks of checkCapabilities().
|
|
208
|
+
* @param table - the table
|
|
209
|
+
* @param domain - the domain, for messages
|
|
210
|
+
* @param caps - the capabilities
|
|
211
|
+
* @param extras - format extras
|
|
212
|
+
* @param note - the recorder
|
|
213
|
+
*/
|
|
214
|
+
function checkColumns(table, domain, caps, extras, note) {
|
|
215
|
+
for (const column of table) {
|
|
216
|
+
const { meta } = column;
|
|
217
|
+
const { name, role } = meta;
|
|
218
|
+
if (role !== null && STRUCTURAL_ROLES.has(role)) {
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const label = `${domain} column "${name}"`;
|
|
222
|
+
if (role !== null && extras.roleNames !== undefined) {
|
|
223
|
+
const fixed = extras.roleNames[role];
|
|
224
|
+
if (fixed !== undefined && fixed !== name) {
|
|
225
|
+
note(LOSS.COLUMN_NAME_CHANGED, `${label} (${role}) is written into the format's ${role} slot and reads back as "${fixed}"`, name, column.length - column.nullCount);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (domain === "edge" && role === "id") {
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
if (role === "timeText") {
|
|
232
|
+
if (extras.temporalText !== true) {
|
|
233
|
+
note(LOSS.TEMPORAL_TEXT, `${label} (the lexical form of a temporal column, design section 5.1) cannot be written`, name, column.length - column.nullCount);
|
|
234
|
+
}
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (role === "position") {
|
|
238
|
+
if (!caps.positions) {
|
|
239
|
+
note(LOSS.POSITIONS, `${label} (positions) cannot be written`, name, column.length - column.nullCount);
|
|
240
|
+
}
|
|
241
|
+
else if (extras.positionDtype !== undefined && meta.dtype !== extras.positionDtype) {
|
|
242
|
+
note(LOSS.DTYPE, `${label} (positions) is ${meta.dtype}; the format reads positions back as ${extras.positionDtype}`, name, column.length - column.nullCount);
|
|
243
|
+
}
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
if (role !== null && VIZ_ROLES.has(role)) {
|
|
247
|
+
if (!caps.viz) {
|
|
248
|
+
note(LOSS.VIZ, `${label} (${role}) cannot be written`, name, column.length - column.nullCount);
|
|
249
|
+
}
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
if (role !== null && HIERARCHY_ROLES.has(role)) {
|
|
253
|
+
if (!caps.hierarchy) {
|
|
254
|
+
note(LOSS.HIERARCHY, `${label} (${role}) cannot be written`, name, column.length - column.nullCount);
|
|
255
|
+
}
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (role !== null && TEMPORAL_ROLES.has(role)) {
|
|
259
|
+
if (caps.temporal === "none") {
|
|
260
|
+
note(LOSS.TEMPORAL, `${label} (${role}) cannot be written`, name, column.length - column.nullCount);
|
|
261
|
+
}
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (role === "spells") {
|
|
265
|
+
if (caps.temporal !== "spells" && caps.temporal !== "dynamic-values") {
|
|
266
|
+
note(LOSS.SPELLS, `${label} (spells) cannot be written`, name, column.length - column.nullCount);
|
|
267
|
+
}
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
if (role === "open") {
|
|
271
|
+
// The open bits are written by the format's own temporal syntax when it has one; the
|
|
272
|
+
// column's u8 storage is never an attribute dtype, so no dtype note either way.
|
|
273
|
+
if (extras.openIntervals !== true) {
|
|
274
|
+
note(LOSS.OPEN_INTERVAL, `${label} (open intervals) cannot be written`, name, column.length - column.nullCount);
|
|
275
|
+
}
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
if (role !== null && !(extras.roles?.has(role) ?? false)) {
|
|
279
|
+
note(LOSS.ROLE, `${label} (${role}) is written as a plain attribute; the format has no ${role} slot and the role is lost`, name, column.length - column.nullCount);
|
|
280
|
+
}
|
|
281
|
+
if (meta.dynamic && caps.temporal !== "dynamic-values") {
|
|
282
|
+
note(LOSS.DYNAMIC_VALUES, `${label} is dynamic; only its static value can be written`, name, null);
|
|
283
|
+
}
|
|
284
|
+
checkDtype(column, label, caps, note);
|
|
285
|
+
if (meta.default !== undefined && !caps.defaults) {
|
|
286
|
+
note(LOSS.DEFAULT, `${label} declares a default; the format has no defaults`, name, null);
|
|
287
|
+
}
|
|
288
|
+
if (meta.options !== null && !caps.options) {
|
|
289
|
+
note(LOSS.OPTIONS, `${label} declares options; the format has no enumerations`, name, null);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* The dtype checks of one attribute column: lists, nested values, scalar dtypes and strides
|
|
295
|
+
* against the capability table.
|
|
296
|
+
* @param column - the column
|
|
297
|
+
* @param label - the column's label for messages
|
|
298
|
+
* @param caps - the capabilities
|
|
299
|
+
* @param note - the recorder
|
|
300
|
+
*/
|
|
301
|
+
function checkDtype(column, label, caps, note) {
|
|
302
|
+
const { meta } = column;
|
|
303
|
+
const { name } = meta;
|
|
304
|
+
const set = column.length - column.nullCount;
|
|
305
|
+
switch (meta.dtype) {
|
|
306
|
+
case "list":
|
|
307
|
+
if (!caps.lists) {
|
|
308
|
+
note(LOSS.LIST, `${label} is a list; the format has no lists`, name, set);
|
|
309
|
+
}
|
|
310
|
+
else if (meta.itemDtype !== null && !caps.dtypes.includes(meta.itemDtype)) {
|
|
311
|
+
note(LOSS.DTYPE, `${label} holds ${meta.itemDtype} items; the format cannot keep that dtype`, name, set);
|
|
312
|
+
}
|
|
313
|
+
else if (meta.itemDtype === "dict") {
|
|
314
|
+
// no format declares an enumeration for list items: they read back as strings
|
|
315
|
+
note(LOSS.DTYPE, `${label} holds dict items; list items read back as string`, name, set);
|
|
316
|
+
}
|
|
317
|
+
break;
|
|
318
|
+
case "json":
|
|
319
|
+
if (!caps.json) {
|
|
320
|
+
note(LOSS.JSON, `${label} holds nested values; the format has no nested values`, name, set);
|
|
321
|
+
}
|
|
322
|
+
break;
|
|
323
|
+
default:
|
|
324
|
+
if (!caps.dtypes.includes(meta.dtype)) {
|
|
325
|
+
note(LOSS.DTYPE, `${label} is ${meta.dtype}; the format cannot keep that dtype`, name, set);
|
|
326
|
+
}
|
|
327
|
+
if (meta.components > 1 && !caps.components) {
|
|
328
|
+
note(LOSS.COMPONENTS, `${label} has ${meta.components} components; the format has no strides`, name, set);
|
|
329
|
+
}
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* The number of source edges that were undirected in a directed snapshot (the halves of an
|
|
335
|
+
* expanded pair count once; an expanded self-loop has no mirror and counts once).
|
|
336
|
+
* @param snapshot - the snapshot
|
|
337
|
+
* @returns the count; 0 for an undirected snapshot or one without the directed role
|
|
338
|
+
*/
|
|
339
|
+
export function countMixedEdges(snapshot) {
|
|
340
|
+
if (!snapshot.directed) {
|
|
341
|
+
return 0;
|
|
342
|
+
}
|
|
343
|
+
const directed = snapshot.edges.byRole("directed");
|
|
344
|
+
if (directed === null || directed.dtype !== "bool") {
|
|
345
|
+
return 0;
|
|
346
|
+
}
|
|
347
|
+
const pair = snapshot.edges.byRole("pair");
|
|
348
|
+
let undirectedRows = 0;
|
|
349
|
+
let paired = 0;
|
|
350
|
+
for (let e = 0; e < snapshot.edgeCount; e++) {
|
|
351
|
+
if (directed.isSet(e) && directed.value(e) === false) {
|
|
352
|
+
undirectedRows++;
|
|
353
|
+
if (pair !== null && pair.dtype === "u32" && pair.isSet(e) && pair.data[e] !== INVALID_INDEX) {
|
|
354
|
+
paired++;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return paired / 2 + (undirectedRows - paired);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* The number of arcs that repeat the previous arc's target within a row (parallel edges), counted
|
|
362
|
+
* over the forward CSR; an undirected parallel edge is counted in both rows.
|
|
363
|
+
* @param snapshot - the snapshot
|
|
364
|
+
* @returns the count
|
|
365
|
+
*/
|
|
366
|
+
export function countParallelArcs(snapshot) {
|
|
367
|
+
const { rowPtr, colIdx, nodeCount } = snapshot;
|
|
368
|
+
let count = 0;
|
|
369
|
+
for (let u = 0; u < nodeCount; u++) {
|
|
370
|
+
for (let a = rowPtr[u] + 1; a < rowPtr[u + 1]; a++) {
|
|
371
|
+
if (colIdx[a] === colIdx[a - 1]) {
|
|
372
|
+
count++;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return snapshot.directed ? count : Math.ceil(count / 2);
|
|
377
|
+
}
|
|
378
|
+
/** XML NameChar ranges (XML 1.0 fifth edition), as inclusive code point pairs. */
|
|
379
|
+
const NAME_CHAR_RANGES = [
|
|
380
|
+
[0x2d, 0x2e],
|
|
381
|
+
[0x30, 0x3a],
|
|
382
|
+
[0x41, 0x5a],
|
|
383
|
+
[0x5f, 0x5f],
|
|
384
|
+
[0x61, 0x7a],
|
|
385
|
+
[0xb7, 0xb7],
|
|
386
|
+
[0xc0, 0xd6],
|
|
387
|
+
[0xd8, 0xf6],
|
|
388
|
+
[0xf8, 0x37d],
|
|
389
|
+
[0x37f, 0x1fff],
|
|
390
|
+
[0x200c, 0x200d],
|
|
391
|
+
[0x203f, 0x2040],
|
|
392
|
+
[0x2070, 0x218f],
|
|
393
|
+
[0x2c00, 0x2fef],
|
|
394
|
+
[0x3001, 0xd7ff],
|
|
395
|
+
[0xf900, 0xfdcf],
|
|
396
|
+
[0xfdf0, 0xfffd],
|
|
397
|
+
[0x10000, 0xeffff],
|
|
398
|
+
];
|
|
399
|
+
/**
|
|
400
|
+
* Whether a code point is an XML NameChar.
|
|
401
|
+
* @param cp - the code point
|
|
402
|
+
* @returns true when it may appear in an NMTOKEN
|
|
403
|
+
*/
|
|
404
|
+
export function isNameChar(cp) {
|
|
405
|
+
for (const [lo, hi] of NAME_CHAR_RANGES) {
|
|
406
|
+
if (cp < lo) {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
if (cp <= hi) {
|
|
410
|
+
return true;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Whether a text is an XML NMTOKEN (one or more NameChars; GraphML node and edge ids).
|
|
417
|
+
* @param text - the text
|
|
418
|
+
* @returns true for a non-empty text of NameChars
|
|
419
|
+
*/
|
|
420
|
+
export function isNmtoken(text) {
|
|
421
|
+
if (text.length === 0) {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
for (const ch of text) {
|
|
425
|
+
const cp = ch.codePointAt(0);
|
|
426
|
+
if (cp === undefined || !isNameChar(cp)) {
|
|
427
|
+
return false;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Whether an id can be written unchanged under a charset.
|
|
434
|
+
* @param id - the id
|
|
435
|
+
* @param charset - the charset
|
|
436
|
+
* @returns true when the id needs no rewriting ("dense-1-based" is never true: see sanitizeIds)
|
|
437
|
+
*/
|
|
438
|
+
export function isRepresentableId(id, charset) {
|
|
439
|
+
switch (charset) {
|
|
440
|
+
case "any":
|
|
441
|
+
return true;
|
|
442
|
+
case "nmtoken":
|
|
443
|
+
return isNmtoken(String(id));
|
|
444
|
+
case "integer":
|
|
445
|
+
return typeof id === "number" && Number.isSafeInteger(id);
|
|
446
|
+
case "dense-1-based":
|
|
447
|
+
return false;
|
|
448
|
+
default: {
|
|
449
|
+
const name = charset;
|
|
450
|
+
throw new GraphFormatError("E_UNSUPPORTED", `unknown id charset ${name}`, { charset: name });
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* How many node ids a charset cannot hold as they are (for check()); under "dense-1-based" the
|
|
456
|
+
* ids that are not their own 1-based index.
|
|
457
|
+
* @param snapshot - the snapshot
|
|
458
|
+
* @param charset - the charset
|
|
459
|
+
* @returns the count
|
|
460
|
+
*/
|
|
461
|
+
export function countUnrepresentableIds(snapshot, charset) {
|
|
462
|
+
const { ids } = snapshot;
|
|
463
|
+
if (charset === "any") {
|
|
464
|
+
return 0;
|
|
465
|
+
}
|
|
466
|
+
if (charset === "dense-1-based") {
|
|
467
|
+
if (ids.kind === "identity" && ids.offset === 1) {
|
|
468
|
+
return 0;
|
|
469
|
+
}
|
|
470
|
+
let changed = 0;
|
|
471
|
+
for (let i = 0; i < ids.size; i++) {
|
|
472
|
+
if (ids.idOf(i) !== i + 1) {
|
|
473
|
+
changed++;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return changed;
|
|
477
|
+
}
|
|
478
|
+
let count = 0;
|
|
479
|
+
for (let i = 0; i < ids.size; i++) {
|
|
480
|
+
if (!isRepresentableId(ids.idOf(i), charset)) {
|
|
481
|
+
count++;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return count;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Sanitise the node ids for a charset (design section 8.5). Under "error" any id the charset
|
|
488
|
+
* cannot hold is E_INVALID_ID (details.reason "charset") and nothing is written; under "mangle"
|
|
489
|
+
* such ids are rewritten deterministically and uniquely: NMTOKEN by replacing every other
|
|
490
|
+
* character with `_` (an empty result becomes `_`) and suffixing `_2`, `_3`... on collision;
|
|
491
|
+
* integer by the smallest unused non-negative integers in index order. "dense-1-based" always
|
|
492
|
+
* writes the 1-based index (Pajek numbers vertices; the exporter writes the original id as the
|
|
493
|
+
* label), which is a renumbering rather than a mangling, so it never throws under "error"; under
|
|
494
|
+
* "mangle" the exporter also writes the original id under its originalId attribute.
|
|
495
|
+
* @param snapshot - the snapshot
|
|
496
|
+
* @param charset - the charset
|
|
497
|
+
* @param mode - the resolved sanitizeIds option
|
|
498
|
+
* @returns the ids to write
|
|
499
|
+
*/
|
|
500
|
+
export function sanitizeIds(snapshot, charset, mode) {
|
|
501
|
+
const { ids } = snapshot;
|
|
502
|
+
const n = ids.size;
|
|
503
|
+
if (charset === "dense-1-based") {
|
|
504
|
+
const changed = countUnrepresentableIds(snapshot, charset);
|
|
505
|
+
return {
|
|
506
|
+
charset,
|
|
507
|
+
changed,
|
|
508
|
+
idAt: (i) => i + 1,
|
|
509
|
+
isChanged: (i) => ids.idOf(i) !== i + 1,
|
|
510
|
+
originalAt: (i) => ids.idOf(i),
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
const unchanged = {
|
|
514
|
+
charset,
|
|
515
|
+
changed: 0,
|
|
516
|
+
idAt: (i) => ids.idOf(i),
|
|
517
|
+
isChanged: () => false,
|
|
518
|
+
originalAt: (i) => ids.idOf(i),
|
|
519
|
+
};
|
|
520
|
+
if (charset === "any") {
|
|
521
|
+
return unchanged;
|
|
522
|
+
}
|
|
523
|
+
const bad = [];
|
|
524
|
+
for (let i = 0; i < n; i++) {
|
|
525
|
+
if (!isRepresentableId(ids.idOf(i), charset)) {
|
|
526
|
+
bad.push(i);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (bad.length === 0) {
|
|
530
|
+
return unchanged;
|
|
531
|
+
}
|
|
532
|
+
if (mode === "error") {
|
|
533
|
+
const first = ids.idOf(bad[0]);
|
|
534
|
+
throw new GraphFormatError("E_INVALID_ID", `${bad.length} node id(s) cannot be written as ${charset} (first: ${JSON.stringify(first)} at index ${bad[0]}); pass sanitizeIds: "mangle" to rewrite them`, { reason: "charset", charset, count: bad.length, id: first, index: bad[0] });
|
|
535
|
+
}
|
|
536
|
+
const written = new Map();
|
|
537
|
+
if (charset === "nmtoken") {
|
|
538
|
+
const used = new Set();
|
|
539
|
+
for (let i = 0; i < n; i++) {
|
|
540
|
+
const id = ids.idOf(i);
|
|
541
|
+
if (isRepresentableId(id, charset)) {
|
|
542
|
+
used.add(String(id));
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
for (const i of bad) {
|
|
546
|
+
const base = mangleNmtoken(String(ids.idOf(i)));
|
|
547
|
+
let candidate = base;
|
|
548
|
+
for (let k = 2; used.has(candidate); k++) {
|
|
549
|
+
candidate = `${base}_${k}`;
|
|
550
|
+
}
|
|
551
|
+
used.add(candidate);
|
|
552
|
+
written.set(i, candidate);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
const used = new Set();
|
|
557
|
+
for (let i = 0; i < n; i++) {
|
|
558
|
+
const id = ids.idOf(i);
|
|
559
|
+
if (typeof id === "number" && Number.isSafeInteger(id)) {
|
|
560
|
+
used.add(id);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
let next = 0;
|
|
564
|
+
for (const i of bad) {
|
|
565
|
+
while (used.has(next)) {
|
|
566
|
+
next++;
|
|
567
|
+
}
|
|
568
|
+
used.add(next);
|
|
569
|
+
written.set(i, next);
|
|
570
|
+
next++;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return {
|
|
574
|
+
charset,
|
|
575
|
+
changed: bad.length,
|
|
576
|
+
idAt: (i) => written.get(i) ?? ids.idOf(i),
|
|
577
|
+
isChanged: (i) => written.has(i),
|
|
578
|
+
originalAt: (i) => ids.idOf(i),
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Rewrite a text as an NMTOKEN: every character that is not a NameChar becomes `_`.
|
|
583
|
+
* @param text - the text
|
|
584
|
+
* @returns a non-empty NMTOKEN
|
|
585
|
+
*/
|
|
586
|
+
export function mangleNmtoken(text) {
|
|
587
|
+
let out = "";
|
|
588
|
+
for (const ch of text) {
|
|
589
|
+
const cp = ch.codePointAt(0);
|
|
590
|
+
out += cp !== undefined && isNameChar(cp) ? ch : "_";
|
|
591
|
+
}
|
|
592
|
+
return out.length === 0 ? "_" : out;
|
|
593
|
+
}
|
|
594
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/common/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGH,gBAAgB,EAEhB,aAAa,GAEhB,MAAM,uBAAuB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