@concordance-wiki/inference 0.1.0 → 0.3.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/README.md CHANGED
@@ -1,8 +1,73 @@
1
- # @concordance-wiki/inference
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/concordance-wiki/concordance/main/brand/concordance-mark.svg" width="72" alt="Concordance">
3
+ </p>
2
4
 
3
- Link production, confidence combination, relation typing, bounded neighbourhood, term candidates.
5
+ <h1 align="center">@concordance-wiki/inference</h1>
4
6
 
5
- Today: explicit links (`explicitLinks`): every markdown link written in a note that resolves to another note gives a link at the `explicit_link` confidence of the profile, with the file, the line, the link text and the anchor as provenance; a link to a non-markdown file gives a `documents` link from the resource to the note; a missing target is `E-LINK-BROKEN`; a target in another source, written `<source>:<path>` or as a relative path climbing into a sibling source, resolves when `inference.cross_source_links` allows it and is `W-LINK-CROSS-SOURCE` otherwise. Links from one note to the same target are merged with every provenance kept; a link between two notes is `related` until the relation typing step names it. Bounded neighbourhood (`accumulateCooccurrences`, `neighbourhoodOptions`): two entities named in the same paragraph are neighbours, counted per paragraph; every node keeps its K best neighbours by count then by identifier (`inference.neighbours.k`, 50 by default), its row trimmed whenever it grows past 2K so that the full matrix is never held, and a paragraph naming more than 200 entities pairs only the first 200. `cooccurrenceLinks` turns every pair into one `related` link at the `cooccurrence` confidence with the number of shared paragraphs as provenance; `neighbourhoodToModel` writes the `neighbours` block of `model.json`. Confidence combination (`combineLinks`, `combineOptions`): one link per source, target, relation and attributes, at `1 − Π(1 − cᵢ)` over its methods (`combineConfidences`, clamped to [0, 1] and rounded to four decimals), the glossary occurrences of a group counting as one method at the base of the first plus `per_occurrence` per additional occurrence up to `cap` (`glossaryConfidence`); every provenance is kept in canonical order, an exact duplicate once, and the function is pure and idempotent. Displayed neighbourhood (`displayedNeighbourhood`, `displayOptions`): the one-hop neighbours of every entity through the links of the model in either direction, typed entities and noteless keyword pages alike, each flagged by its `kind`, carrying the largest confidence and the relation of the most confident link between the two nodes, its `direction` seen from the entity and its `rank`, the position of its type in the `display.neighbours_order` the profile declares for the entity's type (types not listed, keyword pages included, share the rank after the last one); sorted by rank, then by decreasing confidence, then by identifier, and truncated after that to `site.neighbourhood.size` (6 by default, never more than `MAX_DISPLAYED_NEIGHBOURS`, 12), so that the nodes shown are the best of the priority order; a type without a declaration sorts by confidence alone; an entity without any neighbour has an empty list. `displayedNeighbourhoodToModel` writes the `displayed_neighbourhood` block of `model.json`, precomputed at build so that the browser never computes it. Confidence combination (`combineLinks`, `combineOptions`): one link per source, target, relation and attributes, at `1 − Π(1 − cᵢ)` over its methods (`combineConfidences`, clamped to [0, 1] and rounded to four decimals), the glossary occurrences of a group counting as one method at the base of the strongest plus `per_occurrence` per additional occurrence up to `cap` (`glossaryConfidence`); every provenance is kept in canonical order, an exact duplicate once, and the function is pure and idempotent. Displayed neighbourhood (`displayedNeighbourhood`, `displayOptions`): the one-hop neighbours of every entity through the links of the model in either direction, typed entities and noteless keyword pages alike, each flagged by its `kind`, carrying the largest confidence and the relation of the most confident link between the two nodes and its `direction` seen from the entity; sorted by decreasing confidence then by identifier and truncated to `site.neighbourhood.size` (6 by default, never more than `MAX_DISPLAYED_NEIGHBOURS`, 12); an entity without any neighbour has an empty list. `displayedNeighbourhoodToModel` writes the `displayed_neighbourhood` block of `model.json`, precomputed at build so that the browser never computes it.
7
+ <p align="center"><strong>Decides which pages are linked, how surely, and on what evidence.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@concordance-wiki/inference"><img alt="npm" src="https://img.shields.io/npm/v/@concordance-wiki/inference?style=flat-square"></a>
11
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/LICENSE"><img alt="Licence" src="https://img.shields.io/badge/licence-GPL--3.0--or--later-16181B?style=flat-square"></a>
12
+ <a href="https://github.com/concordance-wiki/concordance/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/concordance-wiki/concordance/ci.yml?branch=main&label=ci&style=flat-square"></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/docs/guides/getting-started.md">Getting started</a> ·
17
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/docs/guides/configuration.md">Configuration</a> ·
18
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/docs/guides/architecture.md">Architecture</a> ·
19
+ <a href="https://github.com/concordance-wiki/concordance/blob/main/packages/inference/CHANGELOG.md">Changelog</a>
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## Why
25
+
26
+ Concordance shows, on every page, the pages related to it, and every link says where it comes from: written links always beat inferred ones. You install [`@concordance-wiki/concordance`](https://www.npmjs.com/package/@concordance-wiki/concordance) for that. This package is the part of it that produces the links: from the links people wrote, the references in the frontmatter, the mentions of a title in a section or a paragraph and the terms that keep appearing together; it combines their confidences, names the relation from the meta-model, keeps the neighbourhood a page shows, and recognises the documents that are twins of a note. Install it alone to build on the engine.
27
+
28
+ ## Quick start
29
+
30
+ ```bash
31
+ npm install @concordance-wiki/inference
32
+ ```
33
+
34
+ Two producers saw the same link; the build keeps one, at the combined confidence, with both provenances:
35
+
36
+ ```ts
37
+ import { combineConfidences, combineLinks, combineOptions } from "@concordance-wiki/inference";
38
+ import { loadDefaultProfile } from "@concordance-wiki/profile";
39
+
40
+ combineConfidences([0.6, 0.5]); // 0.8, that is 1 − (1 − 0.6) × (1 − 0.5)
41
+ const links = [
42
+ { from: "specs/link-broken", to: "glossary/finding", relation: "related", confidence: 0.6, provenance: [{ method: "section_mention", confidence: 0.6, path: "checks/link-broken.md", line: 12 }] },
43
+ { from: "specs/link-broken", to: "glossary/finding", relation: "related", confidence: 0.5, provenance: [{ method: "explicit_link", confidence: 0.5, path: "checks/link-broken.md", line: 3 }] },
44
+ ];
45
+ combineLinks(links, combineOptions(loadDefaultProfile())); // one link at 0.8, its two provenances in canonical order
46
+ ```
47
+
48
+ ## What you get
49
+
50
+ - **Four producers**: `explicitLinks`, `frontmatterLinks`, `mentionLinks`, `cooccurrenceLinks`, from the written links, the reference attributes of the frontmatter, the occurrences of a title or alias, and the entities named in the same paragraph.
51
+ - **One link, every proof**: `combineLinks` keeps one link per source, target and relation, at `1 − Π(1 − cᵢ)`, with every provenance so the page can show why.
52
+ - **A relation with a name**: `typeRelations` and `relationLabel` read it from the meta-model (mapped section, typed attribute, single relation of a type pair, else `related`), with `E-META-REL` and `I-REL-AMBIGUOUS` when the notes disagree with it.
53
+ - **The neighbourhood, precomputed**: the bounded neighbours of every node and the ones a page displays, decided at build so the site needs no server.
54
+ - **Twin resources**: `resolveDuplicateResources` scores a document and a note that describe the same thing, MinHash and LSH on the text, and applies the decisions of the lock file.
55
+ - **Contracts matched to notes**: `attachOperations` joins every hand-written `endpoint` note to the operation imported from the contract of its API.
56
+ - **References resolved**: `indexEntities` and `resolveReference` read a frontmatter value by identifier, path or exact title.
57
+
58
+ ## Documentation
59
+
60
+ - [Writing notes](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/writing-notes.md)
61
+ - [Configuration reference](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/configuration.md), the `inference` block
62
+ - [Architecture](https://github.com/concordance-wiki/concordance/blob/main/docs/guides/architecture.md)
63
+ - [Home page](https://concordance-wiki.github.io/concordance/), the [demo wiki](https://concordance-wiki.github.io/demo-wiki/) and the [changelog](https://github.com/concordance-wiki/concordance/blob/main/packages/inference/CHANGELOG.md)
64
+
65
+ Part of [Concordance](https://github.com/concordance-wiki/concordance), GNU GPL v3 or later.
66
+
67
+ <details>
68
+ <summary>Inside the package</summary>
69
+
70
+ Explicit links (`explicitLinks`): every markdown link written in a note that resolves to another note gives a link at the `explicit_link` confidence of the profile, with the file, the line, the link text and the anchor as provenance; a link to a non-markdown file gives a `documents` link from the resource to the note; a missing target is `E-LINK-BROKEN`; a target in another source, written `<source>:<path>` or as a relative path climbing into a sibling source, resolves when `inference.cross_source_links` allows it and is `W-LINK-CROSS-SOURCE` otherwise. Links from one note to the same target are merged with every provenance kept; a link between two notes is `related` until the relation typing step names it. Bounded neighbourhood (`accumulateCooccurrences`, `neighbourhoodOptions`): two entities named in the same paragraph are neighbours, counted per paragraph; every node keeps its K best neighbours by count then by identifier (`inference.neighbours.k`, 50 by default), its row trimmed whenever it grows past 2K so that the full matrix is never held, and a paragraph naming more than 200 entities pairs only the first 200. `cooccurrenceLinks` turns every pair into one `related` link at the `cooccurrence` confidence with the number of shared paragraphs as provenance; `neighbourhoodToModel` writes the `neighbours` block of `model.json`. Confidence combination (`combineLinks`, `combineOptions`): one link per source, target, relation and attributes, at `1 − Π(1 − cᵢ)` over its methods (`combineConfidences`, clamped to [0, 1] and rounded to four decimals), the glossary occurrences of a group counting as one method at the base of the strongest plus `per_occurrence` per additional occurrence up to `cap` (`glossaryConfidence`); every provenance is kept in canonical order, an exact duplicate once, and the function is pure and idempotent. Displayed neighbourhood (`displayedNeighbourhood`, `displayOptions`): the one-hop neighbours of every entity through the links of the model in either direction, typed entities and noteless keyword pages alike, each flagged by its `kind`, carrying the largest confidence and the relation of the most confident link between the two nodes, its `direction` seen from the entity and its `rank`, the position of its type in the `display.neighbours_order` the profile declares for the entity's type (types not listed, keyword pages included, share the rank after the last one); sorted by rank, then by decreasing confidence, then by identifier, and truncated after that to `site.neighbourhood.size` (6 by default, never more than `MAX_DISPLAYED_NEIGHBOURS`, 12), so that the nodes shown are the best of the priority order; a type without a declaration sorts by confidence alone; an entity without any neighbour has an empty list. `displayedNeighbourhoodToModel` writes the `displayed_neighbourhood` block of `model.json`, precomputed at build so that the browser never computes it.
6
71
 
7
72
  Frontmatter references (`frontmatterLinks`): every reference-typed attribute of the profile that carries a relation (`reads`, `writes`, `rules`, `roles`, `consumers`, `affects`, `broader`, `business_object`, ...) turns each of its values into a link of that relation at the `frontmatter_ref` confidence, with the attributes the profile declares (`accesses` in `read` mode for `reads`), reversed when the attribute is `inverse`, and the file, line 1 and the attribute name as provenance. A value is resolved by identifier (full, or relative to the source of the note), then by source-relative path, then by exact title (`resolveReference` over an `indexEntities` index); a value that matches nothing, a title shared by several notes or a value that is not a string is `W-REF-UNRESOLVED` and gives no link; a note of a type the attribute does not accept gives its link, which the relation typing step drops with `E-META-REL` when the matrix forbids the relation. Several values naming the same target are merged with every provenance kept.
8
73
 
@@ -12,4 +77,4 @@ Mentions (`mentionLinks`): every occurrence of a note's title or alias read in a
12
77
 
13
78
  Operation notes (`attachOperations`): every hand-written `endpoint` note is matched to an operation imported from the contract of its API, on the `operation_id` of its frontmatter, then on its `method` and `path` (or `port` and title for a SOAP operation), then on its title in comparison form with spaces and punctuation removed, against the operation title or identifier; the note names its API through the reference attribute of the profile (`api`), through a link already recorded with the API note, or is a candidate for every API of its source that has imported operations. A note stops at the first rung that matches, and an operation matched at a stronger rung is no longer offered to the weaker ones. A matched pair merges into the note, which keeps its identifier, markdown and frontmatter, takes the contract attributes it does not set, the operation's aliases and summary when it has none, lists the contract as a representation `{ kind: "contract", path, operation }` next to its own file (after any twin resources already merged) and names the rung in `grouped_by`; the imported operation disappears and every link that named it, the `exposes` link of the API first of all, now names the note. A note matching several operations, or an operation claimed by several notes, yields `W-OPERATION-AMBIGUOUS` naming every candidate and attaches nothing; a note that names an API with an imported contract and matches none of its operations yields `W-OPERATION-UNMATCHED`, saying that the operation left the contract or that the note is ahead of it, while a note that names no API is left alone. The step is pure and deterministic and returns sorted entities, links and findings; in the pipeline it runs after the sources step, which imports the contracts, and before the mention scan, so that the merged note is the one the dictionary and the sections link.
14
79
 
15
- Part of [Concordance](../../README.md).
80
+ </details>
@@ -0,0 +1,8 @@
1
+ import type { EmergentDomains, EmergentDomainsInput, EmergentDomainsOptions } from "./types.js";
2
+ /**
3
+ * The pivots of the graph and the attachable notes within `radius` of one, each attached to
4
+ * its closest pivot; at equal distance the pivot of highest degree wins, then the first in
5
+ * code-unit order. The same graph gives the same result whatever the order of its nodes and edges.
6
+ */
7
+ export declare function proposeEmergentDomains(input: EmergentDomainsInput, options: EmergentDomainsOptions): EmergentDomains;
8
+ //# sourceMappingURL=attach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../src/domains/attach.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CAsBjB"}
@@ -0,0 +1,32 @@
1
+ import { byCodeUnit } from "../neighbourhood/order.js";
2
+ import { buildGraph, distancesFrom } from "./graph.js";
3
+ import { selectPivots } from "./pivots.js";
4
+ /**
5
+ * The pivots of the graph and the attachable notes within `radius` of one, each attached to
6
+ * its closest pivot; at equal distance the pivot of highest degree wins, then the first in
7
+ * code-unit order. The same graph gives the same result whatever the order of its nodes and edges.
8
+ */
9
+ export function proposeEmergentDomains(input, options) {
10
+ const graph = buildGraph(input.nodes, input.edges);
11
+ const candidates = new Set(input.nodes.filter((node) => node.candidate).map((node) => node.id));
12
+ const pivots = selectPivots(candidates, graph, options.minNeighbours, options.maxNeighbours);
13
+ const closest = new Map();
14
+ // Pivots are visited best first, so a later pivot only wins a note at a strictly shorter distance.
15
+ for (const pivot of pivots) {
16
+ for (const [id, distance] of distancesFrom(graph, pivot.id, options.radius)) {
17
+ const current = closest.get(id);
18
+ if (current === undefined || distance < current.distance) {
19
+ closest.set(id, { id, pivot: pivot.id, distance });
20
+ }
21
+ }
22
+ }
23
+ const attachments = input.nodes
24
+ .filter((node) => node.attachable)
25
+ .flatMap((node) => {
26
+ const attachment = closest.get(node.id);
27
+ return attachment === undefined ? [] : [attachment];
28
+ })
29
+ .sort((a, b) => byCodeUnit(a.id, b.id));
30
+ return { pivots, attachments };
31
+ }
32
+ //# sourceMappingURL=attach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach.js","sourceRoot":"","s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C;IACH,CAAC;IACD,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK;SAC5B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;SACjC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxC,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { DomainEdge, DomainNode } from "./types.js";
2
+ /** Every node with its distinct neighbours in identifier order; an edge naming an unknown node or joining a node to itself is dropped. */
3
+ export type DomainGraph = ReadonlyMap<string, readonly string[]>;
4
+ export declare function buildGraph(nodes: readonly DomainNode[], edges: readonly DomainEdge[]): DomainGraph;
5
+ /** The distance from `start` to every node within `radius`, the start at zero. */
6
+ export declare function distancesFrom(graph: DomainGraph, start: string, radius: number): Map<string, number>;
7
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/domains/graph.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEzD,0IAA0I;AAC1I,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;AAEjE,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,KAAK,EAAE,SAAS,UAAU,EAAE,GAC3B,WAAW,CAab;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAerB"}
@@ -0,0 +1,37 @@
1
+ import { byCodeUnit } from "../neighbourhood/order.js";
2
+ export function buildGraph(nodes, edges) {
3
+ const adjacency = new Map();
4
+ for (const node of nodes)
5
+ adjacency.set(node.id, new Set());
6
+ for (const { a, b } of edges) {
7
+ const ofA = adjacency.get(a);
8
+ const ofB = adjacency.get(b);
9
+ if (ofA === undefined || ofB === undefined || a === b)
10
+ continue;
11
+ ofA.add(b);
12
+ ofB.add(a);
13
+ }
14
+ const graph = new Map();
15
+ for (const [id, neighbours] of adjacency)
16
+ graph.set(id, [...neighbours].sort(byCodeUnit));
17
+ return graph;
18
+ }
19
+ /** The distance from `start` to every node within `radius`, the start at zero. */
20
+ export function distancesFrom(graph, start, radius) {
21
+ const distances = new Map([[start, 0]]);
22
+ let frontier = [start];
23
+ for (let distance = 1; distance <= radius; distance += 1) {
24
+ const next = [];
25
+ for (const id of frontier) {
26
+ for (const neighbour of graph.get(id) ?? []) {
27
+ if (distances.has(neighbour))
28
+ continue;
29
+ distances.set(neighbour, distance);
30
+ next.push(neighbour);
31
+ }
32
+ }
33
+ frontier = next;
34
+ }
35
+ return distances;
36
+ }
37
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/domains/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAMvD,MAAM,UAAU,UAAU,CACxB,KAA4B,EAC5B,KAA4B;IAE5B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE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,SAAS,CAAC;oBAAE,SAAS;gBACvC,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;gBACnC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;QACD,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { InferenceConfig } from "@concordance-wiki/core";
2
+ import type { EmergentDomainsOptions } from "./types.js";
3
+ /** `inference.domains` of the configuration; undefined while the key is absent, and the step does not run. */
4
+ export declare function emergentDomainsOptions(inference?: InferenceConfig): EmergentDomainsOptions | undefined;
5
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/domains/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,8GAA8G;AAC9G,wBAAgB,sBAAsB,CACpC,SAAS,CAAC,EAAE,eAAe,GAC1B,sBAAsB,GAAG,SAAS,CASpC"}
@@ -0,0 +1,13 @@
1
+ /** `inference.domains` of the configuration; undefined while the key is absent, and the step does not run. */
2
+ export function emergentDomainsOptions(inference) {
3
+ const domains = inference?.domains;
4
+ if (domains === undefined)
5
+ return undefined;
6
+ return {
7
+ minNeighbours: domains.min_neighbours,
8
+ ...(domains.max_neighbours === undefined ? {} : { maxNeighbours: domains.max_neighbours }),
9
+ radius: domains.radius,
10
+ assign: domains.assign ?? false,
11
+ };
12
+ }
13
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/domains/options.ts"],"names":[],"mappings":"AAIA,8GAA8G;AAC9G,MAAM,UAAU,sBAAsB,CACpC,SAA2B;IAE3B,MAAM,OAAO,GAAG,SAAS,EAAE,OAAO,CAAC;IACnC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO;QACL,aAAa,EAAE,OAAO,CAAC,cAAc;QACrC,GAAG,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;QAC1F,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK;KAChC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { DomainGraph } from "./graph.js";
2
+ import type { Pivot } from "./types.js";
3
+ /** Largest degree first, then the lower identifier. */
4
+ export declare function comparePivots(a: Pivot, b: Pivot): number;
5
+ /** The candidates whose degree reaches `minNeighbours` without exceeding `maxNeighbours`, best first: a hub the whole corpus cites names no domain. */
6
+ export declare function selectPivots(candidates: ReadonlySet<string>, graph: DomainGraph, minNeighbours: number, maxNeighbours?: number): Pivot[];
7
+ //# sourceMappingURL=pivots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pivots.d.ts","sourceRoot":"","sources":["../../src/domains/pivots.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,uDAAuD;AACvD,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,CAExD;AAED,uJAAuJ;AACvJ,wBAAgB,YAAY,CAC1B,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,EAC/B,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,MAAM,EACrB,aAAa,SAA2B,GACvC,KAAK,EAAE,CAYT"}
@@ -0,0 +1,18 @@
1
+ import { byCodeUnit } from "../neighbourhood/order.js";
2
+ /** Largest degree first, then the lower identifier. */
3
+ export function comparePivots(a, b) {
4
+ return b.degree - a.degree || byCodeUnit(a.id, b.id);
5
+ }
6
+ /** The candidates whose degree reaches `minNeighbours` without exceeding `maxNeighbours`, best first: a hub the whole corpus cites names no domain. */
7
+ export function selectPivots(candidates, graph, minNeighbours, maxNeighbours = Number.POSITIVE_INFINITY) {
8
+ const pivots = [];
9
+ for (const [id, neighbours] of graph) {
10
+ if (candidates.has(id) &&
11
+ neighbours.length >= minNeighbours &&
12
+ neighbours.length <= maxNeighbours) {
13
+ pivots.push({ id, degree: neighbours.length });
14
+ }
15
+ }
16
+ return pivots.sort(comparePivots);
17
+ }
18
+ //# sourceMappingURL=pivots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pivots.js","sourceRoot":"","sources":["../../src/domains/pivots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,uDAAuD;AACvD,MAAM,UAAU,aAAa,CAAC,CAAQ,EAAE,CAAQ;IAC9C,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,uJAAuJ;AACvJ,MAAM,UAAU,YAAY,CAC1B,UAA+B,EAC/B,KAAkB,EAClB,aAAqB,EACrB,aAAa,GAAG,MAAM,CAAC,iBAAiB;IAExC,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,KAAK,EAAE,CAAC;QACrC,IACE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,UAAU,CAAC,MAAM,IAAI,aAAa;YAClC,UAAU,CAAC,MAAM,IAAI,aAAa,EAClC,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,45 @@
1
+ /** One entity as the proposal reads it: whether it may become a pivot and whether it may be filed. */
2
+ export interface DomainNode {
3
+ id: string;
4
+ /** True for a term with a note of its own that is neither a stopword nor a rejected term. */
5
+ candidate: boolean;
6
+ /** True for a note no declaration files, the only ones a proposal attaches. */
7
+ attachable: boolean;
8
+ }
9
+ /** An undirected edge of the neighbourhood graph: a typed link or a co-occurrence. */
10
+ export interface DomainEdge {
11
+ a: string;
12
+ b: string;
13
+ }
14
+ export interface EmergentDomainsInput {
15
+ nodes: readonly DomainNode[];
16
+ edges: readonly DomainEdge[];
17
+ }
18
+ export interface EmergentDomainsOptions {
19
+ /** Degree from which a candidate becomes a pivot. */
20
+ minNeighbours: number;
21
+ /** Degree above which a term is a hub, never a pivot; undefined for no bound. */
22
+ maxNeighbours?: number;
23
+ /** Distance, in edges, within which a note belongs to a pivot. */
24
+ radius: number;
25
+ /** Whether the pipeline files the attached notes; the walk itself never reads it. */
26
+ assign: boolean;
27
+ }
28
+ export interface Pivot {
29
+ id: string;
30
+ /** Distinct neighbours in the graph. */
31
+ degree: number;
32
+ }
33
+ /** A note attached to its closest pivot. */
34
+ export interface Attachment {
35
+ id: string;
36
+ pivot: string;
37
+ distance: number;
38
+ }
39
+ export interface EmergentDomains {
40
+ /** By degree, largest first, then by identifier. */
41
+ pivots: Pivot[];
42
+ /** By note identifier. */
43
+ attachments: Attachment[];
44
+ }
45
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/domains/types.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,6FAA6F;IAC7F,SAAS,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,sFAAsF;AACtF,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,0BAA0B;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/domains/types.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -23,4 +23,9 @@ export { mentionLinks, type MentionLinksInput, type MentionLinksResult, type Men
23
23
  export { foldHeading, mappedSection, type MappedSection } from "./mentions/sections.js";
24
24
  export { FALLBACK_RELATION, RELATION_ORIGIN, relationLabel, typeRelations, type RelationLabelOptions, type TypedEntity, type TypeRelationsInput, type TypeRelationsResult, } from "./relations/index.js";
25
25
  export { attachOperations, CONTRACT_REPRESENTATION, importedOperations, MATCH_RUNGS, matchOperations, mergeOperation, OPERATION_AMBIGUOUS, OPERATION_UNMATCHED, operationNotes, redirectLinks, type Ambiguity, type AttachOperationsInput, type AttachOperationsResult, type ImportedOperation, type MatchResult, type MatchRung, type OperationMatch, type OperationNote, } from "./operations/index.js";
26
+ export { proposeEmergentDomains } from "./domains/attach.js";
27
+ export { buildGraph, distancesFrom, type DomainGraph } from "./domains/graph.js";
28
+ export { emergentDomainsOptions } from "./domains/options.js";
29
+ export { comparePivots, selectPivots } from "./domains/pivots.js";
30
+ export type { Attachment, DomainEdge, DomainNode, EmergentDomains, EmergentDomainsInput, EmergentDomainsOptions, Pivot, } from "./domains/types.js";
26
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,yBAAyB,CAA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AAc,EACd,aAAa,EACb,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,GACN,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -16,4 +16,8 @@ export { mentionLinks, } from "./mentions/links.js";
16
16
  export { foldHeading, mappedSection } from "./mentions/sections.js";
17
17
  export { FALLBACK_RELATION, RELATION_ORIGIN, relationLabel, typeRelations, } from "./relations/index.js";
18
18
  export { attachOperations, CONTRACT_REPRESENTATION, importedOperations, MATCH_RUNGS, matchOperations, mergeOperation, OPERATION_AMBIGUOUS, OPERATION_UNMATCHED, operationNotes, redirectLinks, } from "./operations/index.js";
19
+ export { proposeEmergentDomains } from "./domains/attach.js";
20
+ export { buildGraph, distancesFrom } from "./domains/graph.js";
21
+ export { emergentDomainsOptions } from "./domains/options.js";
22
+ export { comparePivots, selectPivots } from "./domains/pivots.js";
19
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,YAAY,EAA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UAAU,EAAE,aAAa,EAAoB,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@concordance-wiki/inference",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Link production, confidence combination, relation typing, bounded neighbourhood, term candidates.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -29,18 +29,18 @@
29
29
  "README.md",
30
30
  "LICENSE"
31
31
  ],
32
- "scripts": {
33
- "typecheck": "tsc -b tsconfig.json"
34
- },
35
32
  "dependencies": {
36
- "@concordance-wiki/core": "workspace:*",
37
- "@concordance-wiki/ingest": "workspace:*",
38
- "@concordance-wiki/profile": "workspace:*"
33
+ "@concordance-wiki/core": "0.3.0",
34
+ "@concordance-wiki/ingest": "0.3.0",
35
+ "@concordance-wiki/profile": "0.3.0"
39
36
  },
40
37
  "devDependencies": {
41
- "@concordance-wiki/nlp": "workspace:*",
42
- "@concordance-wiki/plugin-contract-openapi": "workspace:*",
43
- "@concordance-wiki/plugin-contract-wsdl": "workspace:*",
44
- "@concordance-wiki/typing": "workspace:*"
38
+ "@concordance-wiki/nlp": "0.3.0",
39
+ "@concordance-wiki/plugin-contract-openapi": "0.3.0",
40
+ "@concordance-wiki/plugin-contract-wsdl": "0.3.0",
41
+ "@concordance-wiki/typing": "0.3.0"
42
+ },
43
+ "scripts": {
44
+ "typecheck": "tsc -b tsconfig.json"
45
45
  }
46
- }
46
+ }