glossarist 0.4.36 → 0.4.38
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/package.json +1 -1
- package/src/models/abstract-hyperedge.ts +164 -0
- package/src/models/bibliography-data.ts +64 -0
- package/src/models/{bibliography-entry.js → bibliography-entry.ts} +18 -4
- package/src/models/concept-system.ts +152 -0
- package/src/models/detailed-definition.ts +92 -0
- package/src/models/generic-hyperedge.ts +72 -0
- package/src/models/generic-member.ts +80 -0
- package/src/models/grammar-info.ts +78 -0
- package/src/models/{hyperedge-index.js → hyperedge-index.ts} +32 -18
- package/src/models/{hyperedge-member.js → hyperedge-member.ts} +38 -26
- package/src/models/{hyperedge-registry.js → hyperedge-registry.ts} +59 -29
- package/src/models/{locality.js → locality.ts} +16 -4
- package/src/models/localized-string.ts +32 -0
- package/src/models/partitive-hyperedge.ts +90 -0
- package/src/models/{partitive-member.js → partitive-member.ts} +18 -17
- package/src/models/{pronunciation.js → pronunciation.ts} +18 -4
- package/src/models/sequential-hyperedge.ts +70 -0
- package/src/models/{sequential-member.js → sequential-member.ts} +6 -3
- package/src/models/abstract-hyperedge.js +0 -119
- package/src/models/bibliography-data.js +0 -48
- package/src/models/concept-system.js +0 -117
- package/src/models/detailed-definition.js +0 -59
- package/src/models/generic-hyperedge.js +0 -55
- package/src/models/generic-member.js +0 -82
- package/src/models/grammar-info.js +0 -40
- package/src/models/localized-string.js +0 -19
- package/src/models/partitive-hyperedge.js +0 -91
- package/src/models/sequential-hyperedge.js +0 -56
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// PartitiveHyperedge — an ISO 704:2022 / ISO 1087-1 / ISO 12620
|
|
2
|
-
// partitive relation connecting a comprehensive concept
|
|
3
|
-
// (superordinate concept partitive) to two or more partitive
|
|
4
|
-
// concepts (subordinate concepts partitive) which fitted together
|
|
5
|
-
// constitute the comprehensive.
|
|
6
|
-
//
|
|
7
|
-
// Extends AbstractHyperedge; the leaf-specific concern is the
|
|
8
|
-
// PartitiveMember type for `members`. The wire-level field name
|
|
9
|
-
// stays `partitives` for v1/v2 backward compat.
|
|
10
|
-
//
|
|
11
|
-
// ISO 704:2022 rake diagram semantics:
|
|
12
|
-
//
|
|
13
|
-
// comprehensive concept
|
|
14
|
-
// ─────────────────────
|
|
15
|
-
// │ partitive (one or more) with per-member multiplicity + optional delimiting
|
|
16
|
-
// ─────────────────────
|
|
17
|
-
//
|
|
18
|
-
// All partitives within one relation are coordinate concepts
|
|
19
|
-
// (ISO 12620): they share the comprehensive AND share the
|
|
20
|
-
// criterion of subdivision.
|
|
21
|
-
//
|
|
22
|
-
// "Delimiting" parts (bold/3x-width line in source diagrams) behave
|
|
23
|
-
// like delimiting characteristics — they distinguish the comprehensive
|
|
24
|
-
// from coordinate concepts. Whether a part is delimiting depends on
|
|
25
|
-
// the concept system, the coordinate concepts, the inheritance
|
|
26
|
-
// principle, and the criterion of subdivision used
|
|
27
|
-
// (ISO 704:2022 §5.5.4.2.1).
|
|
28
|
-
//
|
|
29
|
-
// Distinguished from binary `has_part` / `is_part_of` edges, which
|
|
30
|
-
// express pairwise part-of assertions without completeness,
|
|
31
|
-
// multiplicity, or criterion claims. A single partitive should be
|
|
32
|
-
// expressed as a binary edge, not a PartitiveHyperedge (ISO requires
|
|
33
|
-
// "two or more").
|
|
34
|
-
|
|
35
|
-
import { AbstractHyperedge } from './abstract-hyperedge.js';
|
|
36
|
-
import { PartitiveMember } from './partitive-member.js';
|
|
37
|
-
import { HyperedgeRegistry } from './hyperedge-registry.js';
|
|
38
|
-
|
|
39
|
-
export class PartitiveHyperedge extends AbstractHyperedge {
|
|
40
|
-
// Per-class metadata block — the OCP contract. External systems
|
|
41
|
-
// (parser, serializer, diff, RDF emitter, validators) read from
|
|
42
|
-
// these statics and the HyperedgeRegistry. Adding a new hyperedge
|
|
43
|
-
// type = declaring these fields on a new subclass + registering
|
|
44
|
-
// it. Nothing else in the codebase changes.
|
|
45
|
-
static wireKey = 'partitive_relations';
|
|
46
|
-
static typeTag = 'partitive_relation';
|
|
47
|
-
static rdfType = 'gloss:PartitiveRelation';
|
|
48
|
-
static memberClass = PartitiveMember;
|
|
49
|
-
static v1WireKeys = ['partitive_hyperedges'];
|
|
50
|
-
static kindLabel = 'PART';
|
|
51
|
-
|
|
52
|
-
constructor(data = {}) {
|
|
53
|
-
const members = data?.members ?? data?.partitives;
|
|
54
|
-
super({ ...data, members });
|
|
55
|
-
this.members = members == null
|
|
56
|
-
? this.members
|
|
57
|
-
: (Array.isArray(members)
|
|
58
|
-
? members.map(m =>
|
|
59
|
-
m instanceof PartitiveMember ? m : new PartitiveMember(m))
|
|
60
|
-
: this.members);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
get partitives() { return this.members; }
|
|
64
|
-
|
|
65
|
-
toJSON() {
|
|
66
|
-
const base = super.toJSON();
|
|
67
|
-
const { members, ...rest } = base;
|
|
68
|
-
return { ...rest, partitives: members };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
static identityOf(value) {
|
|
72
|
-
const v = value ?? {};
|
|
73
|
-
const c = v.comprehensive ?? {};
|
|
74
|
-
const partKeys = Array.isArray(v.partitives ?? v.members)
|
|
75
|
-
? (v.partitives ?? v.members).map(p => {
|
|
76
|
-
const r = p?.ref ?? p ?? {};
|
|
77
|
-
return `${r.source ?? ''}:${r.id ?? ''}`;
|
|
78
|
-
}).sort()
|
|
79
|
-
: [];
|
|
80
|
-
return `${c.source ?? ''}:${c.id ?? ''}|${partKeys.join('|')}`;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
static fromJSON(data) {
|
|
84
|
-
const normalized = { ...(data ?? {}), members: data?.partitives ?? data?.members };
|
|
85
|
-
return new PartitiveHyperedge(normalized);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export default PartitiveHyperedge;
|
|
90
|
-
|
|
91
|
-
HyperedgeRegistry.register(PartitiveHyperedge);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// SequentialHyperedge — an ISO 12620 A.6.3 / ISO 704:2022 §5.5.5
|
|
2
|
-
// sequential relation connecting a comprehensive concept to two or
|
|
3
|
-
// more subordinate concepts in an ORDERED sequence (temporal,
|
|
4
|
-
// spatial, causal, developmental).
|
|
5
|
-
//
|
|
6
|
-
// Mirror of PartitiveHyperedge and GenericHyperedge. Member array
|
|
7
|
-
// order IS significant — reversing the array reverses the sequence.
|
|
8
|
-
// Use cases: manufacturing process steps, biological life cycles,
|
|
9
|
-
// software release lifecycles, supply chain stages, geological eras.
|
|
10
|
-
//
|
|
11
|
-
// See docs/design/abstract-nary-relation.md (concept-model repo).
|
|
12
|
-
|
|
13
|
-
import { AbstractHyperedge } from './abstract-hyperedge.js';
|
|
14
|
-
import { SequentialMember } from './sequential-member.js';
|
|
15
|
-
import { HyperedgeRegistry } from './hyperedge-registry.js';
|
|
16
|
-
|
|
17
|
-
export class SequentialHyperedge extends AbstractHyperedge {
|
|
18
|
-
// Per-class metadata block — the OCP contract.
|
|
19
|
-
static wireKey = 'sequential_relations';
|
|
20
|
-
static typeTag = 'sequential_relation';
|
|
21
|
-
static rdfType = 'gloss:SequentialRelation';
|
|
22
|
-
static memberClass = SequentialMember;
|
|
23
|
-
static v1WireKeys = [];
|
|
24
|
-
static kindLabel = 'SEQ';
|
|
25
|
-
|
|
26
|
-
constructor(data = {}) {
|
|
27
|
-
super(data);
|
|
28
|
-
this.members = data?.members == null
|
|
29
|
-
? this.members
|
|
30
|
-
: (Array.isArray(data.members)
|
|
31
|
-
? data.members.map(m =>
|
|
32
|
-
m instanceof SequentialMember ? m : new SequentialMember(m))
|
|
33
|
-
: this.members);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static identityOf(value) {
|
|
37
|
-
const v = value ?? {};
|
|
38
|
-
const c = v.comprehensive ?? {};
|
|
39
|
-
// For sequential, member order IS significant — do NOT sort.
|
|
40
|
-
const memberKeys = Array.isArray(v.members)
|
|
41
|
-
? v.members.map(m => {
|
|
42
|
-
const r = m?.ref ?? m ?? {};
|
|
43
|
-
return `${r.source ?? ''}:${r.id ?? ''}`;
|
|
44
|
-
})
|
|
45
|
-
: [];
|
|
46
|
-
return `${c.source ?? ''}:${c.id ?? ''}|${memberKeys.join('|')}`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static fromJSON(data) {
|
|
50
|
-
return new SequentialHyperedge(data);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default SequentialHyperedge;
|
|
55
|
-
|
|
56
|
-
HyperedgeRegistry.register(SequentialHyperedge);
|