@faubulous/mentor-rdf 0.2.16 → 0.2.17
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/ontologies/skos.d.ts +4 -4
- package/out/ontologies/skos.js +4 -4
- package/out/ontologies/skos.js.map +1 -1
- package/out/rdf/class-repository.d.ts +8 -8
- package/out/rdf/class-repository.js +10 -10
- package/out/rdf/class-repository.js.map +1 -1
- package/out/rdf/concept-repository.d.ts +66 -0
- package/out/rdf/concept-repository.js +160 -0
- package/out/rdf/concept-repository.js.map +1 -0
- package/out/rdf/index.d.ts +1 -2
- package/out/rdf/index.js +1 -2
- package/out/rdf/index.js.map +1 -1
- package/out/rdf/reasoners/rdfs-reasoner.js.map +1 -1
- package/out/rdf/tests/helpers.d.ts +0 -18
- package/out/rdf/tests/helpers.js +1 -29
- package/out/rdf/tests/helpers.js.map +1 -1
- package/out/rdf/tests/vocabularies/emmo.d.ts +5521 -0
- package/out/rdf/tests/vocabularies/emmo.js +5526 -0
- package/out/rdf/tests/vocabularies/emmo.js.map +1 -0
- package/out/rdf/tests/vocabularies/fibo-agents.d.ts +13 -0
- package/out/rdf/tests/vocabularies/fibo-agents.js +18 -0
- package/out/rdf/tests/vocabularies/fibo-agents.js.map +1 -0
- package/out/rdf/tests/vocabularies/fibo-organization.d.ts +65 -0
- package/out/rdf/tests/vocabularies/fibo-organization.js +70 -0
- package/out/rdf/tests/vocabularies/fibo-organization.js.map +1 -0
- package/out/rdf/tests/vocabularies/gist.d.ts +1067 -0
- package/out/rdf/tests/vocabularies/gist.js +1072 -0
- package/out/rdf/tests/vocabularies/gist.js.map +1 -0
- package/out/rdf/tests/vocabularies/index.d.ts +10 -0
- package/out/rdf/tests/vocabularies/index.js +34 -0
- package/out/rdf/tests/vocabularies/index.js.map +1 -0
- package/out/rdf/tests/vocabularies/lob.d.ts +5665 -0
- package/out/rdf/tests/vocabularies/lob.js +5670 -0
- package/out/rdf/tests/vocabularies/lob.js.map +1 -0
- package/out/rdf/tests/vocabularies/owl.d.ts +313 -0
- package/out/rdf/tests/vocabularies/owl.js +318 -0
- package/out/rdf/tests/vocabularies/owl.js.map +1 -0
- package/out/rdf/tests/vocabularies/schema-nq.d.ts +12075 -0
- package/out/rdf/tests/vocabularies/schema-nq.js +12080 -0
- package/out/rdf/tests/vocabularies/schema-nq.js.map +1 -0
- package/out/rdf/tests/vocabularies/schema-nt.d.ts +12075 -0
- package/out/rdf/tests/vocabularies/schema-nt.js +12080 -0
- package/out/rdf/tests/vocabularies/schema-nt.js.map +1 -0
- package/out/rdf/tests/vocabularies/schema.d.ts +12075 -0
- package/out/rdf/tests/vocabularies/schema.js +12080 -0
- package/out/rdf/tests/vocabularies/schema.js.map +1 -0
- package/out/rdf/tests/vocabularies/skos.d.ts +135 -0
- package/out/rdf/tests/vocabularies/skos.js +140 -0
- package/out/rdf/tests/vocabularies/skos.js.map +1 -0
- package/out/rdf/vocabulary-generator.js +14 -8
- package/out/rdf/vocabulary-generator.js.map +1 -1
- package/out/rdf/vocabulary-repository.d.ts +37 -0
- package/out/rdf/vocabulary-repository.js +81 -0
- package/out/rdf/vocabulary-repository.js.map +1 -0
- package/package.json +1 -1
package/out/ontologies/skos.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const SKOS: {
|
|
|
15
15
|
broadMatch: string;
|
|
16
16
|
/** Relates a concept to a concept that is more general in meaning. */
|
|
17
17
|
broader: string;
|
|
18
|
-
/** skos:broaderTransitive is
|
|
18
|
+
/** By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
19
19
|
broaderTransitive: string;
|
|
20
20
|
/** A note about a modification to a concept. */
|
|
21
21
|
changeNote: string;
|
|
@@ -47,7 +47,7 @@ export declare const SKOS: {
|
|
|
47
47
|
narrowMatch: string;
|
|
48
48
|
/** Relates a concept to a concept that is more specific in meaning. */
|
|
49
49
|
narrower: string;
|
|
50
|
-
/** skos:narrowerTransitive is
|
|
50
|
+
/** By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
51
51
|
narrowerTransitive: string;
|
|
52
52
|
/** A notation, also known as classification code, is a string of characters such as "T58.5" or "303.4833" used to uniquely identify a concept within the scope of a given concept scheme. */
|
|
53
53
|
notation: string;
|
|
@@ -82,7 +82,7 @@ export declare const skos: {
|
|
|
82
82
|
broadMatch: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#broadMatch">;
|
|
83
83
|
/** Relates a concept to a concept that is more general in meaning. */
|
|
84
84
|
broader: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#broader">;
|
|
85
|
-
/** skos:broaderTransitive is
|
|
85
|
+
/** By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
86
86
|
broaderTransitive: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#broaderTransitive">;
|
|
87
87
|
/** A note about a modification to a concept. */
|
|
88
88
|
changeNote: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#changeNote">;
|
|
@@ -114,7 +114,7 @@ export declare const skos: {
|
|
|
114
114
|
narrowMatch: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#narrowMatch">;
|
|
115
115
|
/** Relates a concept to a concept that is more specific in meaning. */
|
|
116
116
|
narrower: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#narrower">;
|
|
117
|
-
/** skos:narrowerTransitive is
|
|
117
|
+
/** By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
118
118
|
narrowerTransitive: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#narrowerTransitive">;
|
|
119
119
|
/** A notation, also known as classification code, is a string of characters such as "T58.5" or "303.4833" used to uniquely identify a concept within the scope of a given concept scheme. */
|
|
120
120
|
notation: n3.NamedNode<"http://www.w3.org/2004/02/skos/core#notation">;
|
package/out/ontologies/skos.js
CHANGED
|
@@ -19,7 +19,7 @@ exports.SKOS = {
|
|
|
19
19
|
'broadMatch': 'http://www.w3.org/2004/02/skos/core#broadMatch',
|
|
20
20
|
/** Relates a concept to a concept that is more general in meaning. */
|
|
21
21
|
'broader': 'http://www.w3.org/2004/02/skos/core#broader',
|
|
22
|
-
/** skos:broaderTransitive is
|
|
22
|
+
/** By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
23
23
|
'broaderTransitive': 'http://www.w3.org/2004/02/skos/core#broaderTransitive',
|
|
24
24
|
/** A note about a modification to a concept. */
|
|
25
25
|
'changeNote': 'http://www.w3.org/2004/02/skos/core#changeNote',
|
|
@@ -51,7 +51,7 @@ exports.SKOS = {
|
|
|
51
51
|
'narrowMatch': 'http://www.w3.org/2004/02/skos/core#narrowMatch',
|
|
52
52
|
/** Relates a concept to a concept that is more specific in meaning. */
|
|
53
53
|
'narrower': 'http://www.w3.org/2004/02/skos/core#narrower',
|
|
54
|
-
/** skos:narrowerTransitive is
|
|
54
|
+
/** By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
55
55
|
'narrowerTransitive': 'http://www.w3.org/2004/02/skos/core#narrowerTransitive',
|
|
56
56
|
/** A notation, also known as classification code, is a string of characters such as "T58.5" or "303.4833" used to uniquely identify a concept within the scope of a given concept scheme. */
|
|
57
57
|
'notation': 'http://www.w3.org/2004/02/skos/core#notation',
|
|
@@ -86,7 +86,7 @@ exports.skos = {
|
|
|
86
86
|
'broadMatch': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#broadMatch'),
|
|
87
87
|
/** Relates a concept to a concept that is more general in meaning. */
|
|
88
88
|
'broader': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#broader'),
|
|
89
|
-
/** skos:broaderTransitive is
|
|
89
|
+
/** By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
90
90
|
'broaderTransitive': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#broaderTransitive'),
|
|
91
91
|
/** A note about a modification to a concept. */
|
|
92
92
|
'changeNote': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#changeNote'),
|
|
@@ -118,7 +118,7 @@ exports.skos = {
|
|
|
118
118
|
'narrowMatch': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#narrowMatch'),
|
|
119
119
|
/** Relates a concept to a concept that is more specific in meaning. */
|
|
120
120
|
'narrower': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#narrower'),
|
|
121
|
-
/** skos:narrowerTransitive is
|
|
121
|
+
/** By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application. */
|
|
122
122
|
'narrowerTransitive': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#narrowerTransitive'),
|
|
123
123
|
/** A notation, also known as classification code, is a string of characters such as "T58.5" or "303.4833" used to uniquely identify a concept within the scope of a given concept scheme. */
|
|
124
124
|
'notation': new n3.NamedNode('http://www.w3.org/2004/02/skos/core#notation'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skos.js","sourceRoot":"","sources":["../../src/ontologies/skos.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AAEZ,QAAA,IAAI,GAAG;IACnB,MAAM,EAAE,qCAAqC;IAC7C,2CAA2C;IAC3C,YAAY,EAAE,gDAAgD;IAC9D,4CAA4C;IAC5C,SAAS,EAA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CAAC,wDAAwD,CAAC;IAChG,6LAA6L;IAC7L,UAAU,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,8CAA8C,CAAC;IAC5E,uCAAuC;IACvC,MAAM,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,0CAA0C,CAAC;IACpE,uEAAuE;IACvE,WAAW,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,+CAA+C,CAAC;IAC9E,+FAA+F;IAC/F,SAAS,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,6CAA6C,CAAC;IAC1E,oIAAoI;IACpI,cAAc,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,kDAAkD,CAAC;IACpF,4EAA4E;IAC5E,WAAW,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,+CAA+C,CAAC;IAC9E,uDAAuD;IACvD,kBAAkB,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,sDAAsD,CAAC;IAC5F,iFAAiF;IACjF,cAAc,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,kDAAkD,CAAC;CACpF,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Store } from "./store";
|
|
2
|
-
import {
|
|
2
|
+
import { ConceptRepository } from "./concept-repository";
|
|
3
3
|
interface ClassRetrievalOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Indicate if classes what are not defined in the ontology should be included when retrieving classes (default true).
|
|
@@ -9,7 +9,7 @@ interface ClassRetrievalOptions {
|
|
|
9
9
|
/**
|
|
10
10
|
* A repository for retrieving classes from graphs.
|
|
11
11
|
*/
|
|
12
|
-
export declare class ClassRepository extends
|
|
12
|
+
export declare class ClassRepository extends ConceptRepository {
|
|
13
13
|
constructor(store: Store);
|
|
14
14
|
private _skip;
|
|
15
15
|
/**
|
|
@@ -23,6 +23,12 @@ export declare class ClassRepository extends ResourceRepository {
|
|
|
23
23
|
* @returns An array of super classes of the given class, an empty array if the class has no super classes.
|
|
24
24
|
*/
|
|
25
25
|
getSuperClasses(graphUris: string | string[] | undefined, subjectUri: string, options?: ClassRetrievalOptions): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Get the first discovered path from a given class to a root class.
|
|
28
|
+
* @param subjectUri URI of a class.
|
|
29
|
+
* @returns A string array containing the first path that is found from the given class to a root class.
|
|
30
|
+
*/
|
|
31
|
+
getRootClassPath(graphUris: string | string[] | undefined, subjectUri: string, options?: ClassRetrievalOptions): string[];
|
|
26
32
|
/**
|
|
27
33
|
* Recursively find the first path from a given class to a root class.
|
|
28
34
|
* @param subjectUri URI of a class.
|
|
@@ -31,12 +37,6 @@ export declare class ClassRepository extends ResourceRepository {
|
|
|
31
37
|
* @returns The first path that is found from the given class to a root class.
|
|
32
38
|
*/
|
|
33
39
|
private _getRootClassPath;
|
|
34
|
-
/**
|
|
35
|
-
* Get the first discovered path from a given class to a root class.
|
|
36
|
-
* @param subjectUri URI of a class.
|
|
37
|
-
* @returns A string array containing the first path that is found from the given class to a root class.
|
|
38
|
-
*/
|
|
39
|
-
getRootClassPath(graphUris: string | string[] | undefined, subjectUri: string, options?: ClassRetrievalOptions): string[];
|
|
40
40
|
/**
|
|
41
41
|
* Indicate if there are sub classes of a given class.
|
|
42
42
|
* @param subjectUri URI of a class.
|
|
@@ -4,11 +4,11 @@ exports.ClassRepository = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const n3 = tslib_1.__importStar(require("n3"));
|
|
6
6
|
const ontologies_1 = require("../ontologies");
|
|
7
|
-
const
|
|
7
|
+
const concept_repository_1 = require("./concept-repository");
|
|
8
8
|
/**
|
|
9
9
|
* A repository for retrieving classes from graphs.
|
|
10
10
|
*/
|
|
11
|
-
class ClassRepository extends
|
|
11
|
+
class ClassRepository extends concept_repository_1.ConceptRepository {
|
|
12
12
|
constructor(store) { super(store); }
|
|
13
13
|
_skip(graphUris, node, options) {
|
|
14
14
|
if (node.termType != "NamedNode") {
|
|
@@ -51,6 +51,14 @@ class ClassRepository extends resource_repository_1.ResourceRepository {
|
|
|
51
51
|
}
|
|
52
52
|
return Array.from(result);
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Get the first discovered path from a given class to a root class.
|
|
56
|
+
* @param subjectUri URI of a class.
|
|
57
|
+
* @returns A string array containing the first path that is found from the given class to a root class.
|
|
58
|
+
*/
|
|
59
|
+
getRootClassPath(graphUris, subjectUri, options) {
|
|
60
|
+
return this._getRootClassPath(graphUris, subjectUri, [], new Set(), options);
|
|
61
|
+
}
|
|
54
62
|
/**
|
|
55
63
|
* Recursively find the first path from a given class to a root class.
|
|
56
64
|
* @param subjectUri URI of a class.
|
|
@@ -65,14 +73,6 @@ class ClassRepository extends resource_repository_1.ResourceRepository {
|
|
|
65
73
|
}
|
|
66
74
|
return path;
|
|
67
75
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Get the first discovered path from a given class to a root class.
|
|
70
|
-
* @param subjectUri URI of a class.
|
|
71
|
-
* @returns A string array containing the first path that is found from the given class to a root class.
|
|
72
|
-
*/
|
|
73
|
-
getRootClassPath(graphUris, subjectUri, options) {
|
|
74
|
-
return this._getRootClassPath(graphUris, subjectUri, [], new Set(), options);
|
|
75
|
-
}
|
|
76
76
|
/**
|
|
77
77
|
* Indicate if there are sub classes of a given class.
|
|
78
78
|
* @param subjectUri URI of a class.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-repository.js","sourceRoot":"","sources":["../../src/rdf/class-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AAEzB,8CAA+C;AAE/C
|
|
1
|
+
{"version":3,"file":"class-repository.js","sourceRoot":"","sources":["../../src/rdf/class-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AAEzB,8CAA+C;AAE/C,6DAAyD;AASzD;;GAEG;AACH,MAAa,eAAgB,SAAQ,sCAAiB;IAClD,YAAY,KAAY,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,KAAK,CAAC,SAAwC,EAAE,IAAw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|
|
2
|
+
export declare class ConceptRepository extends ResourceRepository {
|
|
3
|
+
/**
|
|
4
|
+
* Get all concepts.
|
|
5
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
6
|
+
*/
|
|
7
|
+
getConcepts(graphUris: string | string[] | undefined): string[];
|
|
8
|
+
/**
|
|
9
|
+
* Get all concept schemes.
|
|
10
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
11
|
+
*/
|
|
12
|
+
getConceptSchemes(graphUris: string | string[] | undefined): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Get all broader concepts of a concept scheme.
|
|
15
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
16
|
+
* @param subjectUri URI of a concept scheme.
|
|
17
|
+
*/
|
|
18
|
+
getBroaderConcepts(graphUris: string | string[] | undefined, subjectUri: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Indicates whether a concept has broader concepts.
|
|
21
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
22
|
+
* @param subjectUri URI of a concept.
|
|
23
|
+
*/
|
|
24
|
+
hasBroaderConcepts(graphUris: string | string[] | undefined, subjectUri: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Get all narrower concepts of a concept or top concepts of a concept scheme.
|
|
27
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
28
|
+
* @param subjectUri URI of a concept or concept scheme.
|
|
29
|
+
*/
|
|
30
|
+
getNarrowerConcepts(graphUris: string | string[] | undefined, subjectUri?: string): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Indicates whether a concept has narrower concepts.
|
|
33
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
34
|
+
* @param subjectUri URI of a concept.
|
|
35
|
+
*/
|
|
36
|
+
hasNarrowerConcepts(graphUris: string | string[] | undefined, subjectUri: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Indicates whether a concept is a narrower concept of another concept.
|
|
39
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
40
|
+
* @param subjectUri URI of a concept.
|
|
41
|
+
* @param broaderUri URI of a broader concept.
|
|
42
|
+
* @returns `true` if the concept is a narrower concept of the broader concept, `false` otherwise.
|
|
43
|
+
*/
|
|
44
|
+
isNarrowerConceptOf(graphUris: string | string[] | undefined, subjectUri: string, broaderUri: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Indicates whether a subject is a concept scheme.
|
|
47
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
48
|
+
* @param subjectUri URI of a subject.
|
|
49
|
+
* @returns `true` if the subject is a concept scheme, `false` otherwise.
|
|
50
|
+
*/
|
|
51
|
+
isConceptScheme(graphUris: string | string[] | undefined, subjectUri: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Get all broader concepts up to and including a concept scheme.
|
|
54
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
55
|
+
* @param subjectUri URI of a concept.
|
|
56
|
+
*/
|
|
57
|
+
getConceptSchemePath(graphUris: string | string[] | undefined, subjectUri: string): string[];
|
|
58
|
+
/**
|
|
59
|
+
* Recursively find the first path from a given class to a root class.
|
|
60
|
+
* @param subjectUri URI of a class.
|
|
61
|
+
* @param path The current class path.
|
|
62
|
+
* @param backtrack Set of URIs that have already been visited.
|
|
63
|
+
* @returns The first path that is found from the given class to a root class.
|
|
64
|
+
*/
|
|
65
|
+
private _getConceptSchemePath;
|
|
66
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConceptRepository = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const n3 = tslib_1.__importStar(require("n3"));
|
|
6
|
+
const resource_repository_1 = require("./resource-repository");
|
|
7
|
+
const ontologies_1 = require("../ontologies");
|
|
8
|
+
class ConceptRepository extends resource_repository_1.ResourceRepository {
|
|
9
|
+
/**
|
|
10
|
+
* Get all concepts.
|
|
11
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
12
|
+
*/
|
|
13
|
+
getConcepts(graphUris) {
|
|
14
|
+
const result = new Set();
|
|
15
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.skos.Concept)) {
|
|
16
|
+
const s = q.subject;
|
|
17
|
+
result.add(s.value);
|
|
18
|
+
}
|
|
19
|
+
return Array.from(result);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get all concept schemes.
|
|
23
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
24
|
+
*/
|
|
25
|
+
getConceptSchemes(graphUris) {
|
|
26
|
+
const result = new Set();
|
|
27
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.skos.ConceptScheme)) {
|
|
28
|
+
const s = q.subject;
|
|
29
|
+
result.add(s.value);
|
|
30
|
+
}
|
|
31
|
+
return Array.from(result);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get all broader concepts of a concept scheme.
|
|
35
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
36
|
+
* @param subjectUri URI of a concept scheme.
|
|
37
|
+
*/
|
|
38
|
+
getBroaderConcepts(graphUris, subjectUri) {
|
|
39
|
+
if (subjectUri) {
|
|
40
|
+
const result = new Set();
|
|
41
|
+
const s = n3.DataFactory.namedNode(subjectUri);
|
|
42
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.skos.hasTopConcept, s)) {
|
|
43
|
+
const s = q.subject;
|
|
44
|
+
result.add(s.value);
|
|
45
|
+
}
|
|
46
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.skos.narrower, s)) {
|
|
47
|
+
const s = q.subject;
|
|
48
|
+
result.add(s.value);
|
|
49
|
+
}
|
|
50
|
+
for (let q of this.store.match(graphUris, s, ontologies_1.skos.topConceptOf, null)) {
|
|
51
|
+
const o = q.object;
|
|
52
|
+
result.add(o.value);
|
|
53
|
+
}
|
|
54
|
+
for (let q of this.store.match(graphUris, s, ontologies_1.skos.broader, null)) {
|
|
55
|
+
const o = q.object;
|
|
56
|
+
result.add(o.value);
|
|
57
|
+
}
|
|
58
|
+
return Array.from(result);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Indicates whether a concept has broader concepts.
|
|
66
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
67
|
+
* @param subjectUri URI of a concept.
|
|
68
|
+
*/
|
|
69
|
+
hasBroaderConcepts(graphUris, subjectUri) {
|
|
70
|
+
return this.getBroaderConcepts(graphUris, subjectUri).length > 0;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get all narrower concepts of a concept or top concepts of a concept scheme.
|
|
74
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
75
|
+
* @param subjectUri URI of a concept or concept scheme.
|
|
76
|
+
*/
|
|
77
|
+
getNarrowerConcepts(graphUris, subjectUri) {
|
|
78
|
+
if (subjectUri) {
|
|
79
|
+
const result = new Set();
|
|
80
|
+
const s = n3.DataFactory.namedNode(subjectUri);
|
|
81
|
+
for (let q of this.store.match(graphUris, s, ontologies_1.skos.hasTopConcept, null)) {
|
|
82
|
+
const o = q.object;
|
|
83
|
+
result.add(o.value);
|
|
84
|
+
}
|
|
85
|
+
for (let q of this.store.match(graphUris, s, ontologies_1.skos.narrower, null)) {
|
|
86
|
+
const o = q.object;
|
|
87
|
+
result.add(o.value);
|
|
88
|
+
}
|
|
89
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.skos.topConceptOf, s)) {
|
|
90
|
+
const s = q.subject;
|
|
91
|
+
result.add(s.value);
|
|
92
|
+
}
|
|
93
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.skos.broader, s)) {
|
|
94
|
+
const s = q.subject;
|
|
95
|
+
result.add(s.value);
|
|
96
|
+
}
|
|
97
|
+
return Array.from(result);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
return this.getConceptSchemes(graphUris);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Indicates whether a concept has narrower concepts.
|
|
105
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
106
|
+
* @param subjectUri URI of a concept.
|
|
107
|
+
*/
|
|
108
|
+
hasNarrowerConcepts(graphUris, subjectUri) {
|
|
109
|
+
return this.getNarrowerConcepts(graphUris, subjectUri).length > 0;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Indicates whether a concept is a narrower concept of another concept.
|
|
113
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
114
|
+
* @param subjectUri URI of a concept.
|
|
115
|
+
* @param broaderUri URI of a broader concept.
|
|
116
|
+
* @returns `true` if the concept is a narrower concept of the broader concept, `false` otherwise.
|
|
117
|
+
*/
|
|
118
|
+
isNarrowerConceptOf(graphUris, subjectUri, broaderUri) {
|
|
119
|
+
return this.getConceptSchemePath(graphUris, subjectUri).includes(broaderUri);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Indicates whether a subject is a concept scheme.
|
|
123
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
124
|
+
* @param subjectUri URI of a subject.
|
|
125
|
+
* @returns `true` if the subject is a concept scheme, `false` otherwise.
|
|
126
|
+
*/
|
|
127
|
+
isConceptScheme(graphUris, subjectUri) {
|
|
128
|
+
if (subjectUri) {
|
|
129
|
+
const s = n3.DataFactory.namedNode(subjectUri);
|
|
130
|
+
for (let _ of this.store.match(graphUris, s, ontologies_1.rdf.type, ontologies_1.skos.ConceptScheme)) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get all broader concepts up to and including a concept scheme.
|
|
138
|
+
* @param graphUris URIs of the graphs to search for concepts.
|
|
139
|
+
* @param subjectUri URI of a concept.
|
|
140
|
+
*/
|
|
141
|
+
getConceptSchemePath(graphUris, subjectUri) {
|
|
142
|
+
return this._getConceptSchemePath(graphUris, subjectUri, [], new Set());
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Recursively find the first path from a given class to a root class.
|
|
146
|
+
* @param subjectUri URI of a class.
|
|
147
|
+
* @param path The current class path.
|
|
148
|
+
* @param backtrack Set of URIs that have already been visited.
|
|
149
|
+
* @returns The first path that is found from the given class to a root class.
|
|
150
|
+
*/
|
|
151
|
+
_getConceptSchemePath(graphUris, subjectUri, path, backtrack) {
|
|
152
|
+
const broaderConcepts = this.getBroaderConcepts(graphUris, subjectUri);
|
|
153
|
+
for (let o of broaderConcepts.filter(o => !backtrack.has(o))) {
|
|
154
|
+
return this._getConceptSchemePath(graphUris, o, [...path, o], backtrack);
|
|
155
|
+
}
|
|
156
|
+
return path;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.ConceptRepository = ConceptRepository;
|
|
160
|
+
//# sourceMappingURL=concept-repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concept-repository.js","sourceRoot":"","sources":["../../src/rdf/concept-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,+DAA2D;AAC3D,8CAA0C;AAE1C,MAAa,iBAAkB,SAAQ,wCAAkB;IACrD;;;OAGG;IACH,WAAW,CAAC,SAAwC;QAChD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;QAEjC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAG,CAAC,IAAI,EAAE,iBAAI,CAAC,OAAO,CAAC,EAAE;YACrE,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;YAEpB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SACvB;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,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,SAAS,CAAC,UAAU,CAAC,CAAC;YAE/C,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,gBAAG,CAAC,IAAI,EAAE,iBAAI,CAAC,aAAa,CAAC,EAAE;gBACxE,OAAO,IAAI,CAAC;aACf;SACJ;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACH,oBAAoB,CAAC,SAAwC,EAAE,UAAkB;QAC7E,OAAO,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;OAMG;IACK,qBAAqB,CAAC,SAAwC,EAAE,UAAkB,EAAE,IAAc,EAAE,SAAsB;QAC9H,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAEvE,KAAK,IAAI,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;YAC1D,OAAO,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;SAC5E;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAzLD,8CAyLC"}
|
package/out/rdf/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./class-repository";
|
|
2
2
|
export * from "./individual-repository";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./vocabulary-repository";
|
|
4
4
|
export * from "./parsers/rdf-syntax";
|
|
5
5
|
export * from "./parsers/tokenizer";
|
|
6
6
|
export * from "./property-repository";
|
|
@@ -8,4 +8,3 @@ export * from "./reasoners/owl-reasoner";
|
|
|
8
8
|
export * from "./reasoners/rdfs-reasoner";
|
|
9
9
|
export * from "./resource-repository";
|
|
10
10
|
export * from "./store";
|
|
11
|
-
export * from "./store-factory";
|
package/out/rdf/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./class-repository"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./individual-repository"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./
|
|
6
|
+
tslib_1.__exportStar(require("./vocabulary-repository"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./parsers/rdf-syntax"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./parsers/tokenizer"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./property-repository"), exports);
|
|
@@ -11,5 +11,4 @@ tslib_1.__exportStar(require("./reasoners/owl-reasoner"), exports);
|
|
|
11
11
|
tslib_1.__exportStar(require("./reasoners/rdfs-reasoner"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./resource-repository"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./store"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./store-factory"), exports);
|
|
15
14
|
//# sourceMappingURL=index.js.map
|
package/out/rdf/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rdf/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,kEAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rdf/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,kEAAwC;AACxC,kEAAwC;AACxC,+DAAqC;AACrC,8DAAoC;AACpC,gEAAsC;AACtC,mEAAyC;AACzC,oEAA0C;AAC1C,gEAAsC;AACtC,kDAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rdfs-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/rdfs-reasoner.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"rdfs-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/rdfs-reasoner.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,iDAAwD;AAGxD;;GAEG;AACH,MAAa,YAAY;IAAzB;QACc,UAAK,GAAa,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;QAMjC,eAAU,GAAiB,IAAI,GAAG,EAAE,CAAC;QAErC,YAAO,GAAiB,IAAI,GAAG,EAAE,CAAC;QAElC,eAAU,GAAiB,IAAI,GAAG,EAAE,CAAC;QAErC,gBAAW,GAAsB,IAAI,GAAG,EAAE,CAAC;QAE9C,WAAM,GAAyC,EAAE,CAAC;IAkL7D,CAAC;IAhLU,oBAAoB,CAAC,GAA2B;QACnD,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;QAEjD,2EAA2E;QAC3E,OAAO,CAAC,CAAC,OAAO,CAAC,6BAA6B,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAEM,mBAAmB,CAAC,GAA2B;QAClD,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;QAEjD,OAAO,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;IAEM,MAAM,CAAC,KAAe,EAAE,WAAmC,EAAE,WAAoC;QACpG,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,WAAW,EAAE;YAC7B,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,CAAC,WAAW,EAAE;YACd,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;SACxD;QAED,IAAI,CAAC,UAAU,CA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C,cAAc,CAAC,CAAC,CAAC,CAAC;gBAEvB,OAAO;aACV;SACJ;IACL,CAAC;CACJ;AAjMD,oCAiMC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as n3 from "n3";
|
|
3
|
-
import { ParseOptions } from "../store-factory";
|
|
4
2
|
import { IReasoner } from "../reasoners/reasoner";
|
|
5
3
|
import { Store } from "../store";
|
|
6
|
-
import EventEmitter from "events";
|
|
7
4
|
/**
|
|
8
5
|
* Get the URL of a file.
|
|
9
6
|
* @param filePath A file system path.
|
|
@@ -40,18 +37,3 @@ export declare function createStoreFromString(filePath: string, reasoner?: IReas
|
|
|
40
37
|
* @returns A promise that resolves to an RDF store.
|
|
41
38
|
*/
|
|
42
39
|
export declare function createStoreFromFile(filePath: string, reasoner?: IReasoner, onQuad?: (quad: n3.Quad) => void): Promise<Store>;
|
|
43
|
-
/**
|
|
44
|
-
* Create an RDF store from a file.
|
|
45
|
-
* @param path Path to a file containing RDF triples in Turtle or N3 format.
|
|
46
|
-
* @param inference Indicates if OWL inference should be performed on the store.
|
|
47
|
-
* @returns A promise that resolves to an RDF store.
|
|
48
|
-
*/
|
|
49
|
-
export declare function createFromFile(filePath: string, parseOptions?: ParseOptions): Promise<n3.Store>;
|
|
50
|
-
/**
|
|
51
|
-
* Create an RDF store from a file.
|
|
52
|
-
* @param input Input data or stream in Turtle format to be parsed.
|
|
53
|
-
* @param graphUri URI of the graph to in which the triples will be created.
|
|
54
|
-
* @param parseCallback Callback function that will be called for each parsed triple.
|
|
55
|
-
* @returns A promise that resolves to an RDF store.
|
|
56
|
-
*/
|
|
57
|
-
export declare function createFromStream(input: string | EventEmitter, graphUri: string, parseOptions?: ParseOptions): Promise<n3.Store>;
|
package/out/rdf/tests/helpers.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createStoreFromFile = exports.createStoreFromString = exports.loadFile = exports.readFile = exports.pathToFileURL = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs = tslib_1.__importStar(require("fs"));
|
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
|
7
7
|
const url = tslib_1.__importStar(require("url"));
|
|
8
|
-
const store_factory_1 = require("../store-factory");
|
|
9
8
|
const store_1 = require("../store");
|
|
10
9
|
/**
|
|
11
10
|
* Get the URL of a file.
|
|
@@ -84,31 +83,4 @@ function createStoreFromFile(filePath, reasoner, onQuad) {
|
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
85
|
exports.createStoreFromFile = createStoreFromFile;
|
|
87
|
-
/**
|
|
88
|
-
* Create an RDF store from a file.
|
|
89
|
-
* @param path Path to a file containing RDF triples in Turtle or N3 format.
|
|
90
|
-
* @param inference Indicates if OWL inference should be performed on the store.
|
|
91
|
-
* @returns A promise that resolves to an RDF store.
|
|
92
|
-
*/
|
|
93
|
-
function createFromFile(filePath, parseOptions) {
|
|
94
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
const graphUri = pathToFileURL(filePath);
|
|
96
|
-
const stream = fs.createReadStream(filePath);
|
|
97
|
-
return store_factory_1.StoreFactory.createFromStream(stream, graphUri, parseOptions);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
exports.createFromFile = createFromFile;
|
|
101
|
-
/**
|
|
102
|
-
* Create an RDF store from a file.
|
|
103
|
-
* @param input Input data or stream in Turtle format to be parsed.
|
|
104
|
-
* @param graphUri URI of the graph to in which the triples will be created.
|
|
105
|
-
* @param parseCallback Callback function that will be called for each parsed triple.
|
|
106
|
-
* @returns A promise that resolves to an RDF store.
|
|
107
|
-
*/
|
|
108
|
-
function createFromStream(input, graphUri, parseOptions) {
|
|
109
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
return store_factory_1.StoreFactory.createFromStream(input, graphUri, parseOptions);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
exports.createFromStream = createFromStream;
|
|
114
86
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/rdf/tests/helpers.ts"],"names":[],"mappings":";;;;AACA,+CAAyB;AACzB,mDAA6B;AAC7B,iDAA2B;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/rdf/tests/helpers.ts"],"names":[],"mappings":";;;;AACA,+CAAyB;AACzB,mDAA6B;AAC7B,iDAA2B;AAE3B,oCAAiC;AAEjC;;;;GAIG;AACH,SAAgB,aAAa,CAAC,QAAgB;IAC1C,OAAO,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC;AAFD,sCAEC;AAED;;;;GAIG;AACH,SAAsB,QAAQ,CAAC,QAAgB;;QAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;gBAC1B,MAAM,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;aACzC;YAED,IAAI;gBACA,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAEpD,OAAO,CAAC,MAAM,CAAC,CAAC;aACnB;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,CAAC,KAAK,CAAC,CAAC;aACjB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CAAA;AAdD,4BAcC;AAED;;;;;;GAMG;AACH,SAAsB,QAAQ,CAAC,KAAY,EAAE,QAAgB,EAAE,QAAiB,EAAE,MAAgC;;QAC9G,MAAM,KAAK,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,aAAa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