@graphty/graph-io 0.3.32 → 0.3.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{choose-BJq_vp1b.js → choose-494CpuXQ.js} +2 -2
- package/dist/chunks/{choose-BJq_vp1b.js.map → choose-494CpuXQ.js.map} +1 -1
- package/dist/chunks/{constants-Bw-6JQuC.js → constants-BBK4rsQZ.js} +2 -2
- package/dist/chunks/{constants-Bw-6JQuC.js.map → constants-BBK4rsQZ.js.map} +1 -1
- package/dist/chunks/{escape-CnTfa_y8.js → escape-wVIEtLv6.js} +6 -6
- package/dist/chunks/escape-wVIEtLv6.js.map +1 -0
- package/dist/chunks/{export-ZucVKiU4.js → export-Cbt4h_0n.js} +8 -8
- package/dist/chunks/export-Cbt4h_0n.js.map +1 -0
- package/dist/chunks/{exporter-BOLJIzvA.js → exporter-CkPnJCXU.js} +36 -12
- package/dist/chunks/exporter-CkPnJCXU.js.map +1 -0
- package/dist/chunks/{exporter-hc2ZuqVe.js → exporter-CqnmKk-f.js} +4 -4
- package/dist/chunks/{exporter-hc2ZuqVe.js.map → exporter-CqnmKk-f.js.map} +1 -1
- package/dist/chunks/{exporter-DgDjwLOm.js → exporter-DMxRy-0l.js} +4 -4
- package/dist/chunks/{exporter-DgDjwLOm.js.map → exporter-DMxRy-0l.js.map} +1 -1
- package/dist/chunks/{exporter-DRNkA2k0.js → exporter-LZTIAzkS.js} +19 -7
- package/dist/chunks/{exporter-DRNkA2k0.js.map → exporter-LZTIAzkS.js.map} +1 -1
- package/dist/chunks/{importer-DsNj_zoG.js → importer-BTSvNJUB.js} +4 -4
- package/dist/chunks/importer-BTSvNJUB.js.map +1 -0
- package/dist/chunks/{importer-ByCd2CAY.js → importer-BTbjwN10.js} +5 -5
- package/dist/chunks/{importer-ByCd2CAY.js.map → importer-BTbjwN10.js.map} +1 -1
- package/dist/chunks/{importer-WPz-AUz8.js → importer-C1VMuEBQ.js} +8 -8
- package/dist/chunks/importer-C1VMuEBQ.js.map +1 -0
- package/dist/chunks/{importer-BAlFKpHP.js → importer-CSmH218L.js} +6 -6
- package/dist/chunks/{importer-BAlFKpHP.js.map → importer-CSmH218L.js.map} +1 -1
- package/dist/chunks/{importer-D7xB8oVV.js → importer-DMgcD1wI.js} +5 -5
- package/dist/chunks/{importer-D7xB8oVV.js.map → importer-DMgcD1wI.js.map} +1 -1
- package/dist/chunks/{importer-rjFCmKfx.js → importer-DtKPzhVp.js} +5 -5
- package/dist/chunks/importer-DtKPzhVp.js.map +1 -0
- package/dist/chunks/{importer-CaLIrkjL.js → importer-DvPvd4Yy.js} +22 -15
- package/dist/chunks/importer-DvPvd4Yy.js.map +1 -0
- package/dist/chunks/{json-elements-CkC87El2.js → json-elements-CxJF-Szz.js} +6 -6
- package/dist/chunks/json-elements-CxJF-Szz.js.map +1 -0
- package/dist/chunks/{ontology-export-BRErBO6J.js → ontology-export-p1PsPenq.js} +2 -2
- package/dist/chunks/{ontology-export-BRErBO6J.js.map → ontology-export-p1PsPenq.js.map} +1 -1
- package/dist/chunks/{records-DwfSjH8c.js → records-BrfHycmg.js} +2 -2
- package/dist/chunks/{records-DwfSjH8c.js.map → records-BrfHycmg.js.map} +1 -1
- package/dist/chunks/{text-BEEWD-G1.js → text-BD-TzLNm.js} +4 -4
- package/dist/chunks/text-BD-TzLNm.js.map +1 -0
- package/dist/csv.js +4 -4
- package/dist/cx.js +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +1 -1
- package/dist/gexf.js +2 -2
- package/dist/gml.js +10 -10
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +26 -26
- package/dist/graphml.js +2 -2
- package/dist/json.js +1 -1
- package/dist/neo4j.js +3 -3
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/src/common/attributes.js +1 -1
- package/dist/src/common/attributes.js.map +1 -1
- package/dist/src/common/declared-types.js +2 -2
- package/dist/src/common/declared-types.js.map +1 -1
- package/dist/src/common/escape.js +2 -2
- package/dist/src/common/escape.js.map +1 -1
- package/dist/src/common/ids.js +1 -1
- package/dist/src/common/ids.js.map +1 -1
- package/dist/src/common/json-elements.d.ts.map +1 -1
- package/dist/src/common/json-elements.js +3 -3
- package/dist/src/common/json-elements.js.map +1 -1
- package/dist/src/common/temporal.js +3 -3
- package/dist/src/common/temporal.js.map +1 -1
- package/dist/src/common/text.js +2 -2
- package/dist/src/common/text.js.map +1 -1
- package/dist/src/common/xml.js +2 -2
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/formats/cx/exporter.js +1 -1
- package/dist/src/formats/cx/exporter.js.map +1 -1
- package/dist/src/formats/cx/importer.js +3 -3
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx2/importer.js +1 -1
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/gml/exporter.js +1 -1
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.js +2 -2
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/syntax.js +4 -4
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/importer.js +1 -1
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts +2 -0
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +3 -1
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/obographs-export.d.ts +2 -0
- package/dist/src/formats/json/obographs-export.d.ts.map +1 -1
- package/dist/src/formats/json/obographs-export.js +5 -0
- package/dist/src/formats/json/obographs-export.js.map +1 -1
- package/dist/src/formats/obo/exporter.d.ts +2 -0
- package/dist/src/formats/obo/exporter.d.ts.map +1 -1
- package/dist/src/formats/obo/exporter.js +5 -0
- package/dist/src/formats/obo/exporter.js.map +1 -1
- package/dist/src/formats/obo/syntax.d.ts.map +1 -1
- package/dist/src/formats/obo/syntax.js +39 -10
- package/dist/src/formats/obo/syntax.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +2 -4
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.js +2 -2
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +14 -4
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/values.js +1 -1
- package/dist/src/formats/xgmml/values.js.map +1 -1
- package/dist/xgmml.js +2 -2
- package/package.json +2 -2
- package/src/common/attributes.ts +1 -1
- package/src/common/declared-types.ts +2 -2
- package/src/common/escape.ts +2 -2
- package/src/common/ids.ts +1 -1
- package/src/common/json-elements.ts +3 -3
- package/src/common/temporal.ts +3 -3
- package/src/common/text.ts +2 -2
- package/src/common/xml.ts +2 -2
- package/src/formats/cx/exporter.ts +1 -1
- package/src/formats/cx/importer.ts +3 -3
- package/src/formats/cx2/importer.ts +1 -1
- package/src/formats/gml/exporter.ts +1 -1
- package/src/formats/gml/importer.ts +2 -2
- package/src/formats/gml/syntax.ts +4 -4
- package/src/formats/graphml/importer.ts +1 -1
- package/src/formats/json/exporter.ts +3 -1
- package/src/formats/json/obographs-export.ts +10 -0
- package/src/formats/obo/exporter.ts +10 -0
- package/src/formats/obo/syntax.ts +42 -9
- package/src/formats/pajek/exporter.ts +2 -4
- package/src/formats/pajek/importer.ts +2 -2
- package/src/formats/pajek/syntax.ts +14 -5
- package/src/formats/xgmml/values.ts +1 -1
- package/dist/chunks/escape-CnTfa_y8.js.map +0 -1
- package/dist/chunks/export-ZucVKiU4.js.map +0 -1
- package/dist/chunks/exporter-BOLJIzvA.js.map +0 -1
- package/dist/chunks/importer-CaLIrkjL.js.map +0 -1
- package/dist/chunks/importer-DsNj_zoG.js.map +0 -1
- package/dist/chunks/importer-WPz-AUz8.js.map +0 -1
- package/dist/chunks/importer-rjFCmKfx.js.map +0 -1
- package/dist/chunks/json-elements-CkC87El2.js.map +0 -1
- package/dist/chunks/text-BEEWD-G1.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GraphFormatError, INVALID_INDEX } from "@graphty/graph-format";
|
|
2
|
-
import { S as SINK_OPTION_CODE, O as OPTION_IGNORED_CODE, R as ROLE_TAKEN_CODE, ay as RENAMED_CODE, I as ID_MERGED_CODE, i as DANGLING_REFERENCE_CODE, g as UNKNOWN_ELEMENT_CODE, o as DUPLICATE_ATTRIBUTE_CODE, n as DUPLICATE_NODE_CODE, a3 as BAD_VALUE_CODE, t as MISSING_ID_CODE, w as UNKNOWN_ENCODING_CODE, x as ENCODING_FALLBACK_CODE, y as INVALID_ENCODING_CODE, z as INVALID_UTF8_CODE, E as EMPTY_INPUT_CODE, F as ELEMENT_ISSUE, G as INPUT_ISSUE, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, am as throwIfAborted, b as plural, a1 as declareResolved, ar as IdCoercer, aq as DirectionResolver, $ as agree, az as LineReader, c as capabilities, L as LOSS, au as ROLE_ASSUMED_CODE, aA as NODE_ORDER_CODE, aB as GRAPH_COLUMN_AS_METADATA_CODE, aC as TYPEDEF_NODES_CODE, aD as RELATION_ASSUMED_CODE, at as COLUMN_AS_PROPERTY_VALUE_CODE, r as resolveExportOptions, p as pairFolding, e as explicitWeights, av as formatNumber } from "./export-
|
|
3
|
-
import { S as SYNONYM_SCOPES, O as OBO_NODE_COLUMNS, o as oboColumnDecl, P as PLACEHOLDER_COLUMN, f as framelessNodes, m as movedNodes, s as slotColumn, c as capabilityNotes, e as emptyColumnNotes, a as cellOf, F as FRAME_KINDS$1, U as UNWRITTEN_ROLES, n as notePropertyColumn, b as fitsVocabulary, i as isQualifierRecord, t as textOf } from "./ontology-export-
|
|
2
|
+
import { S as SINK_OPTION_CODE, O as OPTION_IGNORED_CODE, R as ROLE_TAKEN_CODE, ay as RENAMED_CODE, I as ID_MERGED_CODE, i as DANGLING_REFERENCE_CODE, g as UNKNOWN_ELEMENT_CODE, o as DUPLICATE_ATTRIBUTE_CODE, n as DUPLICATE_NODE_CODE, a3 as BAD_VALUE_CODE, t as MISSING_ID_CODE, w as UNKNOWN_ENCODING_CODE, x as ENCODING_FALLBACK_CODE, y as INVALID_ENCODING_CODE, z as INVALID_UTF8_CODE, E as EMPTY_INPUT_CODE, F as ELEMENT_ISSUE, G as INPUT_ISSUE, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, am as throwIfAborted, b as plural, a1 as declareResolved, ar as IdCoercer, aq as DirectionResolver, $ as agree, az as LineReader, c as capabilities, L as LOSS, au as ROLE_ASSUMED_CODE, aA as NODE_ORDER_CODE, aB as GRAPH_COLUMN_AS_METADATA_CODE, aC as TYPEDEF_NODES_CODE, aD as RELATION_ASSUMED_CODE, at as COLUMN_AS_PROPERTY_VALUE_CODE, r as resolveExportOptions, p as pairFolding, e as explicitWeights, av as formatNumber } from "./export-Cbt4h_0n.js";
|
|
3
|
+
import { S as SYNONYM_SCOPES, O as OBO_NODE_COLUMNS, o as oboColumnDecl, P as PLACEHOLDER_COLUMN, f as framelessNodes, m as movedNodes, s as slotColumn, c as capabilityNotes, e as emptyColumnNotes, a as cellOf, F as FRAME_KINDS$1, U as UNWRITTEN_ROLES, n as notePropertyColumn, b as fitsVocabulary, i as isQualifierRecord, t as textOf } from "./ontology-export-p1PsPenq.js";
|
|
4
4
|
import { j as joinText, e as encodeChunks } from "./writer-DxjgHwSe.js";
|
|
5
5
|
const ESCAPES = Object.freeze({
|
|
6
6
|
n: "\n",
|
|
@@ -68,23 +68,36 @@ function splitTagValue(line) {
|
|
|
68
68
|
}
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
+
const COMMENT_MARKS = String.raw`\"!`;
|
|
72
|
+
const BRACE_MARKS = String.raw`\"[]{}`;
|
|
71
73
|
function stripComment(rest) {
|
|
72
74
|
let quoted = false;
|
|
73
|
-
|
|
75
|
+
const found = [-2, -2, -2];
|
|
76
|
+
let i = nextOf(rest, 0, COMMENT_MARKS, found);
|
|
77
|
+
while (i >= 0) {
|
|
74
78
|
const ch = rest.charAt(i);
|
|
75
|
-
if (ch === "\\") {
|
|
76
|
-
i++;
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
79
|
const atStart = i === 0 || rest.charAt(i - 1) === " " || rest.charAt(i - 1) === " ";
|
|
80
80
|
if (ch === '"' && (quoted || atStart)) {
|
|
81
81
|
quoted = !quoted;
|
|
82
82
|
} else if (ch === "!" && !quoted && atStart) {
|
|
83
83
|
return rest.slice(0, i).trimEnd();
|
|
84
84
|
}
|
|
85
|
+
i = nextOf(rest, ch === "\\" ? i + 2 : i + 1, COMMENT_MARKS, found);
|
|
85
86
|
}
|
|
86
87
|
return rest.trimEnd();
|
|
87
88
|
}
|
|
89
|
+
function nextOf(text, from, marks, found) {
|
|
90
|
+
let nearest = -1;
|
|
91
|
+
for (let k = 0; k < marks.length; k++) {
|
|
92
|
+
if (found[k] !== -1 && found[k] < from) {
|
|
93
|
+
found[k] = text.indexOf(marks.charAt(k), from);
|
|
94
|
+
}
|
|
95
|
+
if (found[k] !== -1 && (nearest === -1 || found[k] < nearest)) {
|
|
96
|
+
nearest = found[k];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return nearest;
|
|
100
|
+
}
|
|
88
101
|
function splitQualifiers(value) {
|
|
89
102
|
if (!value.endsWith("}")) {
|
|
90
103
|
return { value, qualifiers: null, badBlock: null };
|
|
@@ -338,17 +351,18 @@ function parseXrefList(inner) {
|
|
|
338
351
|
function hasStrayBrace(value) {
|
|
339
352
|
let quoted = false;
|
|
340
353
|
let listed = false;
|
|
341
|
-
|
|
354
|
+
const found = [-2, -2, -2, -2, -2, -2];
|
|
355
|
+
let i = nextOf(value, 0, BRACE_MARKS, found);
|
|
356
|
+
while (i >= 0) {
|
|
342
357
|
const ch = value.charAt(i);
|
|
343
|
-
if (ch === "
|
|
344
|
-
i++;
|
|
345
|
-
} else if (ch === '"') {
|
|
358
|
+
if (ch === '"') {
|
|
346
359
|
quoted = !quoted;
|
|
347
360
|
} else if (!quoted && (ch === "[" || ch === "]")) {
|
|
348
361
|
listed = ch === "[";
|
|
349
362
|
} else if (!quoted && !listed && (ch === "{" || ch === "}")) {
|
|
350
363
|
return true;
|
|
351
364
|
}
|
|
365
|
+
i = nextOf(value, ch === "\\" ? i + 2 : i + 1, BRACE_MARKS, found);
|
|
352
366
|
}
|
|
353
367
|
return false;
|
|
354
368
|
}
|
|
@@ -2102,6 +2116,8 @@ const OBO_LOSS = Object.freeze({
|
|
|
2102
2116
|
ONTOLOGY_NAME: "W_OBO_ONTOLOGY_NAME",
|
|
2103
2117
|
/** `[Typedef]` frames read back as nodes only under the importer's `typedefs: "nodes"`; by default they are metadata. */
|
|
2104
2118
|
TYPEDEF_NODES: TYPEDEF_NODES_CODE,
|
|
2119
|
+
/** A graph without a node `type` column is written as `[Term]` frames and reads back with a `type` column holding Term. */
|
|
2120
|
+
TYPE_GAINED: "W_OBO_TYPE_GAINED",
|
|
2105
2121
|
/** Edges are written in the frame of their source node, so they read back grouped by source, in node order. */
|
|
2106
2122
|
EDGE_ORDER: "W_OBO_EDGE_ORDER",
|
|
2107
2123
|
/**
|
|
@@ -2691,6 +2707,14 @@ function plan(snapshot, options) {
|
|
|
2691
2707
|
}
|
|
2692
2708
|
}
|
|
2693
2709
|
const { kinds, type } = planKinds(snapshot, frameless);
|
|
2710
|
+
if (rows.length > 0 && !snapshot.nodes.has("type")) {
|
|
2711
|
+
note(
|
|
2712
|
+
OBO_LOSS.TYPE_GAINED,
|
|
2713
|
+
`${rows.length} node${plural(rows.length)} ${agree(rows.length, "is", "are")} written as [Term] frames and ${agree(rows.length, "reads", "read")} back with the type Term in a new node column "type"`,
|
|
2714
|
+
null,
|
|
2715
|
+
rows.length
|
|
2716
|
+
);
|
|
2717
|
+
}
|
|
2694
2718
|
const typedefNodes = rows.filter((i) => kinds[i] === "Typedef").length;
|
|
2695
2719
|
if (typedefNodes > 0) {
|
|
2696
2720
|
note(
|
|
@@ -3462,4 +3486,4 @@ export {
|
|
|
3462
3486
|
oboImporter as c,
|
|
3463
3487
|
oboExporter as o
|
|
3464
3488
|
};
|
|
3465
|
-
//# sourceMappingURL=exporter-
|
|
3489
|
+
//# sourceMappingURL=exporter-CkPnJCXU.js.map
|