@faubulous/mentor-rdf 0.1.13 → 0.1.15
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/out/rdf/reasoners/owl-reasoner.d.ts +2 -2
- package/out/rdf/reasoners/owl-reasoner.js +30 -30
- package/out/rdf/reasoners/owl-reasoner.js.map +1 -1
- package/out/rdf/reasoners/rdfs-reasoner.d.ts +6 -2
- package/out/rdf/reasoners/rdfs-reasoner.js +55 -41
- package/out/rdf/reasoners/rdfs-reasoner.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,8 +9,8 @@ interface OwlRestriction {
|
|
|
9
9
|
minCardinality?: number;
|
|
10
10
|
maxCardinality?: number;
|
|
11
11
|
qualifiedCardinality?: number;
|
|
12
|
-
onClass?: n3.
|
|
13
|
-
onDataRange?: n3.
|
|
12
|
+
onClass?: n3.NamedNode;
|
|
13
|
+
onDataRange?: n3.NamedNode;
|
|
14
14
|
allValuesFrom?: n3.Term;
|
|
15
15
|
someValuesFrom?: n3.Term;
|
|
16
16
|
}
|
|
@@ -19,9 +19,11 @@ class OwlReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
19
19
|
continue;
|
|
20
20
|
if (r.onDataRange) {
|
|
21
21
|
this.store.addQuad(p, ontologies_1.rdf.type, ontologies_1.owl.DatatypeProperty, this.targetGraph);
|
|
22
|
+
this.store.addQuad(p, ontologies_1.rdfs.range, r.onDataRange, this.targetGraph);
|
|
22
23
|
}
|
|
23
24
|
else if (r.onClass) {
|
|
24
25
|
this.store.addQuad(p, ontologies_1.rdf.type, ontologies_1.owl.ObjectProperty, this.targetGraph);
|
|
26
|
+
this.store.addQuad(p, ontologies_1.rdfs.range, r.onClass, this.targetGraph);
|
|
25
27
|
}
|
|
26
28
|
else if (r.allValuesFrom) {
|
|
27
29
|
this.store.addQuad(p, ontologies_1.rdf.type, ontologies_1.owl.ObjectProperty, this.targetGraph);
|
|
@@ -43,26 +45,23 @@ class OwlReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
43
45
|
// See: https://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules
|
|
44
46
|
switch (p.id) {
|
|
45
47
|
case ontologies_1.rdf.type.id: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.restrictions[s.value] = {};
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
48
|
+
if (o.id == ontologies_1.owl.Restriction.id) {
|
|
49
|
+
this.restrictions[s.value] = {};
|
|
51
50
|
}
|
|
52
|
-
|
|
51
|
+
return;
|
|
53
52
|
}
|
|
54
53
|
case ontologies_1.owl.equivalentClass.id:
|
|
55
54
|
case ontologies_1.owl.complementOf.id:
|
|
56
55
|
case ontologies_1.owl.disjointWith.id: {
|
|
57
|
-
this.
|
|
58
|
-
if (o && !
|
|
59
|
-
this.
|
|
56
|
+
this.assertClass(s);
|
|
57
|
+
if (o && !this.isW3CNode(o)) {
|
|
58
|
+
this.assertClass(o);
|
|
60
59
|
}
|
|
61
60
|
// The opposite is also true.
|
|
62
61
|
if (o.termType == "NamedNode") {
|
|
63
62
|
this.store.addQuad(o, ontologies_1.owl.equivalentClass, s, this.targetGraph);
|
|
64
63
|
}
|
|
65
|
-
|
|
64
|
+
return;
|
|
66
65
|
}
|
|
67
66
|
case ontologies_1.owl.intersectionOf.id: {
|
|
68
67
|
let equivalentSubjects = [...this.store.match(null, ontologies_1.owl.equivalentClass, s)]
|
|
@@ -78,7 +77,7 @@ class OwlReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
78
77
|
this.store.addQuad(es, ontologies_1.rdfs.subClassOf, c, this.targetGraph);
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
|
-
|
|
80
|
+
return;
|
|
82
81
|
}
|
|
83
82
|
case ontologies_1.owl.unionOf.id: {
|
|
84
83
|
let equivalentSubjects = [...this.store.match(null, ontologies_1.owl.equivalentClass, s)]
|
|
@@ -94,19 +93,19 @@ class OwlReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
94
93
|
this.store.addQuad(c, ontologies_1.rdfs.subClassOf, es, this.targetGraph);
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
|
-
|
|
96
|
+
return;
|
|
98
97
|
}
|
|
99
98
|
case ontologies_1.owl.onClass.id: {
|
|
100
99
|
if (o.termType == "NamedNode") {
|
|
101
|
-
this.
|
|
100
|
+
this.assertClass(o);
|
|
102
101
|
}
|
|
103
|
-
|
|
102
|
+
return;
|
|
104
103
|
}
|
|
105
104
|
case ontologies_1.owl.onDataRange.id: {
|
|
106
105
|
if (o.termType == "NamedNode") {
|
|
107
106
|
this.store.addQuad(o, ontologies_1.rdf.type, ontologies_1.rdfs.Datatype, this.targetGraph);
|
|
108
107
|
}
|
|
109
|
-
|
|
108
|
+
return;
|
|
110
109
|
}
|
|
111
110
|
// Note:
|
|
112
111
|
// e.g. Gist also uses these on xsd:string, so inferring that this is a
|
|
@@ -116,12 +115,14 @@ class OwlReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
116
115
|
// if (o.termType == "NamedNode") {
|
|
117
116
|
// this.store.addQuad(o, rdf.type, rdfs.Class, this.targetGraph);
|
|
118
117
|
// }
|
|
119
|
-
//
|
|
118
|
+
//
|
|
119
|
+
// return;
|
|
120
120
|
// }
|
|
121
121
|
// case owl.someValuesFrom.id: {
|
|
122
122
|
// if (o.termType == "NamedNode") {
|
|
123
123
|
// this.store.addQuad(o, rdf.type, rdfs.Class, this.targetGraph);
|
|
124
124
|
// }
|
|
125
|
+
//
|
|
125
126
|
// break;
|
|
126
127
|
// }
|
|
127
128
|
}
|
|
@@ -136,44 +137,44 @@ class OwlReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
136
137
|
}
|
|
137
138
|
switch (p.id) {
|
|
138
139
|
case ontologies_1.owl.onProperty.id: {
|
|
139
|
-
this.
|
|
140
|
+
this.assertProperty(o);
|
|
140
141
|
if (this.restrictions[s.value] && o.termType == "NamedNode") {
|
|
141
142
|
this.restrictions[s.value].onProperty = o;
|
|
142
143
|
}
|
|
143
|
-
|
|
144
|
+
return;
|
|
144
145
|
}
|
|
145
146
|
case ontologies_1.owl.onClass.id: {
|
|
146
|
-
if (this.restrictions[s.value]) {
|
|
147
|
+
if (this.restrictions[s.value] && o.termType == "NamedNode") {
|
|
147
148
|
this.restrictions[s.value].onClass = o;
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
+
return;
|
|
150
151
|
}
|
|
151
152
|
case ontologies_1.owl.onDataRange.id: {
|
|
152
|
-
if (this.restrictions[s.value]) {
|
|
153
|
+
if (this.restrictions[s.value] && o.termType == "NamedNode") {
|
|
153
154
|
this.restrictions[s.value].onDataRange = o;
|
|
154
155
|
}
|
|
155
|
-
|
|
156
|
+
return;
|
|
156
157
|
}
|
|
157
158
|
case ontologies_1.owl.allValuesFrom.id: {
|
|
158
159
|
if (this.restrictions[s.value]) {
|
|
159
160
|
this.restrictions[s.value].allValuesFrom = o;
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
+
return;
|
|
162
163
|
}
|
|
163
164
|
case ontologies_1.owl.someValuesFrom.id: {
|
|
164
165
|
if (this.restrictions[s.value]) {
|
|
165
166
|
this.restrictions[s.value].someValuesFrom = o;
|
|
166
167
|
}
|
|
167
|
-
|
|
168
|
+
return;
|
|
168
169
|
}
|
|
169
170
|
case ontologies_1.owl.equivalentProperty.id: {
|
|
170
|
-
this.
|
|
171
|
-
this.
|
|
171
|
+
this.assertProperty(s);
|
|
172
|
+
this.assertProperty(o);
|
|
172
173
|
// The opposite is also true.
|
|
173
174
|
if (o.termType == "NamedNode") {
|
|
174
175
|
this.store.addQuad(o, ontologies_1.owl.equivalentProperty, s, this.targetGraph);
|
|
175
176
|
}
|
|
176
|
-
|
|
177
|
+
return;
|
|
177
178
|
}
|
|
178
179
|
case ontologies_1.rdf.type.id: {
|
|
179
180
|
switch (o.id) {
|
|
@@ -189,11 +190,10 @@ class OwlReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
189
190
|
case ontologies_1.owl.ReflexiveProperty.id:
|
|
190
191
|
case ontologies_1.owl.SymmetricProperty.id:
|
|
191
192
|
case ontologies_1.owl.TransitiveProperty.id: {
|
|
192
|
-
this.
|
|
193
|
-
break;
|
|
193
|
+
this.assertProperty(s);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
return;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owl-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/owl-reasoner.ts"],"names":[],"mappings":";;;AACA,iDAAkD;AAClD,mDAA+C;AAiB/C;;GAEG;AACH,MAAa,WAAY,SAAQ,4BAAY;IAGzC;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IAES,cAAc;QACpB,KAAK,CAAC,cAAc,EAAE,CAAC;QAEvB,KAAK,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;YAC5C,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC;YAEvB,IAAI,CAAC,CAAC;gBAAE,SAAS;YAEjB,IAAI,CAAC,CAAC,WAAW,EAAE;gBACf,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,gBAAG,CAAC,IAAI,EAAE,gBAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"owl-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/owl-reasoner.ts"],"names":[],"mappings":";;;AACA,iDAAkD;AAClD,mDAA+C;AAiB/C;;GAEG;AACH,MAAa,WAAY,SAAQ,4BAAY;IAGzC;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,C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AAC,EAAE,CAAC;oBAChC,KAAK,gBAAG,CAAC,cAAc,CAAC,EAAE,CAAC;oBAC3B,KAAK,gBAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;oBAC7B,KAAK,gBAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBAC9B,KAAK,gBAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBAC9B,KAAK,gBAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;wBAC5B,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;qBAC1B;iBACJ;gBAED,OAAO;aACV;SACJ;IACL,CAAC;CACJ;AAlOD,kCAkOC"}
|
|
@@ -7,12 +7,16 @@ export declare class RdfsReasoner implements IReasoner {
|
|
|
7
7
|
protected store: n3.Store;
|
|
8
8
|
sourceGraph: n3.Quad_Graph | undefined;
|
|
9
9
|
targetGraph: n3.Quad_Graph | undefined;
|
|
10
|
-
|
|
10
|
+
protected classes: Set<n3.Term>;
|
|
11
|
+
protected properties: Set<n3.Term>;
|
|
12
|
+
protected invididuals: Set<n3.NamedNode>;
|
|
11
13
|
expand(store: n3.Store, sourceGraph: string | n3.Quad_Graph, targetGraph: string | n3.Quad_Graph): n3.Store;
|
|
12
14
|
protected getGraphNode(graph: string | n3.Quad_Graph): n3.Quad_Graph;
|
|
15
|
+
protected isW3CNode(term: n3.Term): boolean;
|
|
13
16
|
protected beforeInference(): void;
|
|
14
17
|
protected afterInference(): void;
|
|
18
|
+
protected assertClass(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
15
19
|
protected inferClassAxioms(lists: Record<string, n3.Term[]>, quad: n3.Quad): void;
|
|
20
|
+
protected assertProperty(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
16
21
|
protected inferPropertyAxioms(lists: Record<string, n3.Term[]>, quad: n3.Quad): void;
|
|
17
|
-
protected inferNamedIndividualAxioms(lists: Record<string, n3.Term[]>, quad: n3.Quad): void;
|
|
18
22
|
}
|
|
@@ -10,21 +10,35 @@ const ontologies_1 = require("../../ontologies");
|
|
|
10
10
|
class RdfsReasoner {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.store = new n3.Store();
|
|
13
|
+
this.classes = new Set();
|
|
14
|
+
this.properties = new Set();
|
|
15
|
+
this.invididuals = new Set();
|
|
13
16
|
}
|
|
14
17
|
expand(store, sourceGraph, targetGraph) {
|
|
15
18
|
if (!this.store || !sourceGraph || !targetGraph) {
|
|
16
19
|
return store;
|
|
17
20
|
}
|
|
21
|
+
this.classes.clear();
|
|
22
|
+
this.properties.clear();
|
|
23
|
+
this.invididuals.clear();
|
|
18
24
|
this.store = store;
|
|
19
25
|
this.sourceGraph = this.getGraphNode(sourceGraph);
|
|
20
26
|
this.targetGraph = this.getGraphNode(targetGraph);
|
|
21
27
|
this.beforeInference();
|
|
22
28
|
const lists = store.extractLists();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
for (let quad of store.match(null, null, null, this.sourceGraph)) {
|
|
30
|
+
let q = quad;
|
|
31
|
+
// Treat all named nodes with rdf:type definitions as potential individuals.
|
|
32
|
+
if (q.predicate.equals(ontologies_1.rdf.type) && q.subject.termType == "NamedNode") {
|
|
33
|
+
this.invididuals.add(q.subject);
|
|
34
|
+
}
|
|
35
|
+
this.inferClassAxioms(lists, quad);
|
|
36
|
+
this.inferPropertyAxioms(lists, quad);
|
|
37
|
+
}
|
|
38
|
+
// After all axioms have been inferred, add the inferred individuals to the graph.
|
|
39
|
+
const individuals = [...this.invididuals].filter(x => !this.classes.has(x) && !this.properties.has(x));
|
|
40
|
+
for (let individual of individuals) {
|
|
41
|
+
this.store.addQuad(individual, ontologies_1.rdf.type, ontologies_1.owl.NamedIndividual, this.targetGraph);
|
|
28
42
|
}
|
|
29
43
|
this.afterInference();
|
|
30
44
|
return store;
|
|
@@ -37,8 +51,15 @@ class RdfsReasoner {
|
|
|
37
51
|
return graph;
|
|
38
52
|
}
|
|
39
53
|
}
|
|
54
|
+
isW3CNode(term) {
|
|
55
|
+
return term.value.startsWith("http://www.w3.org");
|
|
56
|
+
}
|
|
40
57
|
beforeInference() { }
|
|
41
58
|
afterInference() { }
|
|
59
|
+
assertClass(subject) {
|
|
60
|
+
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
|
|
61
|
+
this.classes.add(subject);
|
|
62
|
+
}
|
|
42
63
|
inferClassAxioms(lists, quad) {
|
|
43
64
|
let s = quad.subject;
|
|
44
65
|
let p = quad.predicate;
|
|
@@ -48,18 +69,22 @@ class RdfsReasoner {
|
|
|
48
69
|
}
|
|
49
70
|
switch (p.id) {
|
|
50
71
|
case ontologies_1.rdf.type.id: {
|
|
51
|
-
if (o.equals(ontologies_1.
|
|
52
|
-
|
|
72
|
+
if (o.equals(ontologies_1.rdfs.Class)) {
|
|
73
|
+
// No need to infer the class type, as it is already asserted.
|
|
74
|
+
this.classes.add(s);
|
|
75
|
+
}
|
|
76
|
+
else if (o.equals(ontologies_1.owl.Class)) {
|
|
77
|
+
this.assertClass(s);
|
|
53
78
|
}
|
|
54
|
-
else if (!
|
|
55
|
-
this.
|
|
79
|
+
else if (!this.isW3CNode(o)) {
|
|
80
|
+
this.assertClass(o);
|
|
56
81
|
}
|
|
57
|
-
|
|
82
|
+
return;
|
|
58
83
|
}
|
|
59
84
|
case ontologies_1.rdfs.subClassOf.id: {
|
|
60
|
-
this.
|
|
61
|
-
if (!
|
|
62
|
-
this.
|
|
85
|
+
this.assertClass(s);
|
|
86
|
+
if (!this.isW3CNode(o)) {
|
|
87
|
+
this.assertClass(o);
|
|
63
88
|
}
|
|
64
89
|
else if (o.equals(ontologies_1.rdfs.Resource)) {
|
|
65
90
|
this.store.addQuad(ontologies_1.rdfs.Resource, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
|
|
@@ -76,17 +101,21 @@ class RdfsReasoner {
|
|
|
76
101
|
this.store.addQuad(ontologies_1.owl.Class, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
|
|
77
102
|
this.store.addQuad(ontologies_1.owl.Class, ontologies_1.rdfs.subClassOf, ontologies_1.rdfs.Class, this.targetGraph);
|
|
78
103
|
}
|
|
79
|
-
|
|
104
|
+
return;
|
|
80
105
|
}
|
|
81
106
|
case ontologies_1.rdfs.range.id:
|
|
82
107
|
case ontologies_1.rdfs.domain.id: {
|
|
83
|
-
if (!
|
|
84
|
-
this.
|
|
108
|
+
if (!this.isW3CNode(o)) {
|
|
109
|
+
this.assertClass(o);
|
|
85
110
|
}
|
|
86
|
-
|
|
111
|
+
return;
|
|
87
112
|
}
|
|
88
113
|
}
|
|
89
114
|
}
|
|
115
|
+
assertProperty(subject) {
|
|
116
|
+
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.rdf.Property, this.targetGraph);
|
|
117
|
+
this.properties.add(subject);
|
|
118
|
+
}
|
|
90
119
|
inferPropertyAxioms(lists, quad) {
|
|
91
120
|
let s = quad.subject;
|
|
92
121
|
let p = quad.predicate;
|
|
@@ -94,33 +123,18 @@ class RdfsReasoner {
|
|
|
94
123
|
if (!o) {
|
|
95
124
|
return;
|
|
96
125
|
}
|
|
97
|
-
switch (p.id) {
|
|
98
|
-
case ontologies_1.rdfs.range.id:
|
|
99
|
-
case ontologies_1.rdfs.domain.id: {
|
|
100
|
-
this.store.addQuad(s, ontologies_1.rdf.type, ontologies_1.rdf.Property, this.targetGraph);
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
inferNamedIndividualAxioms(lists, quad) {
|
|
106
|
-
let s = quad.subject;
|
|
107
|
-
let p = quad.predicate;
|
|
108
|
-
let o = quad.object.termType != "Literal" ? quad.object : undefined;
|
|
109
|
-
// Instances of rdfs:Class are not individuals.
|
|
110
|
-
if (!o || o.equals(ontologies_1.rdfs.Class) || o.equals(ontologies_1.owl.Class)) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
126
|
switch (p.id) {
|
|
114
127
|
case ontologies_1.rdf.type.id: {
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
for (let q of this.store.match(o, ontologies_1.rdf.type, ontologies_1.rdfs.Class)) {
|
|
120
|
-
// Instances of rdfs:Class that are not classes themselves are individuals.
|
|
121
|
-
this.store.addQuad(s, ontologies_1.rdf.type, ontologies_1.owl.NamedIndividual, this.targetGraph);
|
|
122
|
-
break;
|
|
128
|
+
if (o.equals(ontologies_1.rdf.Property)) {
|
|
129
|
+
// No need to infer the property type, as it is already asserted.
|
|
130
|
+
this.properties.add(s);
|
|
123
131
|
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
case ontologies_1.rdfs.range.id:
|
|
135
|
+
case ontologies_1.rdfs.domain.id: {
|
|
136
|
+
this.assertProperty(s);
|
|
137
|
+
return;
|
|
124
138
|
}
|
|
125
139
|
}
|
|
126
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rdfs-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/rdfs-reasoner.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,iDAAkD;AAGlD;;GAEG;AACH,MAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"rdfs-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/rdfs-reasoner.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,iDAAkD;AAGlD;;GAEG;AACH,MAAa,YAAY;IAAzB;QACc,UAAK,GAAa,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;QAMjC,YAAO,GAAiB,IAAI,GAAG,EAAE,CAAC;QAElC,eAAU,GAAiB,IAAI,GAAG,EAAE,CAAC;QAErC,gBAAW,GAAsB,IAAI,GAAG,EAAE,CAAC;IAmJzD,CAAC;IAjJU,MAAM,CAAC,KAAe,EAAE,WAAmC,EAAE,WAAmC;QACnG,I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