@powerhousedao/knowledge-note 1.0.2 → 1.0.3
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/dist/editors/knowledge-vault/components/GraphView.d.ts.map +1 -1
- package/dist/editors/knowledge-vault/components/GraphView.js +210 -32
- package/dist/editors/knowledge-vault/components/NoteList.d.ts.map +1 -1
- package/dist/editors/knowledge-vault/components/NoteList.js +13 -16
- package/dist/editors/knowledge-vault/hooks/use-drive-init.d.ts.map +1 -1
- package/dist/editors/knowledge-vault/hooks/use-drive-init.js +0 -2
- package/dist/package.json +2 -2
- package/dist/processors/factory.d.ts.map +1 -1
- package/dist/processors/factory.js +0 -3
- package/dist/processors/graph-indexer/index.d.ts.map +1 -1
- package/dist/processors/graph-indexer/index.js +5 -8
- package/dist/style.css +67 -0
- package/dist/subgraphs/index.d.ts +0 -1
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +0 -1
- package/dist/subgraphs/knowledge-graph/subgraph.d.ts +28 -13
- package/dist/subgraphs/knowledge-graph/subgraph.d.ts.map +1 -1
- package/dist/subgraphs/knowledge-graph/subgraph.js +99 -7
- package/package.json +3 -3
- package/dist/processors/methodology-indexer/factory.d.ts +0 -4
- package/dist/processors/methodology-indexer/factory.d.ts.map +0 -1
- package/dist/processors/methodology-indexer/factory.js +0 -23
- package/dist/processors/methodology-indexer/index.d.ts +0 -11
- package/dist/processors/methodology-indexer/index.d.ts.map +0 -1
- package/dist/processors/methodology-indexer/index.js +0 -116
- package/dist/processors/methodology-indexer/migrations.d.ts +0 -4
- package/dist/processors/methodology-indexer/migrations.d.ts.map +0 -1
- package/dist/processors/methodology-indexer/migrations.js +0 -39
- package/dist/processors/methodology-indexer/query.d.ts +0 -35
- package/dist/processors/methodology-indexer/query.d.ts.map +0 -1
- package/dist/processors/methodology-indexer/query.js +0 -114
- package/dist/processors/methodology-indexer/schema.d.ts +0 -22
- package/dist/processors/methodology-indexer/schema.d.ts.map +0 -1
- package/dist/processors/methodology-indexer/schema.js +0 -1
- package/dist/subgraphs/methodology/index.d.ts +0 -2
- package/dist/subgraphs/methodology/index.d.ts.map +0 -1
- package/dist/subgraphs/methodology/index.js +0 -1
- package/dist/subgraphs/methodology/subgraph.d.ts +0 -47
- package/dist/subgraphs/methodology/subgraph.d.ts.map +0 -1
- package/dist/subgraphs/methodology/subgraph.js +0 -100
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Kysely } from "kysely";
|
|
2
|
-
import type { MethodologyDB } from "./schema.js";
|
|
3
|
-
export interface ClaimResult {
|
|
4
|
-
id: string;
|
|
5
|
-
documentId: string;
|
|
6
|
-
title: string | null;
|
|
7
|
-
description: string | null;
|
|
8
|
-
kind: string | null;
|
|
9
|
-
topics: string[];
|
|
10
|
-
methodology: string[];
|
|
11
|
-
updatedAt: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ConnectionResult {
|
|
14
|
-
id: string;
|
|
15
|
-
sourceDocumentId: string;
|
|
16
|
-
targetRef: string;
|
|
17
|
-
contextPhrase: string | null;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
}
|
|
20
|
-
export declare function createMethodologyQuery(db: Kysely<MethodologyDB>): {
|
|
21
|
-
allClaims(): Promise<ClaimResult[]>;
|
|
22
|
-
claimCount(): Promise<number>;
|
|
23
|
-
claimByDocumentId(documentId: string): Promise<ClaimResult | undefined>;
|
|
24
|
-
claimsByKind(kind: string): Promise<ClaimResult[]>;
|
|
25
|
-
searchClaims(query: string, limit?: number): Promise<ClaimResult[]>;
|
|
26
|
-
claimsByTopic(topic: string): Promise<ClaimResult[]>;
|
|
27
|
-
connectionsFrom(documentId: string): Promise<ConnectionResult[]>;
|
|
28
|
-
connectionsTo(targetRef: string): Promise<ConnectionResult[]>;
|
|
29
|
-
stats(): Promise<{
|
|
30
|
-
claimCount: number;
|
|
31
|
-
connectionCount: number;
|
|
32
|
-
kindDistribution: Record<string, number>;
|
|
33
|
-
}>;
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../processors/methodology-indexer/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EACV,aAAa,EAGd,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAyBD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,CAAC,aAAa,CAAC;iBAEzC,OAAO,CAAC,WAAW,EAAE,CAAC;kBAQrB,OAAO,CAAC,MAAM,CAAC;kCASrB,MAAM,GACjB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;uBASV,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;wBAS9B,MAAM,mBAAe,OAAO,CAAC,WAAW,EAAE,CAAC;yBAiB1C,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gCAUxB,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;6BASvC,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;aASpD,OAAO,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC1C,CAAC;EAuBL"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
function rowToClaim(row) {
|
|
2
|
-
return {
|
|
3
|
-
id: row.id,
|
|
4
|
-
documentId: row.document_id,
|
|
5
|
-
title: row.title,
|
|
6
|
-
description: row.description,
|
|
7
|
-
kind: row.kind,
|
|
8
|
-
topics: row.topics ? JSON.parse(row.topics) : [],
|
|
9
|
-
methodology: row.methodology ? JSON.parse(row.methodology) : [],
|
|
10
|
-
updatedAt: row.updated_at,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function rowToConnection(row) {
|
|
14
|
-
return {
|
|
15
|
-
id: row.id,
|
|
16
|
-
sourceDocumentId: row.source_document_id,
|
|
17
|
-
targetRef: row.target_ref,
|
|
18
|
-
contextPhrase: row.context_phrase,
|
|
19
|
-
updatedAt: row.updated_at,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export function createMethodologyQuery(db) {
|
|
23
|
-
return {
|
|
24
|
-
async allClaims() {
|
|
25
|
-
const rows = await db
|
|
26
|
-
.selectFrom("methodology_claims")
|
|
27
|
-
.selectAll()
|
|
28
|
-
.execute();
|
|
29
|
-
return rows.map(rowToClaim);
|
|
30
|
-
},
|
|
31
|
-
async claimCount() {
|
|
32
|
-
const rows = await db
|
|
33
|
-
.selectFrom("methodology_claims")
|
|
34
|
-
.selectAll()
|
|
35
|
-
.execute();
|
|
36
|
-
return rows.length;
|
|
37
|
-
},
|
|
38
|
-
async claimByDocumentId(documentId) {
|
|
39
|
-
const row = await db
|
|
40
|
-
.selectFrom("methodology_claims")
|
|
41
|
-
.where("document_id", "=", documentId)
|
|
42
|
-
.selectAll()
|
|
43
|
-
.executeTakeFirst();
|
|
44
|
-
return row ? rowToClaim(row) : undefined;
|
|
45
|
-
},
|
|
46
|
-
async claimsByKind(kind) {
|
|
47
|
-
const rows = await db
|
|
48
|
-
.selectFrom("methodology_claims")
|
|
49
|
-
.where("kind", "=", kind)
|
|
50
|
-
.selectAll()
|
|
51
|
-
.execute();
|
|
52
|
-
return rows.map(rowToClaim);
|
|
53
|
-
},
|
|
54
|
-
async searchClaims(query, limit = 50) {
|
|
55
|
-
const q = `%${query.toLowerCase()}%`;
|
|
56
|
-
const rows = await db
|
|
57
|
-
.selectFrom("methodology_claims")
|
|
58
|
-
.where((eb) => eb.or([
|
|
59
|
-
eb(eb.fn("lower", ["title"]), "like", q),
|
|
60
|
-
eb(eb.fn("lower", ["description"]), "like", q),
|
|
61
|
-
eb(eb.fn("lower", ["topics"]), "like", q),
|
|
62
|
-
]))
|
|
63
|
-
.selectAll()
|
|
64
|
-
.limit(limit)
|
|
65
|
-
.execute();
|
|
66
|
-
return rows.map(rowToClaim);
|
|
67
|
-
},
|
|
68
|
-
async claimsByTopic(topic) {
|
|
69
|
-
const q = `%"${topic.toLowerCase()}"%`;
|
|
70
|
-
const rows = await db
|
|
71
|
-
.selectFrom("methodology_claims")
|
|
72
|
-
.where((eb) => eb(eb.fn("lower", ["topics"]), "like", q))
|
|
73
|
-
.selectAll()
|
|
74
|
-
.execute();
|
|
75
|
-
return rows.map(rowToClaim);
|
|
76
|
-
},
|
|
77
|
-
async connectionsFrom(documentId) {
|
|
78
|
-
const rows = await db
|
|
79
|
-
.selectFrom("methodology_connections")
|
|
80
|
-
.where("source_document_id", "=", documentId)
|
|
81
|
-
.selectAll()
|
|
82
|
-
.execute();
|
|
83
|
-
return rows.map(rowToConnection);
|
|
84
|
-
},
|
|
85
|
-
async connectionsTo(targetRef) {
|
|
86
|
-
const rows = await db
|
|
87
|
-
.selectFrom("methodology_connections")
|
|
88
|
-
.where("target_ref", "=", targetRef)
|
|
89
|
-
.selectAll()
|
|
90
|
-
.execute();
|
|
91
|
-
return rows.map(rowToConnection);
|
|
92
|
-
},
|
|
93
|
-
async stats() {
|
|
94
|
-
const claims = await db
|
|
95
|
-
.selectFrom("methodology_claims")
|
|
96
|
-
.selectAll()
|
|
97
|
-
.execute();
|
|
98
|
-
const connections = await db
|
|
99
|
-
.selectFrom("methodology_connections")
|
|
100
|
-
.selectAll()
|
|
101
|
-
.execute();
|
|
102
|
-
const kindDist = {};
|
|
103
|
-
for (const c of claims) {
|
|
104
|
-
const k = c.kind ?? "unknown";
|
|
105
|
-
kindDist[k] = (kindDist[k] ?? 0) + 1;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
claimCount: claims.length,
|
|
109
|
-
connectionCount: connections.length,
|
|
110
|
-
kindDistribution: kindDist,
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface MethodologyClaim {
|
|
2
|
-
id: string;
|
|
3
|
-
document_id: string;
|
|
4
|
-
title: string | null;
|
|
5
|
-
description: string | null;
|
|
6
|
-
kind: string | null;
|
|
7
|
-
topics: string | null;
|
|
8
|
-
methodology: string | null;
|
|
9
|
-
updated_at: string;
|
|
10
|
-
}
|
|
11
|
-
export interface MethodologyConnection {
|
|
12
|
-
id: string;
|
|
13
|
-
source_document_id: string;
|
|
14
|
-
target_ref: string;
|
|
15
|
-
context_phrase: string | null;
|
|
16
|
-
updated_at: string;
|
|
17
|
-
}
|
|
18
|
-
export interface MethodologyDB {
|
|
19
|
-
methodology_claims: MethodologyClaim;
|
|
20
|
-
methodology_connections: MethodologyConnection;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../processors/methodology-indexer/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,uBAAuB,EAAE,qBAAqB,CAAC;CAChD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/methodology/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MethodologySubgraph } from "./subgraph.js";
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { BaseSubgraph, type SubgraphArgs } from "@powerhousedao/reactor-api";
|
|
2
|
-
export declare class MethodologySubgraph extends BaseSubgraph {
|
|
3
|
-
name: string;
|
|
4
|
-
typeDefs: import("graphql").DocumentNode;
|
|
5
|
-
resolvers: {
|
|
6
|
-
Query: {
|
|
7
|
-
methodologySearch: (_: unknown, args: {
|
|
8
|
-
driveId: string;
|
|
9
|
-
query: string;
|
|
10
|
-
limit?: number;
|
|
11
|
-
}) => Promise<import("../../processors/methodology-indexer/query.js").ClaimResult[]>;
|
|
12
|
-
methodologyClaims: (_: unknown, args: {
|
|
13
|
-
driveId: string;
|
|
14
|
-
}) => Promise<import("../../processors/methodology-indexer/query.js").ClaimResult[]>;
|
|
15
|
-
methodologyClaimsByKind: (_: unknown, args: {
|
|
16
|
-
driveId: string;
|
|
17
|
-
kind: string;
|
|
18
|
-
}) => Promise<import("../../processors/methodology-indexer/query.js").ClaimResult[]>;
|
|
19
|
-
methodologyClaimsByTopic: (_: unknown, args: {
|
|
20
|
-
driveId: string;
|
|
21
|
-
topic: string;
|
|
22
|
-
}) => Promise<import("../../processors/methodology-indexer/query.js").ClaimResult[]>;
|
|
23
|
-
methodologyClaimById: (_: unknown, args: {
|
|
24
|
-
driveId: string;
|
|
25
|
-
documentId: string;
|
|
26
|
-
}) => Promise<import("../../processors/methodology-indexer/query.js").ClaimResult | undefined>;
|
|
27
|
-
methodologyStats: (_: unknown, args: {
|
|
28
|
-
driveId: string;
|
|
29
|
-
}) => Promise<{
|
|
30
|
-
claimCount: number;
|
|
31
|
-
connectionCount: number;
|
|
32
|
-
kindDistribution: Record<string, number>;
|
|
33
|
-
}>;
|
|
34
|
-
methodologyConnectionsFrom: (_: unknown, args: {
|
|
35
|
-
driveId: string;
|
|
36
|
-
documentId: string;
|
|
37
|
-
}) => Promise<import("../../processors/methodology-indexer/query.js").ConnectionResult[]>;
|
|
38
|
-
methodologyConnectionsTo: (_: unknown, args: {
|
|
39
|
-
driveId: string;
|
|
40
|
-
targetRef: string;
|
|
41
|
-
}) => Promise<import("../../processors/methodology-indexer/query.js").ConnectionResult[]>;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
constructor(args: SubgraphArgs);
|
|
45
|
-
private getQuery;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=subgraph.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subgraph.d.ts","sourceRoot":"","sources":["../../../subgraphs/methodology/subgraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM7E,qBAAa,mBAAoB,SAAQ,YAAY;IAC1C,IAAI,SAAiB;IAErB,QAAQ,iCAiDf;IAEO,SAAS;;mCAGT,OAAO,QACJ;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAC;gBAAC,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE;mCAM7B,OAAO,QAAQ;gBAAE,OAAO,EAAE,MAAM,CAAA;aAAE;yCAM1D,OAAO,QACJ;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAA;aAAE;0CAOpC,OAAO,QACJ;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE;sCAOrC,OAAO,QACJ;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,UAAU,EAAE,MAAM,CAAA;aAAE;kCAMnB,OAAO,QAAQ;gBAAE,OAAO,EAAE,MAAM,CAAA;aAAE;;;;;4CAMzD,OAAO,QACJ;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,UAAU,EAAE,MAAM,CAAA;aAAE;0CAO1C,OAAO,QACJ;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE;;MAMhD;gBAEU,IAAI,EAAE,YAAY;IAI9B,OAAO,CAAC,QAAQ;CASjB"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { gql } from "graphql-tag";
|
|
2
|
-
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
3
|
-
import { MethodologyIndexerProcessor } from "../../processors/methodology-indexer/index.js";
|
|
4
|
-
import { createMethodologyQuery } from "../../processors/methodology-indexer/query.js";
|
|
5
|
-
export class MethodologySubgraph extends BaseSubgraph {
|
|
6
|
-
name = "methodology";
|
|
7
|
-
typeDefs = gql `
|
|
8
|
-
type MethodologyClaim {
|
|
9
|
-
id: String!
|
|
10
|
-
documentId: String!
|
|
11
|
-
title: String
|
|
12
|
-
description: String
|
|
13
|
-
kind: String
|
|
14
|
-
topics: [String!]!
|
|
15
|
-
methodology: [String!]!
|
|
16
|
-
updatedAt: String!
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
type MethodologyConnection {
|
|
20
|
-
id: String!
|
|
21
|
-
sourceDocumentId: String!
|
|
22
|
-
targetRef: String!
|
|
23
|
-
contextPhrase: String
|
|
24
|
-
updatedAt: String!
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
type MethodologyStats {
|
|
28
|
-
claimCount: Int!
|
|
29
|
-
connectionCount: Int!
|
|
30
|
-
kindDistribution: JSONObject
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
extend type Query {
|
|
34
|
-
methodologySearch(
|
|
35
|
-
driveId: ID!
|
|
36
|
-
query: String!
|
|
37
|
-
limit: Int
|
|
38
|
-
): [MethodologyClaim!]!
|
|
39
|
-
methodologyClaims(driveId: ID!): [MethodologyClaim!]!
|
|
40
|
-
methodologyClaimsByKind(driveId: ID!, kind: String!): [MethodologyClaim!]!
|
|
41
|
-
methodologyClaimsByTopic(
|
|
42
|
-
driveId: ID!
|
|
43
|
-
topic: String!
|
|
44
|
-
): [MethodologyClaim!]!
|
|
45
|
-
methodologyClaimById(driveId: ID!, documentId: String!): MethodologyClaim
|
|
46
|
-
methodologyStats(driveId: ID!): MethodologyStats!
|
|
47
|
-
methodologyConnectionsFrom(
|
|
48
|
-
driveId: ID!
|
|
49
|
-
documentId: String!
|
|
50
|
-
): [MethodologyConnection!]!
|
|
51
|
-
methodologyConnectionsTo(
|
|
52
|
-
driveId: ID!
|
|
53
|
-
targetRef: String!
|
|
54
|
-
): [MethodologyConnection!]!
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
resolvers = {
|
|
58
|
-
Query: {
|
|
59
|
-
methodologySearch: async (_, args) => {
|
|
60
|
-
const query = this.getQuery(args.driveId);
|
|
61
|
-
return query.searchClaims(args.query, args.limit ?? 50);
|
|
62
|
-
},
|
|
63
|
-
methodologyClaims: async (_, args) => {
|
|
64
|
-
const query = this.getQuery(args.driveId);
|
|
65
|
-
return query.allClaims();
|
|
66
|
-
},
|
|
67
|
-
methodologyClaimsByKind: async (_, args) => {
|
|
68
|
-
const query = this.getQuery(args.driveId);
|
|
69
|
-
return query.claimsByKind(args.kind);
|
|
70
|
-
},
|
|
71
|
-
methodologyClaimsByTopic: async (_, args) => {
|
|
72
|
-
const query = this.getQuery(args.driveId);
|
|
73
|
-
return query.claimsByTopic(args.topic);
|
|
74
|
-
},
|
|
75
|
-
methodologyClaimById: async (_, args) => {
|
|
76
|
-
const query = this.getQuery(args.driveId);
|
|
77
|
-
return query.claimByDocumentId(args.documentId) ?? null;
|
|
78
|
-
},
|
|
79
|
-
methodologyStats: async (_, args) => {
|
|
80
|
-
const query = this.getQuery(args.driveId);
|
|
81
|
-
return query.stats();
|
|
82
|
-
},
|
|
83
|
-
methodologyConnectionsFrom: async (_, args) => {
|
|
84
|
-
const query = this.getQuery(args.driveId);
|
|
85
|
-
return query.connectionsFrom(args.documentId);
|
|
86
|
-
},
|
|
87
|
-
methodologyConnectionsTo: async (_, args) => {
|
|
88
|
-
const query = this.getQuery(args.driveId);
|
|
89
|
-
return query.connectionsTo(args.targetRef);
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
constructor(args) {
|
|
94
|
-
super(args);
|
|
95
|
-
}
|
|
96
|
-
getQuery(driveId) {
|
|
97
|
-
const queryBuilder = MethodologyIndexerProcessor.query(driveId, this.relationalDb);
|
|
98
|
-
return createMethodologyQuery(queryBuilder);
|
|
99
|
-
}
|
|
100
|
-
}
|