Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Implement explanations #213

Merged
merged 10 commits into from
Mar 31, 2021
Merged

Conversation

alexjpwalker
Copy link
Member

What is the goal of this PR?

Following typedb/typedb#6271 and the corresponding protocol change in typedb/typedb-protocol#131 we implement Explanations, Explainable concept maps, and the explain() query API, which allows users to stream Explanations on demand note: explain query or transaction option must be set to true

What are the changes implemented in this PR?

  • Implement Explanation objects, and extend ConceptMap to contain Explainables
  • Add the QueryManager.explain(Explainable) API to retrieve all direct explanations (1-rule layer)

raise GraknClientException.of(NONEXISTENT_EXPLAINABLE_CONCEPT, variable)
return explainable

def ownership(self, owner: str, attribute: str) -> "ConceptMap.Explainable":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this typing cracks me up

@flyingsilverfin
Copy link
Member

seems good, lets add one basic integration test using explanations, you can use my client-node one as a reference (altho it doesn't pass yet, for some reason we cant get the explainables out again...)

@alexjpwalker
Copy link
Member Author

seems good, lets add one basic integration test using explanations, you can use my client-node one as a reference (altho it doesn't pass yet, for some reason we cant get the explainables out again...)

Done! The integration test passes.

@alexjpwalker alexjpwalker merged commit eae5454 into typedb:master Mar 31, 2021
@alexjpwalker alexjpwalker deleted the explanations branch March 31, 2021 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants