Skip to content

Commit 143b06e

Browse files
flyingsilverfinhaikalpribadi
authored andcommitted
Retrievable explanations, Restrict explanations to ConceptMaps (#20)
## What is the goal of this PR? Explanations can exceed the gRPC message size limits. This change allows retrieving explanations separately from the `ConceptMap` answers themselves, allowing us to break the deep nesting and long messages contained in a single answer. The paradigm for retriving an explanation is now as follows: A `ConceptMap` always contains a `pattern` and a boolean flag `hasExplanation`. If the `ConceptMap` has an explanation, a call can be made using message type `Explanation.Req`, returning a list of `ConceptMap` that correspond to to a single layer of the explanation tree. Unused `Explanation` messages have been removed from answers other than `ConceptMap`. ## What are the changes implemented in this PR? * `ConceptMap` contains `conceptMap`, `pattern` and `hasExplanation` * A new RPC endpoint can be performed by clients using type `Explanation.Req`, returning `Explanation.Res` * `Explanation` removed from answers other than `ConceptMap`
1 parent af2daa4 commit 143b06e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

session/Answer.proto

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,40 @@ message Answer {
3838
}
3939

4040
message Explanation {
41-
string pattern = 1;
42-
repeated ConceptMap answers = 2;
41+
message Req {
42+
ConceptMap explainable = 1;
43+
}
44+
message Res {
45+
repeated ConceptMap explanation = 1;
46+
}
4347
}
4448

4549
message AnswerGroup {
4650
Concept owner = 1;
4751
repeated Answer answers = 2;
48-
Explanation explanation = 3;
4952
}
5053

5154
message ConceptMap {
5255
map<string, Concept> map = 1;
53-
Explanation explanation = 2;
56+
string pattern = 2;
57+
bool hasExplanation = 3;
5458
}
5559

5660
message ConceptList {
5761
ConceptIds list = 1;
58-
Explanation explanation = 2;
5962
}
6063

6164
message ConceptSet {
6265
ConceptIds set = 1;
63-
Explanation explanation = 2;
6466
}
6567

6668
message ConceptSetMeasure {
6769
ConceptIds set = 1;
6870
Number measurement = 2;
69-
Explanation explanation = 3;
7071
}
7172

7273
message Value {
7374
Number number = 1;
74-
Explanation explanation = 2;
7575
}
7676

7777
message Void {

session/Session.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ message Transaction {
7676
PutRole.Req putRole_req = 11;
7777
PutRule.Req putRule_req = 12;
7878
ConceptMethod.Req conceptMethod_req = 13;
79+
Explanation.Req explanation_req = 14;
7980
}
8081
}
8182
message Res {
@@ -93,6 +94,7 @@ message Transaction {
9394
PutRole.Res putRole_res = 11;
9495
PutRule.Res putRule_res = 12;
9596
ConceptMethod.Res conceptMethod_res = 13;
97+
Explanation.Res explanation_res = 14;
9698
}
9799
}
98100

0 commit comments

Comments
 (0)