@manta-eu/client 0.2.1 → 0.3.0
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/generated/graphql.d.ts +68 -35
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +31 -14
- package/dist/generated/graphql.js.map +1 -1
- package/dist/shared/datastore-id.js +1 -1
- package/dist/shared/datastore-id.js.map +1 -1
- package/dist/shared/memory-citation-sampling.d.ts +2 -1
- package/dist/shared/memory-citation-sampling.d.ts.map +1 -1
- package/dist/shared/memory-citation-sampling.js +5 -4
- package/dist/shared/memory-citation-sampling.js.map +1 -1
- package/dist/shared/memory-diversity.js +1 -1
- package/dist/shared/memory-diversity.js.map +1 -1
- package/dist/shared/memory-keyword-recall.d.ts +1 -0
- package/dist/shared/memory-keyword-recall.d.ts.map +1 -1
- package/dist/shared/memory-keyword-recall.js +2 -1
- package/dist/shared/memory-keyword-recall.js.map +1 -1
- package/dist/shared/rdf-namespaces.d.ts +1 -3
- package/dist/shared/rdf-namespaces.d.ts.map +1 -1
- package/dist/shared/rdf-namespaces.js +2 -4
- package/dist/shared/rdf-namespaces.js.map +1 -1
- package/dist/shared/tools/coercers.d.ts.map +1 -1
- package/dist/shared/tools/coercers.js +6 -3
- package/dist/shared/tools/coercers.js.map +1 -1
- package/dist/shared/tools/index.d.ts +1 -1
- package/dist/shared/tools/index.d.ts.map +1 -1
- package/dist/shared/tools/metadata.js +23 -23
- package/dist/shared/tools/metadata.js.map +1 -1
- package/dist/shared/tools/types.d.ts +24 -24
- package/dist/shared/tools/types.d.ts.map +1 -1
- package/dist/shared/writable-shape-query.js +2 -2
- package/dist/shared/writable-shape-query.js.map +1 -1
- package/package.json +5 -5
- package/src/generated/graphql.ts +107 -50
- package/src/shared/datastore-id.ts +1 -1
- package/src/shared/memory-citation-sampling.ts +5 -5
- package/src/shared/memory-diversity.ts +1 -1
- package/src/shared/memory-keyword-recall.ts +3 -1
- package/src/shared/rdf-namespaces.ts +2 -9
- package/src/shared/tools/coercers.ts +7 -4
- package/src/shared/tools/index.ts +8 -8
- package/src/shared/tools/metadata.ts +23 -23
- package/src/shared/tools/types.ts +30 -30
- package/src/shared/writable-shape-query.ts +2 -2
|
@@ -10,17 +10,17 @@ export type { TestTripleInput };
|
|
|
10
10
|
export type SparqlJsonBinding = SparqlBinding;
|
|
11
11
|
|
|
12
12
|
export type ToolName =
|
|
13
|
-
| "
|
|
14
|
-
| "
|
|
15
|
-
| "
|
|
16
|
-
| "
|
|
13
|
+
| "queryKnowledgeGraph"
|
|
14
|
+
| "addFacts"
|
|
15
|
+
| "getRules"
|
|
16
|
+
| "explainFact"
|
|
17
17
|
| "scheduleTask"
|
|
18
18
|
| "listScheduledTasks"
|
|
19
19
|
| "cancelSchedule"
|
|
20
20
|
| "generateChart"
|
|
21
21
|
| "executeActionPlan"
|
|
22
|
-
| "
|
|
23
|
-
| "
|
|
22
|
+
| "manageRules"
|
|
23
|
+
| "manageFacts"
|
|
24
24
|
| "actionPlanShowcase"
|
|
25
25
|
| "showEntities"
|
|
26
26
|
| "checkAutoPilotStatus"
|
|
@@ -28,7 +28,7 @@ export type ToolName =
|
|
|
28
28
|
| "markAsLowRisk"
|
|
29
29
|
| "readUploadedFile";
|
|
30
30
|
|
|
31
|
-
export type ToolCategory = "
|
|
31
|
+
export type ToolCategory = "knowledge-graph" | "scheduler" | "charts" | "action" | "auto-pilot";
|
|
32
32
|
|
|
33
33
|
export type ToolInputSchema<T = unknown> = z.ZodSchema<T>;
|
|
34
34
|
|
|
@@ -39,36 +39,36 @@ export type ToolErrorResult = {
|
|
|
39
39
|
content: string;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export type
|
|
42
|
+
export type QueryKnowledgeGraphInput = {
|
|
43
43
|
humanIntent: string;
|
|
44
44
|
sparql: string;
|
|
45
45
|
keepPrefixes?: boolean;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export type
|
|
48
|
+
export type QueryKnowledgeGraphOutput = JsonLdGraphDocument | SparqlJsonResults | ToolErrorResult;
|
|
49
49
|
|
|
50
|
-
export type
|
|
50
|
+
export type AddFactsInput = {
|
|
51
51
|
facts: string;
|
|
52
52
|
humanIntent: string;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
export type
|
|
55
|
+
export type AddFactsOutput = string | ToolErrorResult;
|
|
56
56
|
|
|
57
|
-
export type
|
|
57
|
+
export type GetRulesInput = {
|
|
58
58
|
namedGraphIri?: string;
|
|
59
59
|
rdfTypes?: string[];
|
|
60
60
|
limit?: number;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
export type
|
|
63
|
+
export type GetRulesOutputSuccess = {
|
|
64
64
|
rules: string[] | string | Record<string, unknown>[]; // TODO: standardize on RuleInfo type
|
|
65
65
|
totalCount: number;
|
|
66
66
|
truncated?: boolean;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
export type
|
|
69
|
+
export type GetRulesOutput = GetRulesOutputSuccess | ToolErrorResult;
|
|
70
70
|
|
|
71
|
-
export type
|
|
71
|
+
export type ExplainFactToolInput = {
|
|
72
72
|
subject: string;
|
|
73
73
|
predicate?: string;
|
|
74
74
|
object: string;
|
|
@@ -76,7 +76,7 @@ export type ExplainRDFoxRulesInput = {
|
|
|
76
76
|
|
|
77
77
|
export type ToolObjectOutput = object | ToolErrorResult;
|
|
78
78
|
|
|
79
|
-
export type
|
|
79
|
+
export type ExplainFactToolOutput = ToolObjectOutput;
|
|
80
80
|
|
|
81
81
|
export type ScheduleTaskInput = {
|
|
82
82
|
when: "scheduled" | "delayed" | "cron";
|
|
@@ -151,7 +151,7 @@ export type ExecuteActionPlanOutput =
|
|
|
151
151
|
}
|
|
152
152
|
| ToolErrorResult;
|
|
153
153
|
|
|
154
|
-
export type
|
|
154
|
+
export type ManageRulesInput = {
|
|
155
155
|
humanIntent: string;
|
|
156
156
|
operation: "add" | "change" | "remove";
|
|
157
157
|
ruleIri?: string;
|
|
@@ -161,17 +161,17 @@ export type ManageRDFoxRulesInput = {
|
|
|
161
161
|
dryRun?: boolean;
|
|
162
162
|
stageOnly?: boolean;
|
|
163
163
|
};
|
|
164
|
-
export type
|
|
164
|
+
export type ManageRulesSuccess = {
|
|
165
165
|
success: true;
|
|
166
166
|
ruleIri: string;
|
|
167
167
|
parsedRule: DatalogRule | null;
|
|
168
168
|
content: string;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
export type
|
|
172
|
-
| (
|
|
173
|
-
| (
|
|
174
|
-
| (
|
|
171
|
+
export type ManageRulesOutput =
|
|
172
|
+
| (ManageRulesSuccess & { dryRun: true })
|
|
173
|
+
| (ManageRulesSuccess & { staged: true })
|
|
174
|
+
| (ManageRulesSuccess & {
|
|
175
175
|
ruleText: string;
|
|
176
176
|
inferenceVerified: boolean;
|
|
177
177
|
inferenceVerification: InferenceVerificationResult | null;
|
|
@@ -183,7 +183,7 @@ export type ManageRDFoxRulesOutput =
|
|
|
183
183
|
})
|
|
184
184
|
| ToolErrorResult;
|
|
185
185
|
|
|
186
|
-
export type
|
|
186
|
+
export type ManageFactsInput = {
|
|
187
187
|
humanIntent: string;
|
|
188
188
|
facts: string;
|
|
189
189
|
namedGraphIri?: string;
|
|
@@ -191,7 +191,7 @@ export type ManageRDFoxFactsInput = {
|
|
|
191
191
|
etag?: string;
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
-
export type
|
|
194
|
+
export type ManageFactsOutput =
|
|
195
195
|
| {
|
|
196
196
|
content: string;
|
|
197
197
|
is_error: boolean;
|
|
@@ -265,17 +265,17 @@ export type AutoPilotOutput = ({ success: true } & AutoPilotActionPlan) | ToolEr
|
|
|
265
265
|
export type CheckAutoPilotStatusOutput = AutoPilotActionPlan | ToolErrorResult;
|
|
266
266
|
|
|
267
267
|
export type ToolDefinitions = {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
queryKnowledgeGraph: ToolDefinition<QueryKnowledgeGraphInput, QueryKnowledgeGraphOutput>;
|
|
269
|
+
addFacts: ToolDefinition<AddFactsInput, AddFactsOutput>;
|
|
270
|
+
getRules: ToolDefinition<GetRulesInput, GetRulesOutput>;
|
|
271
|
+
explainFact: ToolDefinition<ExplainFactToolInput, ExplainFactToolOutput>;
|
|
272
272
|
scheduleTask: ToolDefinition<ScheduleTaskInput, ScheduleTaskOutput>;
|
|
273
273
|
listScheduledTasks: ToolDefinition<ListScheduledTasksInput, ListScheduledTasksOutput>;
|
|
274
274
|
cancelSchedule: ToolDefinition<CancelScheduleInput, CancelScheduleOutput>;
|
|
275
275
|
generateChart: ToolDefinition<GenerateChartInput, GenerateChartOutput>;
|
|
276
276
|
executeActionPlan: ToolDefinition<ExecuteActionPlanInput, ExecuteActionPlanOutput>;
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
manageRules: ToolDefinition<ManageRulesInput, ManageRulesOutput>;
|
|
278
|
+
manageFacts: ToolDefinition<ManageFactsInput, ManageFactsOutput>;
|
|
279
279
|
actionPlanShowcase: ToolDefinition<ActionPlanShowcaseInput, ActionPlanShowcaseOutput>;
|
|
280
280
|
showEntities: ToolDefinition<ShowEntitiesInput, ShowEntitiesOutput>;
|
|
281
281
|
checkAutoPilotStatus: ToolDefinition<AutoPilotInput, CheckAutoPilotStatusOutput>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataFactory } from "ldkit/rdf";
|
|
2
2
|
import { SELECT } from "ldkit/sparql";
|
|
3
|
-
import { sh,
|
|
3
|
+
import { sh, shaclGraph, writeLifecycle } from "./rdf-namespaces";
|
|
4
4
|
|
|
5
5
|
const dataFactory = new DataFactory();
|
|
6
6
|
const property = dataFactory.namedNode(sh.property);
|
|
@@ -12,7 +12,7 @@ export function buildActionShapePropertyQuery(actionShapeIris: string[]): string
|
|
|
12
12
|
const actionShapes = actionShapeIris.map((iri) => dataFactory.namedNode(iri));
|
|
13
13
|
|
|
14
14
|
return SELECT`DISTINCT ?actionShape ?parent ?path ?node ?flag`.WHERE`
|
|
15
|
-
GRAPH ${dataFactory.namedNode(
|
|
15
|
+
GRAPH ${dataFactory.namedNode(shaclGraph)} {
|
|
16
16
|
VALUES ?actionShape { ${actionShapes} }
|
|
17
17
|
?actionShape (${property}/${node})* ?parent .
|
|
18
18
|
?parent ${property} ?propertyShape .
|