@matdata/yasgui-explain-plugin 0.1.0 → 1.0.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.
Files changed (43) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +91 -91
  3. package/dist/ExplainPlugin.d.ts +64 -0
  4. package/dist/ExplainPlugin.d.ts.map +1 -0
  5. package/dist/algebra/print.d.ts +21 -0
  6. package/dist/algebra/print.d.ts.map +1 -0
  7. package/dist/algebra/terms.d.ts +18 -0
  8. package/dist/algebra/terms.d.ts.map +1 -0
  9. package/dist/algebra/translate.d.ts +19 -0
  10. package/dist/algebra/translate.d.ts.map +1 -0
  11. package/dist/engines/blazegraph.d.ts +12 -0
  12. package/dist/engines/blazegraph.d.ts.map +1 -0
  13. package/dist/engines/graphdb.d.ts +23 -0
  14. package/dist/engines/graphdb.d.ts.map +1 -0
  15. package/dist/engines/index.d.ts +23 -0
  16. package/dist/engines/index.d.ts.map +1 -0
  17. package/dist/engines/neptune.d.ts +11 -0
  18. package/dist/engines/neptune.d.ts.map +1 -0
  19. package/dist/engines/qlever.d.ts +35 -0
  20. package/dist/engines/qlever.d.ts.map +1 -0
  21. package/dist/engines/stardog.d.ts +14 -0
  22. package/dist/engines/stardog.d.ts.map +1 -0
  23. package/dist/host.d.ts +24 -0
  24. package/dist/host.d.ts.map +1 -0
  25. package/dist/icons.d.ts +22 -0
  26. package/dist/icons.d.ts.map +1 -0
  27. package/dist/index.d.ts +17 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/render.d.ts +46 -0
  30. package/dist/render.d.ts.map +1 -0
  31. package/dist/settings.d.ts +11 -0
  32. package/dist/settings.d.ts.map +1 -0
  33. package/dist/types.d.ts +141 -0
  34. package/dist/types.d.ts.map +1 -0
  35. package/dist/yasgui-explain-plugin.cjs.js +20519 -0
  36. package/dist/yasgui-explain-plugin.cjs.js.map +7 -0
  37. package/dist/yasgui-explain-plugin.css +354 -0
  38. package/dist/yasgui-explain-plugin.esm.js +20513 -0
  39. package/dist/yasgui-explain-plugin.esm.js.map +7 -0
  40. package/dist/yasgui-explain-plugin.min.css +1 -0
  41. package/dist/yasgui-explain-plugin.min.js +146 -0
  42. package/dist/yasgui-explain-plugin.min.js.map +7 -0
  43. package/package.json +73 -73
@@ -0,0 +1,64 @@
1
+ /**
2
+ * YASGUI Explain plugin
3
+ *
4
+ * A YASR result view with two parts:
5
+ * - the execution plan of the query, asked from the endpoint's engine with one
6
+ * background request after the query ran (QLever, GraphDB, Stardog,
7
+ * Blazegraph, Neptune), and
8
+ * - the SPARQL algebra of the query, computed in the browser for any endpoint.
9
+ */
10
+ import type { ExplainPluginOptions, Yasr } from './types';
11
+ export declare class ExplainPlugin {
12
+ priority: number;
13
+ label: string;
14
+ helpReference: string;
15
+ private yasr;
16
+ private options;
17
+ private container;
18
+ private hostToolbarNodes;
19
+ private abortController;
20
+ /** Plans already fetched, by engine, endpoint and query */
21
+ private planCache;
22
+ private planState;
23
+ private planSection;
24
+ private algebra;
25
+ private algebraError;
26
+ private algebraText;
27
+ private query;
28
+ private endpoint;
29
+ constructor(yasr: Yasr, options?: ExplainPluginOptions);
30
+ /** Change options after construction; the next draw uses them */
31
+ setOptions(options: Partial<ExplainPluginOptions>): void;
32
+ static get label(): string;
33
+ static get priority(): number;
34
+ getIcon(): Element | undefined;
35
+ /** The view is useful for any response, including failed ones: the algebra never needs results */
36
+ canHandleResults(): boolean;
37
+ private getPluginName;
38
+ private getOptions;
39
+ /** The prefixes of the query (and of the host), with the usual RDF ones as a fallback */
40
+ private getPrefixes;
41
+ private readQueryAndEndpoint;
42
+ private serverHeader;
43
+ private resolveEngine;
44
+ draw(): void;
45
+ private drawToolbar;
46
+ private drawPlanSection;
47
+ private fetchPlan;
48
+ /** Send the plan request through the host (with the tab's settings) or, failing that, directly */
49
+ private runRequest;
50
+ private showPlan;
51
+ private addTreeActions;
52
+ private drawAlgebraSection;
53
+ /** YASR's download button saves the plan and the algebra as text */
54
+ download(filename?: string): {
55
+ getData: () => string;
56
+ contentType: string;
57
+ filename: string;
58
+ title: string;
59
+ } | undefined;
60
+ private cleanup;
61
+ destroy(): void;
62
+ }
63
+ export default ExplainPlugin;
64
+ //# sourceMappingURL=ExplainPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExplainPlugin.d.ts","sourceRoot":"","sources":["../src/ExplainPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAGV,oBAAoB,EAIpB,IAAI,EACL,MAAM,SAAS,CAAC;AAmCjB,qBAAa,aAAa;IACxB,QAAQ,SAAK;IACb,KAAK,SAAa;IAClB,aAAa,SAAgE;IAE7E,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,gBAAgB,CAAiB;IACzC,OAAO,CAAC,eAAe,CAAgC;IACvD,2DAA2D;IAC3D,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,WAAW,CAA2C;IAC9D,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,QAAQ,CAAqB;gBAEzB,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE,oBAAyB;IAK1D,iEAAiE;IACjE,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI;IAIxD,MAAM,KAAK,KAAK,IAAI,MAAM,CAEzB;IAED,MAAM,KAAK,QAAQ,IAAI,MAAM,CAE5B;IAED,OAAO,IAAI,OAAO,GAAG,SAAS;IAM9B,kGAAkG;IAClG,gBAAgB,IAAI,OAAO;IAI3B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,UAAU;IAQlB,yFAAyF;IACzF,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;IAKrB,IAAI,IAAI,IAAI;IAuBZ,OAAO,CAAC,WAAW;IAiEnB,OAAO,CAAC,eAAe;YA2CT,SAAS;IAkDvB,kGAAkG;YACpF,UAAU;IAoCxB,OAAO,CAAC,QAAQ;IAwBhB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,kBAAkB;IA6B1B,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM;;;;;;IAyB1B,OAAO,CAAC,OAAO;IAUf,OAAO,IAAI,IAAI;CAIhB;AAoBD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Two views of an algebra expression: a tree for the screen, and the
3
+ * s-expression text (the notation of ARQ and the SPARQL specification
4
+ * examples) for copying into issues and documentation.
5
+ */
6
+ import { type Prefixes } from './terms';
7
+ /** One node of the algebra tree shown on screen */
8
+ export interface AlgebraNode {
9
+ /** The operator, e.g. "project" */
10
+ operator: string;
11
+ /** Its arguments on the same line, e.g. "?s ?n" */
12
+ args?: string;
13
+ /** Lines below the operator, e.g. the triples of a bgp */
14
+ details?: string[];
15
+ children: AlgebraNode[];
16
+ }
17
+ /** Build the screen tree of an algebra expression */
18
+ export declare function toTree(algebra: any, prefixes?: Prefixes): AlgebraNode;
19
+ /** The s-expression of an algebra expression, in the style of ARQ's `qparse --print=op` */
20
+ export declare function toSExpression(algebra: any, prefixes?: Prefixes): string;
21
+ //# sourceMappingURL=print.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../src/algebra/print.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAoD,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1F,mDAAmD;AACnD,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAUD,qDAAqD;AACrD,wBAAgB,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAE,QAAa,GAAG,WAAW,CAqJzE;AAmBD,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAE,QAAa,GAAG,MAAM,CAI3E"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Printing RDF/JS terms, expressions and property paths in SPARQL syntax,
3
+ * with IRIs shortened by the prefixes of the query.
4
+ */
5
+ export interface Prefixes {
6
+ [prefix: string]: string;
7
+ }
8
+ /** Shorten an IRI with the longest matching prefix, else write it in angle brackets */
9
+ export declare function printIri(iri: string, prefixes?: Prefixes): string;
10
+ /** An RDF/JS term as SPARQL text */
11
+ export declare function printTerm(term: any, prefixes?: Prefixes): string;
12
+ /** A triple or quad pattern as `?s <p> ?o` (a non-default graph is appended as `@ <g>`) */
13
+ export declare function printQuad(quad: any, prefixes?: Prefixes): string;
14
+ /** A property path in SPARQL syntax */
15
+ export declare function printPath(path: any, prefixes?: Prefixes, parent?: 'alt' | 'seq' | 'unary' | undefined): string;
16
+ /** An expression in SPARQL-like prefix notation, e.g. `(> ?o 3)` or `(count ?o)` */
17
+ export declare function printExpression(expression: any, prefixes?: Prefixes): string;
18
+ //# sourceMappingURL=terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms.d.ts","sourceRoot":"","sources":["../../src/algebra/terms.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,QAAQ;IACvB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAKD,uFAAuF;AACvF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAa,GAAG,MAAM,CAWrE;AAED,oCAAoC;AACpC,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAE,QAAa,GAAG,MAAM,CAgCpE;AAED,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAE,QAAa,GAAG,MAAM,CASpE;AAcD,uCAAuC;AACvC,wBAAgB,SAAS,CACvB,IAAI,EAAE,GAAG,EACT,QAAQ,GAAE,QAAa,EACvB,MAAM,GAAE,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,SAAqB,GACtD,MAAM,CA8BR;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,GAAE,QAAa,GAAG,MAAM,CAgChF"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * From query text to SPARQL algebra, with traqula (the comunica parser and
3
+ * algebra transformer for SPARQL 1.2).
4
+ */
5
+ export type Algebra = any;
6
+ export interface TranslateOptions {
7
+ /** Base IRI for relative IRIs; a placeholder is used when the query has none */
8
+ baseIRI?: string;
9
+ }
10
+ /** The base used when the query has no BASE: relative IRIs then print as `<http://base/...>` */
11
+ export declare const DEFAULT_BASE_IRI = "http://base/";
12
+ export declare class AlgebraError extends Error {
13
+ constructor(message: string);
14
+ }
15
+ /** Translate a query to its algebra, or throw an AlgebraError with the parser's message */
16
+ export declare function translate(query: string, options?: TranslateOptions): Algebra;
17
+ /** The parser's messages list every token it expected; keep the readable head */
18
+ export declare function cleanParseMessage(error: unknown): string;
19
+ //# sourceMappingURL=translate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/algebra/translate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B,MAAM,WAAW,gBAAgB;IAC/B,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAID,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAqBhF;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAexD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Blazegraph
3
+ *
4
+ * With the `explain` request parameter, Blazegraph answers with an HTML page
5
+ * instead of the results: the query, its abstract syntax tree, the operator
6
+ * plan and, with `explain=details`, a table of statistics per operator. The
7
+ * plugin shows that page in a sandboxed frame.
8
+ */
9
+ import type { Engine, Plan } from '../types';
10
+ export declare function parseBlazegraphResponse(body: string, contentType: string | undefined): Plan;
11
+ export declare const blazegraph: Engine;
12
+ //# sourceMappingURL=blazegraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blazegraph.d.ts","sourceRoot":"","sources":["../../src/engines/blazegraph.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAY3F;AAED,eAAO,MAAM,UAAU,EAAE,MAYxB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Ontotext GraphDB
3
+ *
4
+ * GraphDB explains a query when it reads from the pseudo graph
5
+ * `onto:explain` (http://www.ontotext.com/explain): the response is then the
6
+ * plan as text, with the chosen order of the triple patterns and the estimated
7
+ * collection sizes, instead of the results. RDF4J shares the `/repositories/`
8
+ * URL layout but has no explain, so the request fails there.
9
+ */
10
+ import type { Engine, Plan } from '../types';
11
+ export declare const EXPLAIN_GRAPH = "http://www.ontotext.com/explain";
12
+ /**
13
+ * Add `FROM <onto:explain>` to a query. The clause goes right before the
14
+ * WHERE keyword (or the group graph pattern when WHERE is omitted), skipping
15
+ * comments, strings and IRIs so the words inside them are left alone.
16
+ */
17
+ export declare function addExplainGraph(query: string): string;
18
+ /** Offset of the first WHERE keyword or, without one, of the first `{` after the query form */
19
+ export declare function findWhereOffset(query: string): number;
20
+ /** The plan is text, but some clients get it wrapped in a SPARQL result: unwrap it */
21
+ export declare function parseGraphdbResponse(body: string, contentType: string | undefined): Plan;
22
+ export declare const graphdb: Engine;
23
+ //# sourceMappingURL=graphdb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphdb.d.ts","sourceRoot":"","sources":["../../src/engines/graphdb.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,aAAa,oCAAoC,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA0DrD;AAmBD,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAgCxF;AAED,eAAO,MAAM,OAAO,EAAE,MAerB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The engines the plugin can ask for an execution plan, and how to tell which
3
+ * one an endpoint runs.
4
+ */
5
+ import type { Engine, EngineChoice, EngineId } from '../types';
6
+ export declare const ENGINES: Record<EngineId, Engine>;
7
+ export declare const ENGINE_IDS: EngineId[];
8
+ export declare function isEngineId(value: unknown): value is EngineId;
9
+ export declare function isEngineChoice(value: unknown): value is EngineChoice;
10
+ /**
11
+ * Guess the engine behind an endpoint from its URL and, when the host exposes
12
+ * them, the response headers of the last query. Undefined when nothing matches:
13
+ * the user can then pick the engine by hand.
14
+ */
15
+ export declare function detectEngine(endpoint: string | undefined, serverHeader?: string | null): EngineId | undefined;
16
+ /** How the engine was chosen, for the toolbar */
17
+ export interface ResolvedEngine {
18
+ engine: Engine | undefined;
19
+ /** "stored" when the user picked it, "detected" when guessed, "none" when neither */
20
+ source: 'stored' | 'detected' | 'forced' | 'none';
21
+ }
22
+ export declare function resolveEngine(choice: EngineChoice, endpoint: string | undefined, serverHeader?: string | null, forced?: EngineChoice): ResolvedEngine;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAO/D,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAqD,CAAC;AAEnG,eAAO,MAAM,UAAU,EAAE,QAAQ,EAA8D,CAAC;AAEhG,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAC3B,QAAQ,GAAG,SAAS,CA6BtB;AAED,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,qFAAqF;IACrF,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;CACnD;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,EAC5B,MAAM,CAAC,EAAE,YAAY,GACpB,cAAc,CAShB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Amazon Neptune
3
+ *
4
+ * Neptune explains a query with the `explain` request parameter
5
+ * (`explain=details` adds the estimates and the time per operator). The
6
+ * response is a text table, one row per operator.
7
+ */
8
+ import type { Engine, Plan } from '../types';
9
+ export declare function parseNeptuneResponse(body: string, contentType: string | undefined): Plan;
10
+ export declare const neptune: Engine;
11
+ //# sourceMappingURL=neptune.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neptune.d.ts","sourceRoot":"","sources":["../../src/engines/neptune.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAsBxF;AAED,eAAO,MAAM,OAAO,EAAE,MAWrB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * QLever (https://github.com/ad-freiburg/qlever)
3
+ *
4
+ * With `Accept: application/qlever-results+json`, QLever returns its results
5
+ * together with `runtimeInformation`: the tree of operations it executed, with
6
+ * the time and the number of rows of each. The plugin re-sends the query with
7
+ * that Accept header once the user's query has completed: QLever answers from
8
+ * its result cache, and cached operations keep their original times in their
9
+ * details.
10
+ */
11
+ import type { Engine, Plan, PlanNode } from '../types';
12
+ /** A node of QLever's `query_execution_tree` (newer) or `runtimeInformation` (older) */
13
+ interface QleverNode {
14
+ description?: string;
15
+ operation_time?: number;
16
+ total_time?: number;
17
+ result_rows?: number;
18
+ result_cols?: number;
19
+ column_names?: string[];
20
+ cache_status?: string;
21
+ was_cached?: boolean;
22
+ status?: string;
23
+ estimated_size?: number;
24
+ estimated_operation_cost?: number;
25
+ estimated_column_multiplicities?: number[];
26
+ details?: Record<string, unknown>;
27
+ children?: QleverNode[];
28
+ }
29
+ /** Convert one QLever node (and its children) to a plan node */
30
+ export declare function toPlanNode(node: QleverNode): PlanNode;
31
+ /** Parse a `application/qlever-results+json` response into a plan */
32
+ export declare function parseQleverResponse(body: string): Plan;
33
+ export declare const qlever: Engine;
34
+ export {};
35
+ //# sourceMappingURL=qlever.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qlever.d.ts","sourceRoot":"","sources":["../../src/engines/qlever.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIvD,wFAAwF;AACxF,UAAU,UAAU;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,+BAA+B,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB;AAeD,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ,CAsCrD;AAQD,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAyCtD;AAED,eAAO,MAAM,MAAM,EAAE,MAYpB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Stardog
3
+ *
4
+ * Stardog explains a query on `GET|POST /{db}/explain` with the same `query`
5
+ * parameter as `/{db}/query`. With `profile=true` the plan carries the actual
6
+ * rows, wall time and memory of each operator; without it only estimates.
7
+ * The response is the plan as text.
8
+ */
9
+ import type { Engine, Plan } from '../types';
10
+ /** `https://host:5820/mydb/query` becomes `https://host:5820/mydb/explain` */
11
+ export declare function explainUrl(endpoint: string): string;
12
+ export declare function parseStardogResponse(body: string): Plan;
13
+ export declare const stardog: Engine;
14
+ //# sourceMappingURL=stardog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stardog.d.ts","sourceRoot":"","sources":["../../src/engines/stardog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE7C,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOnD;AAOD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAiBvD;AAED,eAAO,MAAM,OAAO,EAAE,MAgBrB,CAAC"}
package/dist/host.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Feature detection for the YASR host API
3
+ *
4
+ * Newer YASR versions (MatGUI) offer a toolbar slot and pass extra request
5
+ * options to background queries. Older ones don't: the plugin then draws its
6
+ * own toolbar and, when a request needs options the host can't pass, sends
7
+ * the request itself without the tab's authentication.
8
+ */
9
+ import type { Yasr } from './types';
10
+ /** The host's plugin toolbar slot, or null when the host has none */
11
+ export declare function getHostToolbar(yasr: Yasr | null | undefined): HTMLDivElement | null;
12
+ /** True when `yasr.executeQuery` passes `extraArgs` and `endpoint` to the request */
13
+ export declare function hasHostRequestOptions(yasr: Yasr | null | undefined): boolean;
14
+ /** True when the host runs background queries with the tab's settings */
15
+ export declare function hasHostExecuteQuery(yasr: Yasr | null | undefined): boolean;
16
+ /**
17
+ * The current query and endpoint, read from the host's plain query link
18
+ * (`endpoint?query=...&default-graph-uri=...`).
19
+ */
20
+ export declare function readQueryLink(yasr: Yasr | null | undefined): {
21
+ query?: string;
22
+ endpoint?: string;
23
+ };
24
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,CASnF;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE5E;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE1E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAiBA"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Inline Lucide icons (https://lucide.dev, ISC licence)
3
+ *
4
+ * Only the few icons the plugin needs are inlined, so there is no icon font
5
+ * or runtime dependency. They are stroke icons drawn in `currentColor`.
6
+ */
7
+ declare const ICON_PATHS: {
8
+ readonly 'list-tree': string;
9
+ readonly 'chevron-down': "<path d=\"m6 9 6 6 6-6\"/>";
10
+ readonly 'chevron-right': "<path d=\"m9 18 6-6-6-6\"/>";
11
+ readonly copy: string;
12
+ readonly 'rotate-ccw': "<path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\"/><path d=\"M3 3v5h5\"/>";
13
+ readonly 'unfold-vertical': string;
14
+ readonly 'fold-vertical': string;
15
+ };
16
+ export type IconName = keyof typeof ICON_PATHS;
17
+ /** SVG markup of a Lucide icon (decorative: hidden from assistive technology) */
18
+ export declare function iconSvg(name: IconName, size?: number, strokeWidth?: number): string;
19
+ /** A Lucide icon as a DOM element */
20
+ export declare function icon(name: IconName, size?: number, strokeWidth?: number): SVGElement;
21
+ export {};
22
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,QAAA,MAAM,UAAU;;;;;;;;CAgBN,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C,iFAAiF;AACjF,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,SAAK,EAAE,WAAW,SAAO,GAAG,MAAM,CAO7E;AAED,qCAAqC;AACrC,wBAAgB,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAIpF"}
@@ -0,0 +1,17 @@
1
+ import ExplainPlugin from './ExplainPlugin';
2
+ declare global {
3
+ interface Window {
4
+ Yasgui?: {
5
+ Yasr?: {
6
+ registerPlugin: (name: string, plugin: any) => void;
7
+ };
8
+ };
9
+ }
10
+ }
11
+ export default ExplainPlugin;
12
+ export { ExplainPlugin };
13
+ export { translate, AlgebraError } from './algebra/translate';
14
+ export { toSExpression, toTree } from './algebra/print';
15
+ export { ENGINES, ENGINE_IDS, detectEngine } from './engines';
16
+ export type { ExplainPluginOptions, EngineId, EngineChoice, Plan, PlanNode, Engine } from './types';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,CAAC,EAAE;YACP,IAAI,CAAC,EAAE;gBACL,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;aACrD,CAAC;SACH,CAAC;KACH;CACF;AAOD,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9D,YAAY,EAAE,oBAAoB,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * DOM rendering of the Explain view: sections, the execution plan (as a tree,
3
+ * as text or as a sandboxed page) and the algebra tree.
4
+ */
5
+ import type { Plan, PlanNode } from './types';
6
+ import type { AlgebraNode } from './algebra/print';
7
+ import { type IconName } from './icons';
8
+ /** A `<button>` with an icon and a label */
9
+ export declare function button(label: string, iconName: IconName | undefined, onClick: () => void, title?: string): HTMLButtonElement;
10
+ /** Copy text to the clipboard; falls back to a hidden textarea where the API is missing */
11
+ export declare function copyText(text: string): Promise<boolean>;
12
+ /** A "Copy" button that shows "Copied" for a moment */
13
+ export declare function copyButton(getText: () => string, label?: string): HTMLButtonElement;
14
+ export interface Section {
15
+ root: HTMLElement;
16
+ body: HTMLElement;
17
+ actions: HTMLElement;
18
+ setStatus(text: string, kind?: 'muted' | 'error'): void;
19
+ }
20
+ /** A titled, collapsible block with an action bar */
21
+ export declare function section(title: string, collapsed?: boolean): Section;
22
+ export declare function message(text: string, kind?: 'muted' | 'error' | 'info'): HTMLElement;
23
+ declare function countNodes(node: PlanNode | AlgebraNode): number;
24
+ export interface TreeHandle {
25
+ root: HTMLElement;
26
+ expandAll(): void;
27
+ collapseAll(): void;
28
+ }
29
+ /** Render an execution plan tree: one row per operation with rows, time and a time bar */
30
+ export declare function renderPlanTree(root: PlanNode, summary?: string[]): TreeHandle;
31
+ /** Render a text plan in a scrollable monospace block */
32
+ export declare function renderText(text: string): HTMLElement;
33
+ /** Render an HTML plan page in a sandboxed frame: no scripts, no navigation, same look as the engine's page */
34
+ export declare function renderHtml(html: string): HTMLElement;
35
+ /** Render the algebra tree */
36
+ export declare function renderAlgebraTree(root: AlgebraNode): TreeHandle;
37
+ /** Render a plan of any kind */
38
+ export declare function renderPlan(plan: Plan): {
39
+ root: HTMLElement;
40
+ tree?: TreeHandle;
41
+ text?: string;
42
+ };
43
+ /** A plan tree as indented text, for the clipboard and the download */
44
+ export declare function planTreeToText(root: PlanNode, summary?: string[]): string;
45
+ export { countNodes };
46
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE9C,4CAA4C;AAC5C,wBAAgB,MAAM,CACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,IAAI,EACnB,KAAK,CAAC,EAAE,MAAM,GACb,iBAAiB,CAWnB;AAED,2FAA2F;AAC3F,wBAAsB,QAAQ,CAAC,IAAI,EA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CAAC,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAW9F;AAED,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAkBzE;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The engine chosen per endpoint, remembered in localStorage so the choice
3
+ * survives new tabs and reloads. Storage can be unavailable (private windows,
4
+ * blocked site data): every access is guarded.
5
+ */
6
+ import type { EngineChoice } from './types';
7
+ /** The stored engine choice of an endpoint, "auto" when none was stored */
8
+ export declare function getEngineChoice(endpoint: string | undefined): EngineChoice;
9
+ /** Remember the engine choice of an endpoint ("auto" forgets it) */
10
+ export declare function setEngineChoice(endpoint: string | undefined, choice: EngineChoice): void;
11
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAqB5C,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAG1E;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAUxF"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Shared types for the YASGUI Explain plugin
3
+ */
4
+ /** Options for a background request run through `yasr.executeQuery` */
5
+ export interface PluginQueryOptions {
6
+ /** Custom Accept header for the request */
7
+ acceptHeader?: string;
8
+ /** Abort signal for cancelling an in-flight request */
9
+ signal?: AbortSignal;
10
+ /**
11
+ * Extra request parameters, sent next to `query` (MatGUI host API 2 and later).
12
+ * Older hosts ignore them: check `yasr.hostApi.queryRequest` first.
13
+ */
14
+ extraArgs?: Record<string, string | string[]>;
15
+ /** Send the request to this URL instead of the tab's endpoint (MatGUI host API 2 and later) */
16
+ endpoint?: string;
17
+ }
18
+ /**
19
+ * Features a YASR host offers to plugins (MatGUI yasr host API).
20
+ * Absent on older YASR versions: plugins feature-detect it, never a version string.
21
+ */
22
+ export interface YasrHostApi {
23
+ version: number;
24
+ /** `yasr.describe()` opens the shared describe panel */
25
+ describe?: boolean;
26
+ /** `yasr.getPluginToolbar()` returns the shared toolbar slot */
27
+ toolbar?: boolean;
28
+ /** `yasr.executeQuery()` honours `extraArgs` and `endpoint` */
29
+ queryRequest?: boolean;
30
+ }
31
+ /** The parts of a YASR instance the plugin uses */
32
+ export interface Yasr {
33
+ results: any;
34
+ resultsEl: HTMLElement;
35
+ plugins?: Record<string, unknown>;
36
+ config?: {
37
+ plugins?: Record<string, {
38
+ dynamicConfig?: unknown;
39
+ } | undefined>;
40
+ /** A link to the endpoint carrying the current query as `query` parameter (MatGUI) */
41
+ getPlainQueryLinkToEndpoint?: () => string | undefined;
42
+ prefixes?: Record<string, string> | (() => Record<string, string>);
43
+ };
44
+ getPrefixes?: () => Record<string, string>;
45
+ storePluginConfig?: (pluginName: string, conf: unknown) => void;
46
+ executeQuery?: (query: string, options?: PluginQueryOptions) => Promise<any>;
47
+ hostApi?: YasrHostApi;
48
+ getPluginToolbar?: () => HTMLDivElement;
49
+ }
50
+ /** The identifiers of the engines the plugin can ask for a plan */
51
+ export type EngineId = 'qlever' | 'graphdb' | 'stardog' | 'blazegraph' | 'neptune';
52
+ /** The engine setting of an endpoint: detect it, one of the engines, or no plan at all */
53
+ export type EngineChoice = 'auto' | EngineId | 'none';
54
+ /** One operation of an execution plan tree */
55
+ export interface PlanNode {
56
+ /** What the operation does, e.g. "Join on ?s" or "IndexScan ?s <p> ?o" */
57
+ label: string;
58
+ /** Extra lines about the operation (estimates, cache, details) */
59
+ details?: string[];
60
+ /** Rows the operation produced */
61
+ rows?: number;
62
+ /** Columns of the result */
63
+ columns?: string[];
64
+ /** Time spent in this operation alone, in milliseconds */
65
+ timeMs?: number;
66
+ /** Time spent in this operation and its children, in milliseconds */
67
+ totalMs?: number;
68
+ /** The result came from the engine's cache */
69
+ cached?: boolean;
70
+ /** Status reported by the engine, e.g. "completed" or "not started" */
71
+ status?: string;
72
+ children: PlanNode[];
73
+ }
74
+ /** An execution plan as returned by an engine */
75
+ export type Plan = {
76
+ kind: 'tree';
77
+ root: PlanNode;
78
+ /** Summary lines shown above the tree (planning time, total time, ...) */
79
+ summary?: string[];
80
+ } | {
81
+ kind: 'text';
82
+ text: string;
83
+ } | {
84
+ kind: 'html';
85
+ html: string;
86
+ };
87
+ /** A request for a plan, run against the tab's endpoint with its settings */
88
+ export interface PlanRequest {
89
+ /** The query to send; usually the user's query, sometimes rewritten (GraphDB) */
90
+ query: string;
91
+ /** Accept header */
92
+ accept: string;
93
+ /** Extra parameters sent next to the query */
94
+ extraArgs?: Record<string, string>;
95
+ /** Send to this URL instead of the endpoint */
96
+ endpoint?: string;
97
+ }
98
+ /** The raw response of a plan request, in the shape yasqe returns */
99
+ export interface PlanResponse {
100
+ status?: number;
101
+ headers?: {
102
+ get(name: string): string | null;
103
+ } | Record<string, string>;
104
+ content?: string;
105
+ data?: string;
106
+ text?: () => Promise<string>;
107
+ }
108
+ /** Everything the plugin knows about one engine */
109
+ export interface Engine {
110
+ id: EngineId;
111
+ label: string;
112
+ /** One line telling the user what the engine returns */
113
+ description: string;
114
+ /** Whether the request needs `extraArgs` or `endpoint` support from the host */
115
+ needsRequestOptions: boolean;
116
+ /** Build the request that returns the plan of `query` on `endpoint` */
117
+ buildRequest(query: string, endpoint: string): PlanRequest;
118
+ /** Turn the response into a plan, or throw an Error that says what went wrong */
119
+ parse(body: string, contentType: string | undefined): Plan;
120
+ }
121
+ /** Options accepted by the plugin constructor and by `yasr.config.plugins.Explain.dynamicConfig` */
122
+ export interface ExplainPluginOptions {
123
+ /** Read the current query text; by default it is taken from the host's query link */
124
+ getQuery?: () => string | undefined;
125
+ /** Read the endpoint URL; by default it is taken from the host's query link */
126
+ getEndpoint?: () => string | undefined;
127
+ /** Fetch the engine plan as soon as the view is drawn (default true) */
128
+ autoFetch?: boolean;
129
+ /** Engines to offer, in order; default all */
130
+ engines?: EngineId[];
131
+ /** Force an engine for every endpoint (skips detection and the stored choice) */
132
+ engine?: EngineChoice;
133
+ /** Base IRI used to resolve relative IRIs when computing the algebra */
134
+ baseIRI?: string;
135
+ /**
136
+ * Send a plan request yourself instead of the host or a plain fetch, for
137
+ * example to add headers or to serve recorded responses in a demo.
138
+ */
139
+ requestPlan?: (request: PlanRequest, signal: AbortSignal) => Promise<PlanResponse>;
140
+ }
141
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC9C,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,mDAAmD;AACnD,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,GAAG,CAAC;IACb,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,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