@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.
- package/LICENSE +1 -1
- package/README.md +29 -3
- package/dist/chunks/{escape-D1f9-cwf.js → escape-D-gZWO26.js} +3 -2
- package/dist/chunks/{escape-D1f9-cwf.js.map → escape-D-gZWO26.js.map} +1 -1
- package/dist/chunks/{importer-D7ZcGCeb.js → importer-Br_QeAeE.js} +4 -3
- package/dist/chunks/{importer-D7ZcGCeb.js.map → importer-Br_QeAeE.js.map} +1 -1
- package/dist/chunks/{importer-CXEiicAN.js → importer-DHagxvDD.js} +4 -3
- package/dist/chunks/{importer-CXEiicAN.js.map → importer-DHagxvDD.js.map} +1 -1
- package/dist/chunks/{importer-C7mnGdr_.js → importer-Du5crN9l.js} +510 -26
- package/dist/chunks/importer-Du5crN9l.js.map +1 -0
- package/dist/chunks/importer-aNJfe0qu.js +1614 -0
- package/dist/chunks/importer-aNJfe0qu.js.map +1 -0
- package/dist/chunks/{importer-B8lsjFWx.js → importer-d0uQxFp6.js} +4 -3
- package/dist/chunks/{importer-B8lsjFWx.js.map → importer-d0uQxFp6.js.map} +1 -1
- package/dist/chunks/ontology-BnrJ4I98.js +113 -0
- package/dist/chunks/ontology-BnrJ4I98.js.map +1 -0
- package/dist/chunks/{records-IHsCfv7s.js → records-Bk9jgodz.js} +2 -2
- package/dist/chunks/{records-IHsCfv7s.js.map → records-Bk9jgodz.js.map} +1 -1
- package/dist/chunks/{writer-BtWpUaiH.js → report-BOk0p5y8.js} +181 -912
- package/dist/chunks/report-BOk0p5y8.js.map +1 -0
- package/dist/chunks/writer-GAdltGmC.js +827 -0
- package/dist/chunks/writer-GAdltGmC.js.map +1 -0
- package/dist/csv.js +4 -3
- package/dist/csv.js.map +1 -1
- package/dist/dot.js +1 -1
- package/dist/gexf.js +3 -2
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +3 -2
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +191 -134
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +1 -1
- package/dist/json.js +1 -1
- package/dist/neo4j.js +4 -3
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.d.ts +1 -0
- package/dist/obo.js +6 -0
- package/dist/obo.js.map +1 -0
- package/dist/pajek.js +1 -1
- package/dist/src/common/codes.d.ts +43 -0
- package/dist/src/common/codes.d.ts.map +1 -1
- package/dist/src/common/codes.js +43 -0
- package/dist/src/common/codes.js.map +1 -1
- package/dist/src/common/input.d.ts +9 -0
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +16 -0
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/ontology.d.ts +59 -0
- package/dist/src/common/ontology.d.ts.map +1 -0
- package/dist/src/common/ontology.js +147 -0
- package/dist/src/common/ontology.js.map +1 -0
- package/dist/src/common/options.d.ts +12 -1
- package/dist/src/common/options.d.ts.map +1 -1
- package/dist/src/common/options.js +51 -1
- package/dist/src/common/options.js.map +1 -1
- package/dist/src/formats/json/dialect.d.ts +8 -6
- package/dist/src/formats/json/dialect.d.ts.map +1 -1
- package/dist/src/formats/json/dialect.js +26 -3
- package/dist/src/formats/json/dialect.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +324 -7
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +154 -23
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/obographs.d.ts +21 -0
- package/dist/src/formats/json/obographs.d.ts.map +1 -0
- package/dist/src/formats/json/obographs.js +476 -0
- package/dist/src/formats/json/obographs.js.map +1 -0
- package/dist/src/formats/obo/importer.d.ts +90 -0
- package/dist/src/formats/obo/importer.d.ts.map +1 -0
- package/dist/src/formats/obo/importer.js +1248 -0
- package/dist/src/formats/obo/importer.js.map +1 -0
- package/dist/src/formats/obo/index.d.ts +7 -0
- package/dist/src/formats/obo/index.d.ts.map +1 -0
- package/dist/src/formats/obo/index.js +7 -0
- package/dist/src/formats/obo/index.js.map +1 -0
- package/dist/src/formats/obo/syntax.d.ts +121 -0
- package/dist/src/formats/obo/syntax.d.ts.map +1 -0
- package/dist/src/formats/obo/syntax.js +424 -0
- package/dist/src/formats/obo/syntax.js.map +1 -0
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/registry.d.ts +21 -3
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +32 -1
- package/dist/src/registry.js.map +1 -1
- package/dist/src/sniff.d.ts +1 -1
- package/dist/src/sniff.d.ts.map +1 -1
- package/dist/src/sniff.js +23 -3
- package/dist/src/sniff.js.map +1 -1
- package/dist/src/types.d.ts +31 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/package.json +6 -1
- package/src/common/codes.ts +58 -0
- package/src/common/input.ts +16 -0
- package/src/common/ontology.ts +169 -0
- package/src/common/options.ts +78 -2
- package/src/formats/json/dialect.ts +37 -7
- package/src/formats/json/importer.ts +206 -28
- package/src/formats/json/obographs.ts +563 -0
- package/src/formats/obo/importer.ts +1695 -0
- package/src/formats/obo/index.ts +7 -0
- package/src/formats/obo/syntax.ts +466 -0
- package/src/index.ts +6 -0
- package/src/registry.ts +38 -3
- package/src/sniff.ts +35 -5
- package/src/types.ts +40 -1
- package/dist/chunks/importer-C7mnGdr_.js.map +0 -1
- package/dist/chunks/writer-BtWpUaiH.js.map +0 -1
package/src/types.ts
CHANGED
|
@@ -75,6 +75,30 @@ export interface CommonImportOptions {
|
|
|
75
75
|
encoding?: string | undefined;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Which graph of an input that holds several to read: by position or by name, never both. An
|
|
80
|
+
* importer of a format that can hold several graphs (a Cytoscape session, a CX collection, a JGF
|
|
81
|
+
* or OBO Graphs `graphs` array) accepts these next to its own options; absent, it reads the first.
|
|
82
|
+
*/
|
|
83
|
+
export interface GraphChoiceOptions {
|
|
84
|
+
/** The 0-based position of the graph, as `GraphListing.index` gives it. */
|
|
85
|
+
graphIndex?: number | undefined;
|
|
86
|
+
/** The name of the graph, as `GraphListing.name` gives it; a name two graphs share is refused. */
|
|
87
|
+
graphName?: string | undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** One graph of an input that can hold several, as an importer's listGraphs() describes it. */
|
|
91
|
+
export interface GraphListing {
|
|
92
|
+
/** The value graphIndex takes to read it. */
|
|
93
|
+
readonly index: number;
|
|
94
|
+
/** The value graphName takes to read it, or null when the graph has no name. */
|
|
95
|
+
readonly name: string | null;
|
|
96
|
+
/** The node count when the input states it cheaply, else null. */
|
|
97
|
+
readonly nodes: number | null;
|
|
98
|
+
/** The edge count when the input states it cheaply, else null. */
|
|
99
|
+
readonly edges: number | null;
|
|
100
|
+
}
|
|
101
|
+
|
|
78
102
|
/**
|
|
79
103
|
* An importer plugin (design section 8.4): pushes scalars into the caller's sink in one pass and
|
|
80
104
|
* never freezes. `Opts` is its format-specific option set; the default `unknown` lets a caller pass
|
|
@@ -117,6 +141,15 @@ export interface GraphImporter<Opts = unknown> {
|
|
|
117
141
|
sinkFor: (index: number) => GraphSink,
|
|
118
142
|
options?: Opts & CommonImportOptions,
|
|
119
143
|
): Promise<ImportReport[]>;
|
|
144
|
+
/**
|
|
145
|
+
* List the graphs of an input that can hold several without importing them, so a caller can
|
|
146
|
+
* offer a choice before reading one with `graphIndex` or `graphName`. An importer without this
|
|
147
|
+
* method does not list its graphs; `import()` reads the first.
|
|
148
|
+
* @param input - the text, bytes or stream to read
|
|
149
|
+
* @param options - format-specific and common options
|
|
150
|
+
* @returns one listing per graph, in document order
|
|
151
|
+
*/
|
|
152
|
+
listGraphs?(input: ImportInput, options?: Opts & CommonImportOptions): Promise<readonly GraphListing[]>;
|
|
120
153
|
}
|
|
121
154
|
|
|
122
155
|
/**
|
|
@@ -213,7 +246,13 @@ export interface GraphExporter<Opts = unknown> {
|
|
|
213
246
|
|
|
214
247
|
/** The categories of an ImportIssue (design section 8.6). */
|
|
215
248
|
export type IssueCategory =
|
|
216
|
-
|
|
249
|
+
| "parse-error"
|
|
250
|
+
| "missing-value"
|
|
251
|
+
| "validation-error"
|
|
252
|
+
| "unsupported"
|
|
253
|
+
| "precision"
|
|
254
|
+
| "coercion"
|
|
255
|
+
| "merged";
|
|
217
256
|
|
|
218
257
|
/** One problem found while importing (design section 8.6). */
|
|
219
258
|
export interface ImportIssue {
|