glossarist 0.4.41 → 0.4.43

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 (89) hide show
  1. package/package.json +1 -1
  2. package/src/{compiled-format.js → compiled-format.ts} +1 -0
  3. package/src/{concept-collection.js → concept-collection.ts} +1 -0
  4. package/src/{concept-diff.js → concept-diff.ts} +1 -0
  5. package/src/{concept-parser.js → concept-parser.ts} +1 -0
  6. package/src/{concept-reader.js → concept-reader.ts} +1 -0
  7. package/src/{concept-serializer.js → concept-serializer.ts} +1 -0
  8. package/src/{concept-writer.js → concept-writer.ts} +1 -0
  9. package/src/{dataset-asset.js → dataset-asset.ts} +1 -0
  10. package/src/diff/{canonical-json.js → canonical-json.ts} +8 -10
  11. package/src/diff/change.ts +175 -0
  12. package/src/diff/{collection-diff.js → collection-diff.ts} +1 -0
  13. package/src/diff/{concept-diff.js → concept-diff.ts} +1 -0
  14. package/src/diff/{diff-patch.js → diff-patch.ts} +1 -0
  15. package/src/diff/{diff-renderer.js → diff-renderer.ts} +1 -0
  16. package/src/diff/identity.ts +33 -0
  17. package/src/diff/{index.js → index.ts} +1 -0
  18. package/src/diff/list-diff.ts +231 -0
  19. package/src/diff/{similarity.js → similarity.ts} +3 -7
  20. package/src/diff/text-diff.ts +167 -0
  21. package/src/{entity-directory.js → entity-directory.ts} +1 -0
  22. package/src/{errors.js → errors.ts} +1 -0
  23. package/src/{gcr-reader.js → gcr-reader.ts} +1 -0
  24. package/src/{gcr-writer.js → gcr-writer.ts} +1 -0
  25. package/src/{index.js → index.ts} +1 -0
  26. package/src/{managed-concept-collection.js → managed-concept-collection.ts} +1 -0
  27. package/src/migration/{hyperedge-migrator.js → hyperedge-migrator.ts} +1 -0
  28. package/src/rdf/{agents-emitter.js → agents-emitter.ts} +1 -0
  29. package/src/rdf/{bibliography-emitter.js → bibliography-emitter.ts} +1 -0
  30. package/src/rdf/{bnode-id.js → bnode-id.ts} +1 -0
  31. package/src/rdf/{build-activity-emitter.js → build-activity-emitter.ts} +1 -0
  32. package/src/rdf/{curie.js → curie.ts} +1 -0
  33. package/src/rdf/{dataset-emitter.js → dataset-emitter.ts} +1 -0
  34. package/src/rdf/{deterministic-id.js → deterministic-id.ts} +1 -0
  35. package/src/rdf/{document-writer.js → document-writer.ts} +1 -0
  36. package/src/rdf/{gloss-concept.js → gloss-concept.ts} +1 -0
  37. package/src/rdf/{gloss-designation.js → gloss-designation.ts} +1 -0
  38. package/src/rdf/{gloss-detailed-definition.js → gloss-detailed-definition.ts} +1 -0
  39. package/src/rdf/{gloss-generic-hyperedge.js → gloss-generic-hyperedge.ts} +1 -0
  40. package/src/rdf/{gloss-localized-concept.js → gloss-localized-concept.ts} +1 -0
  41. package/src/rdf/{gloss-non-verbal-rep.js → gloss-non-verbal-rep.ts} +1 -0
  42. package/src/rdf/{gloss-partitive-member.js → gloss-partitive-member.ts} +1 -0
  43. package/src/rdf/{gloss-partitive-relation.js → gloss-partitive-relation.ts} +1 -0
  44. package/src/rdf/{gloss-source.js → gloss-source.ts} +1 -0
  45. package/src/rdf/{group-emitter.js → group-emitter.ts} +1 -0
  46. package/src/rdf/{image-variant-emitter.js → image-variant-emitter.ts} +1 -0
  47. package/src/rdf/{index.js → index.ts} +1 -0
  48. package/src/rdf/{normalize-enum.js → normalize-enum.ts} +1 -0
  49. package/src/rdf/{prefixes.js → prefixes.ts} +1 -0
  50. package/src/rdf/{provenance-emitter.js → provenance-emitter.ts} +1 -0
  51. package/src/rdf/{sections-builder.js → sections-builder.ts} +1 -0
  52. package/src/rdf/{shacl-entry.js → shacl-entry.ts} +1 -0
  53. package/src/rdf/{shacl.js → shacl.ts} +1 -0
  54. package/src/rdf/{terms.js → terms.ts} +1 -0
  55. package/src/rdf/{version-emitter.js → version-emitter.ts} +1 -0
  56. package/src/rdf/{vocabulary-emitter.js → vocabulary-emitter.ts} +1 -0
  57. package/src/rdf/{write-turtle-sync.js → write-turtle-sync.ts} +1 -0
  58. package/src/{reference-mention.js → reference-mention.ts} +1 -0
  59. package/src/{reference-resolver.js → reference-resolver.ts} +1 -0
  60. package/src/{render-classification.js → render-classification.ts} +1 -0
  61. package/src/{sort.js → sort.ts} +1 -0
  62. package/src/transforms/{concept-to-gloss.transform.js → concept-to-gloss.transform.ts} +1 -0
  63. package/src/transforms/index.ts +2 -0
  64. package/src/{uuid.js → uuid.ts} +1 -0
  65. package/src/{v1-reader.js → v1-reader.ts} +1 -0
  66. package/src/validators/{asset-index.js → asset-index.ts} +1 -0
  67. package/src/validators/{binary-has-part-redundancy-rule.js → binary-has-part-redundancy-rule.ts} +1 -0
  68. package/src/validators/{concept-validator.js → concept-validator.ts} +1 -0
  69. package/src/validators/{delimiting-coherence-rule.js → delimiting-coherence-rule.ts} +1 -0
  70. package/src/validators/{external-concept-shape-rule.js → external-concept-shape-rule.ts} +1 -0
  71. package/src/validators/{gcr-validator.js → gcr-validator.ts} +1 -0
  72. package/src/validators/{hyperedge-coherence-rule.js → hyperedge-coherence-rule.ts} +1 -0
  73. package/src/validators/{index.js → index.ts} +1 -0
  74. package/src/validators/{partitive-relation-coherence-rule.js → partitive-relation-coherence-rule.ts} +1 -0
  75. package/src/validators/{ref-keys.js → ref-keys.ts} +1 -0
  76. package/src/validators/{register-validator.js → register-validator.ts} +1 -0
  77. package/src/validators/{relationship-type-rule.js → relationship-type-rule.ts} +1 -0
  78. package/src/validators/{sourced-from-locality-rule.js → sourced-from-locality-rule.ts} +1 -0
  79. package/src/validators/{v3-rules.js → v3-rules.ts} +1 -0
  80. package/src/validators/{validation-error.js → validation-error.ts} +1 -0
  81. package/src/validators/{validation-result.js → validation-result.ts} +1 -0
  82. package/src/validators/{validation-rule.js → validation-rule.ts} +1 -0
  83. package/src/diff/change.js +0 -139
  84. package/src/diff/identity.js +0 -22
  85. package/src/diff/list-diff.js +0 -227
  86. package/src/diff/text-diff.js +0 -128
  87. package/src/transforms/index.js +0 -1
  88. /package/src/models/{index.js → index.ts} +0 -0
  89. /package/src/rdf/{predicates.js → predicates.ts} +0 -0
@@ -0,0 +1,167 @@
1
+ import { GlossaristModel } from '../models/base.js';
2
+
3
+ const HUNK_EQUAL = 'equal';
4
+ const HUNK_ADDED = 'added';
5
+ const HUNK_REMOVED = 'removed';
6
+
7
+ export type TextHunkType = typeof HUNK_EQUAL | typeof HUNK_ADDED | typeof HUNK_REMOVED;
8
+
9
+ const TOKEN_RE = /(\s+)|(\S+)/g;
10
+
11
+ export interface TextHunkJson {
12
+ type: TextHunkType;
13
+ text: string;
14
+ }
15
+
16
+ export class TextHunk extends GlossaristModel {
17
+ readonly type: TextHunkType;
18
+ readonly text: string;
19
+
20
+ constructor(data: TextHunkJson = { type: HUNK_EQUAL, text: '' }) {
21
+ super();
22
+ if (![HUNK_EQUAL, HUNK_ADDED, HUNK_REMOVED].includes(data.type)) {
23
+ throw new Error(`TextHunk type must be 'equal', 'added', or 'removed' (got ${data.type})`);
24
+ }
25
+ this.type = data.type;
26
+ this.text = data.text ?? '';
27
+ }
28
+
29
+ override toJSON(): TextHunkJson {
30
+ return { type: this.type, text: this.text };
31
+ }
32
+
33
+ static override fromJSON(data: TextHunkJson): TextHunk {
34
+ return new TextHunk(data);
35
+ }
36
+ }
37
+
38
+ export interface TextDiffJson {
39
+ oldText?: string;
40
+ old_text?: string;
41
+ newText?: string;
42
+ new_text?: string;
43
+ hunks?: ReadonlyArray<TextHunkJson | TextHunk>;
44
+ }
45
+
46
+ export class TextDiff extends GlossaristModel {
47
+ readonly oldText: string;
48
+ readonly newText: string;
49
+ private readonly _hunks: ReadonlyArray<TextHunk>;
50
+
51
+ constructor(data: TextDiffJson = {}) {
52
+ super();
53
+ this.oldText = data.oldText ?? data.old_text ?? '';
54
+ this.newText = data.newText ?? data.new_text ?? '';
55
+ this._hunks = (data.hunks ?? []).map((h) =>
56
+ h instanceof TextHunk ? h : new TextHunk(h),
57
+ );
58
+ }
59
+
60
+ get hunks(): ReadonlyArray<TextHunk> {
61
+ return this._hunks;
62
+ }
63
+
64
+ get hasChanges(): boolean {
65
+ return this._hunks.some((h) => h.type !== HUNK_EQUAL);
66
+ }
67
+
68
+ get addedText(): string {
69
+ return this._hunks
70
+ .filter((h) => h.type === HUNK_ADDED)
71
+ .map((h) => h.text)
72
+ .join('');
73
+ }
74
+
75
+ get removedText(): string {
76
+ return this._hunks
77
+ .filter((h) => h.type === HUNK_REMOVED)
78
+ .map((h) => h.text)
79
+ .join('');
80
+ }
81
+
82
+ override toJSON(): TextDiffJson & { old_text: string; new_text: string; hunks: ReadonlyArray<TextHunkJson> } {
83
+ return {
84
+ old_text: this.oldText,
85
+ new_text: this.newText,
86
+ hunks: this._hunks.map((h) => h.toJSON()),
87
+ };
88
+ }
89
+
90
+ static override fromJSON(data: TextDiffJson): TextDiff {
91
+ return new TextDiff(data);
92
+ }
93
+ }
94
+
95
+ export function diffText(oldText: string | null | undefined, newText: string | null | undefined): TextDiff {
96
+ const oldStr = String(oldText ?? '');
97
+ const newStr = String(newText ?? '');
98
+ const oldTokens = tokenize(oldStr);
99
+ const newTokens = tokenize(newStr);
100
+ const hunks = lcsHunks(oldTokens, newTokens);
101
+ return new TextDiff({ oldText: oldStr, newText: newStr, hunks });
102
+ }
103
+
104
+ function tokenize(text: string): string[] {
105
+ if (text.length === 0) return [];
106
+ return text.match(TOKEN_RE) ?? [];
107
+ }
108
+
109
+ function lcsHunks(a: string[], b: string[]): TextHunk[] {
110
+ const n = a.length;
111
+ const m = b.length;
112
+
113
+ if (n === 0) return m === 0 ? [] : [new TextHunk({ type: HUNK_ADDED, text: b.join('') })];
114
+ if (m === 0) return [new TextHunk({ type: HUNK_REMOVED, text: a.join('') })];
115
+
116
+ const dp = Array.from({ length: n + 1 }, () => new Uint32Array(m + 1));
117
+ for (let i = 1; i <= n; i++) {
118
+ for (let j = 1; j <= m; j++) {
119
+ dp[i]![j]! =
120
+ a[i - 1] === b[j - 1]
121
+ ? dp[i - 1]![j - 1]! + 1
122
+ : Math.max(dp[i - 1]![j]!, dp[i]![j - 1]!);
123
+ }
124
+ }
125
+
126
+ const raw: Array<{ type: TextHunkType; text: string }> = [];
127
+ let i = n;
128
+ let j = m;
129
+ while (i > 0 && j > 0) {
130
+ if (a[i - 1] === b[j - 1]) {
131
+ raw.push({ type: HUNK_EQUAL, text: a[i - 1]! });
132
+ i--; j--;
133
+ } else if ((dp[i - 1]![j] ?? 0) >= (dp[i]![j - 1] ?? 0)) {
134
+ raw.push({ type: HUNK_REMOVED, text: a[i - 1]! });
135
+ i--;
136
+ } else {
137
+ raw.push({ type: HUNK_ADDED, text: b[j - 1]! });
138
+ j--;
139
+ }
140
+ }
141
+ while (i > 0) {
142
+ raw.push({ type: HUNK_REMOVED, text: a[i - 1]! });
143
+ i--;
144
+ }
145
+ while (j > 0) {
146
+ raw.push({ type: HUNK_ADDED, text: b[j - 1]! });
147
+ j--;
148
+ }
149
+ raw.reverse();
150
+
151
+ return coalesce(raw).map((h) => new TextHunk(h));
152
+ }
153
+
154
+ function coalesce(
155
+ raw: ReadonlyArray<{ type: TextHunkType; text: string }>,
156
+ ): Array<{ type: TextHunkType; text: string }> {
157
+ const out: Array<{ type: TextHunkType; text: string }> = [];
158
+ for (const r of raw) {
159
+ const last = out[out.length - 1];
160
+ if (last && last.type === r.type) {
161
+ last.text += r.text;
162
+ } else {
163
+ out.push({ type: r.type, text: r.text });
164
+ }
165
+ }
166
+ return out;
167
+ }
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  const ENTITY_DIRECTORIES = Object.freeze(new Map([
2
3
  ['figure', 'figures'],
3
4
  ['table', 'tables'],
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  /**
2
3
  * Base error for all glossarist errors.
3
4
  */
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import JSZip from 'jszip';
2
3
  import * as yaml from 'js-yaml';
3
4
  import { conceptParser } from './concept-parser.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import JSZip from 'jszip';
2
3
  import { conceptSerializer } from './concept-serializer.js';
3
4
  import { InvalidInputError } from './errors.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  export { naturalSort } from './sort.js';
2
3
  export {
3
4
  diffConcepts,
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { ConceptCollection } from './concept-collection.js';
2
3
  import { readConcepts, readRegister } from './concept-reader.js';
3
4
  import { writeConcepts } from './concept-writer.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // v1 → v2 PartitiveHyperedge migration.
2
3
  //
3
4
  // Pure function: takes a v1 PartitiveHyperedge hash, returns a v2
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Agents emitter — emits foaf:Person / prov:Organization from
2
3
  // contributor declarations. Mirrors concept-browser's agents-emitter.ts.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Bibliography emitter — emits dcterms:BibliographicResource per
2
3
  // bibliography entry. Mirrors concept-browser's bibliography-emitter.ts.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Deterministic blank node ID strategy.
2
3
  //
3
4
  // Single source of truth for bnode IDs across all emitters. Previously
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Build activity emitter — emits prov:Activity per build run.
2
3
  // Mirrors concept-browser's build-activity-emitter.ts.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // CURIE helpers — resolve/compact IRIs against the canonical PREFIXES.
2
3
  //
3
4
  // Single source of truth for CURIE ↔ IRI conversion. Previously
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Dataset emitter — emits dcat:Dataset + skos:ConceptScheme per
2
3
  // register. Mirrors concept-browser's dataset-emitter.ts.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Stable ID helpers for RDF emission. Mirrors glossarist-ruby's
2
3
  // Digest::MD5.hexdigest(content)[0..11] for cross-runtime stability.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Quads → canonical Turtle / N-Triples / JSON-LD document.
2
3
  //
3
4
  // Turtle is produced via N3.Writer. JSON-LD via the `jsonld` package
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Concept → RDF quads. Mirrors glossarist-ruby's `Rdf::GlossConcept`.
2
3
  //
3
4
  // URI shape: `<uriBase>/<registerId>/concept/<conceptId>`.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Designation → RDF quads. Mirrors glossarist-ruby's
2
3
  // `Rdf::GlossDesignation` + the per-subtype classes (GlossExpression,
3
4
  // GlossAbbreviation, etc.). The ontology class for each subtype is
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // DetailedDefinition → RDF quads. Mirrors glossarist-ruby's
2
3
  // `Rdf::GlossDetailedDefinition`. Used for definitions, notes, examples,
3
4
  // and annotations — they all share the same shape (content + optional
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // GenericHyperedge → RDF quads.
2
3
  //
3
4
  // Shape (mirrors gloss-partitive-relation.js, swapping partitive
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // LocalizedConcept → RDF quads. Mirrors glossarist-ruby's
2
3
  // `Rdf::GlossLocalizedConcept` + the `EmitsExtraTriples` hook.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // NonVerbal entity → RDF quads. Mirrors the v3.1.0 concept-model
2
3
  // NonVerbal class hierarchy. Two distinct shapes:
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // PartitiveMember → RDF quads.
2
3
  //
3
4
  // Emits per-member predicates (presence, count, is_delimiting,
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // PartitiveHyperedge → RDF quads.
2
3
  //
3
4
  // Shape (per concept-model ontology, v3.2.0):
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // ConceptSource → RDF quads. Mirrors glossarist-ruby's
2
3
  // `Rdf::GlossConceptSource` + `Rdf::GlossCitation`. Sources are reified
3
4
  // resources linked from their parent (concept or localized concept or
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Group emitter — emits dcat:DatasetSeries (lineage) or dcat:Catalog
2
3
  // (topic/family/collection) for dataset groups. Mirrors concept-browser's
3
4
  // group-emitter.ts.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Image variant emitter — emits foaf:Image per format/language variant
2
3
  // of a dataset figure. Mirrors concept-browser's image-variant-emitter.ts.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Public RDF layer. Mirrors lib/glossarist/rdf/ in glossarist-ruby.
2
3
  export { PRED, PREFIXES, SKOSXL, WELL_KNOWN } from './prefixes.js';
3
4
  export {
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Helpers for normalizing enumeration values that get interpolated into
2
3
  // URIs. Source data may contain compound forms ("preferred/admitted") or
3
4
  // path-like values that must be reduced to a single local name before
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Re-export prefix map and predicate constants generated from the vendored
2
3
  // concept-model JSON-LD context. Downstream code should never duplicate
3
4
  // prefix bindings — always import from here.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Provenance emitter — emits prov:wasGeneratedBy + prov:Activity quads
2
3
  // for any resource that needs build/view-time provenance.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Sections builder — transforms a Quad[] into the ClassInstance[]
2
3
  // shape consumed by Vue UI components (RdfInstanceSection,
3
4
  // RdfInstanceHeader, RdfSourcePanel).
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Node-only SHACL validator entry. Separated from glossarist/rdf so that
2
3
  // browser bundles can import RDF emitters/writers without pulling in
3
4
  // node:fs/promises, node:path, node:url.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // SHACL validator wrapper. Loads vendored concept-model shapes once and
2
3
  // validates any RDFJS Dataset against them. Mirrors the mechanics of
3
4
  // glossarist-ruby's `Glossarist::Validation::ShaclValidator`.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Shared RDF/JS term constructors. Replaces the per-emitter
2
3
  // `const { namedNode, literal, quad } = DataFactory;` pattern that was
3
4
  // repeated across the RDF layer.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Version emitter — emits prov:Entity version chain per dataset.
2
3
  // Mirrors concept-browser's version-emitter.ts.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Vocabulary graph emitter — emits SKOS ConceptSchemes for the
2
3
  // enumeration IRIs that glossarist emits in instance data
3
4
  // (gloss:status/*, gloss:entstatus/*, gloss:norm/*, gloss:srcstatus/*,
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Sync Turtle writer — produces Turtle from RDF/JS Quads without
2
3
  // n3's callback API. Designed for UI use cases (Vue computed, React
3
4
  // render) that need synchronous output.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  /**
2
3
  * Mention parser for {{...}} inline references in concept text.
3
4
  *
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { ConceptRef } from './models/concept-ref.js';
2
3
  import { parseMention } from './reference-mention.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { resolveBibliographyRecord, findNonVerbalEntity } from './reference-resolver.js';
2
3
 
3
4
  export class ReferenceClassifier {
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  const NATURAL_SORT_RE = /(\d+|\D+)/g;
2
3
  const DIGIT_RE = /^\d+$/;
3
4
 
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // ConceptToGlossTransform — JS port of glossarist-ruby's
2
3
  // `Transforms::ConceptToGlossTransform`. Converts a Concept model into
3
4
  // ontology-faithful RDF (Turtle, JSON-LD, N-Triples).
@@ -0,0 +1,2 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
2
+ export { ConceptToGlossTransform } from './concept-to-gloss.transform.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { createHash } from 'crypto';
2
3
 
3
4
  const NAMESPACE_UUID = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import fs from 'fs';
2
3
  import path from 'path';
3
4
  import * as yaml from 'js-yaml';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { DATASET_ASSETS } from '../dataset-asset.js';
2
3
 
3
4
  export class AssetIndex {
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Warns when binary `has_part` / `is_part_of` edges duplicate
2
3
  // PartitiveHyperedge members, or when a concept has many binary
3
4
  // has_part edges that should be consolidated into a PartitiveHyperedge.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { ValidationRule } from './validation-rule.js';
2
3
  import { ValidationResult } from './validation-result.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Validates delimiting coherence across a concept's PartitiveRelations
2
3
  // per ISO 704:2022.
3
4
  //
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Validates ExternalConcept shape (status: external).
2
3
  //
3
4
  // Per TODO.partitive-relation-v2 item 06, an ExternalConcept is a
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import * as yaml from 'js-yaml';
2
3
  import { DATASET_ASSETS } from '../dataset-asset.js';
3
4
  import { ValidationResult } from './validation-result.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Validates hyperedge coherence per ISO 704 / ISO 12620.
2
3
  //
3
4
  // Applies to every AbstractHyperedge subclass (PartitiveHyperedge,
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  export { ValidationError } from './validation-error.js';
2
3
  export { ValidationRule } from './validation-rule.js';
3
4
  export { ValidationResult } from './validation-result.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Deprecated. This rule has been generalized and renamed to
2
3
  // HyperedgeCoherenceRule (see ./hyperedge-coherence-rule.js). The
3
4
  // new rule is type-blind — it validates every AbstractHyperedge
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Shared identity-key helpers for cross-relation validators.
2
3
  //
3
4
  // Extracted from HyperedgeCoherenceRule and
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { ValidationResult } from './validation-result.js';
2
3
 
3
4
  export class RegisterValidator {
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { ValidationRule } from './validation-rule.js';
2
3
  import { RELATIONSHIP_TYPES } from '../models/related-concept.js';
3
4
  import { DESIGNATION_RELATIONSHIP_TYPES } from '../models/designation-relationship.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  // Validates that every ConceptSource#sourced_from Citation includes a
2
3
  // locality. Per concept-model commit 9c065df ("sourced_from citations
3
4
  // must include locality"), a sourced_from entry without a locality is
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { ValidationRule } from './validation-rule.js';
2
3
  import { parseMention } from '../reference-mention.js';
3
4
  import { GraphicalSymbol } from '../models/designation.js';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  export class ValidationError {
2
3
  constructor(path, message, severity = 'error') {
3
4
  this.path = path;
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  import { ValidationError } from './validation-error.js';
2
3
 
3
4
  export class ValidationResult {
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck — TEMPORARY during TS migration. TODO(Phase 2e): remove and type fully.
1
2
  export class ValidationRule {
2
3
  constructor(name, severity = 'error') {
3
4
  this.name = name;