Install & Run: http://dev.grakn.ai/docs/running-grakn/install-and-run
Highlights:
- New delete syntax
- Server gRPC backpressure
- Remove Implicit Attribute Ownerships
- New Query Options, including
batch_size
andexplain
(required to be set totrue
for explanations to be available)
Note: the DB folder for 1.8 is not backwards compatible with prior versions
New Features
-
Introduce Explanation Cache and Transaction Query
Explain
Option.
When the user requests it, we save answers and the associated Explanation into a specialised cache. Transaction query requests now have anOptions
associated, which have a new option:explain=true/false
. By default, the server usesfalse
.
We no longer have to painstakingly "reconstruct" explanations when the user asks for them. The cache only expands to contain many entries as the user explores explanation trees, only caching the top level Answer - Explanation (top level contains full Explanation tree, so may be large). -
Merge changes from 1.7.2. - gRPC server backpressure
We made some changes in 1.7.2 to add GRPC back pressure in order to address some client issues with server overloading. Without back-pressure, excessive async client requests (possible in the new client releases) could cause the server to become overloaded and run out of memory, taking down the entire server. Since Grakn currently does not have automatic restart or recovery features, this is considered a serious issue so this fix was patched into 1.7.2 during the 1.8 development cycle and now needs to be merged into 1.8 -
Remove implicit types and attribute relations.
Implenting #5614, and invalidates the backwards compatibility of the DB data directory!
We split attribute ownerships from being full Grakn relations, using new storage structures: a simple edge for attribute key/ownerships, and in the schemahas
andkey
are new edge types. A major implication is that queries and reasoning over generic relations will no longer include attribute ownerships. -
**Collect
match
clause before executedelete
, Non-Lazy deletions **
To avoid modifying iterators while traversing, we collect all answers from thematch
clause, closing the iterator, and perform deletions on all the found concept maps -
** Deletes accept statements instead of variables **
match...; delete...
; queries now accept full graql syntax in thedelete
clause.
This means we now:
- can finally remove role players from relations using:
match $r (arole: $x) isa somerelation; delete $r (arole: $x)
- We don't require
via
to remove attribute ownerships anymore, instead write:match $x has attribute $a; delete $x has attribute $a;
- delete an instance using an
isa
clause:match $x isa person; delete $x isa person;
- Replaced the term 'DataType' with 'ValueType'.
We are replacing the termDataType
inAttributeType
withValueType
). Previously, anAttributeType
has aDataType
. And anAttribute
hasValue
. The type ofValue
is defined byDataType
. We can see the inconsistency there. Now,AttributeType
hasValueType
, andAttribute
hasValue
. The type ofValue
isValueType
. So it's all consistent.
Bugs Fixed
-
Graceful session error on server restart.
When opening a session, restarting the server, and continuing to use the session, an null pointer/unknown exception is thrown. This PR improves the error messages reported to the user in cases where the session ID is no longer found on the server. -
Fix too eager query completeness acking for queries with negation.
Fix an occasional reasoning completeness issue encountered when combining negation with other rules.
We track query completeness by explicitly acknowledging that specific queries were exhaustively explored once all iterations were completed inResolutionIterator
. To do that we were using thesubGoals
- queries that were visited during query execution. This approach is however not correct when we deal with queries with negation. Each negation query has its ownResolutionIterator
however the subgoals are injected from the iterator that triggered the negation query. As a result, if the negation query does an exhaustive search which happens when no answers can be found - it can acknowledge completion of queries that were injected but not fully completed. Due to this eager acknowledgment, queries that were actually not exhaustively explored will be omitted during reasoning. We fix this issue in this PR by explicitly tracking queries explored exhaustively within a specificResolutionIterator
and using them insted ofsubGoals
to ack their completion once all iterations have finished -
Fix test-deployment-rpm due to missing python3 dependencies.
We have fixed test-deployment-rpm caused by missing python3 dependencies. -
Fix test-assembly-windows-zip by adding python3 to path.
Fix test-assembly-windows-zip by adding python3 to path -
Re-enable copying attribute values across types.
Allow copying an attribute value across types, using a rule. This was enabled in the past, but at some point between 1.6.2 and 1.7.1, a refactor accidentally caused this feature to be lost. This PR re-adds it by relaxing overly-strict constraints inAttributeSemanticProcessor
, and adds a test for this case. -
Deletion - fix ordering bug.
In some complex deletion cases, we must delete attribute ownerships and role playing first, followed by relations instances and other instances. We applied an incorrect tie breaker, resulting in deleting relations before attribute ownerships, resulting invertex deleted
exceptions from Janus. We also enforce deleting attribute ownerships before role players, as role player deletion could lead to cascading deletions. -
Apply correct tx type for incoming RPC transaction requests.
Previous PR had accidentally always returned a WRITE transaction regardless of what the client had requested. This PR adds another test for this situation that tests it via the RPC interface to Grakn Core, and resolves the issue. -
Fix issue with too eager subgoal propagation for queries with negation.
Negation queries are short circuited when one contradiction is found from the negation block. However, we mark negation sub-queries as fully explored by adding the sub-query to the visitedsubgoals
that is shared globally. We then re-visit the same state at another point while exploring the negation query. However, we are missing answers, since the cache will only contain a single answer to the visited sub-query, not all of them. This means we can miss other solutions to the negation block. This is the underlying problem of #5697.
Code Refactors
-
Fixed implementation of Thing.keys(types).
There was a bug inThingImpl.keys(AttributeType<?>... attributeTypes)
, where it would always return all instances of all key types, even when the user provided a subset of the key types in the argument. Additionally, the implementation can be made more readable and efficient, which could have contributed to why the bug existed in the first place. -
Refactor test packages.
Multiple test currently reach across package boundaries to utilise theGraknTestServer
or thetest-integration/logback.xml
. We can fix this architecture and resolve #5043 at the same time.
Other Improvements
-
Enable Graql Unit Tests in CI and remove bad merge directories.
Fix Graql unit tests, and add them to CI so they are executed going forward.
Also, remove a copy of directories that probably resulted from a merge process that were duplicate and outside of the new test package structure (previously, had integration tests outside, now insidetest/
. -
Discord badge added.
Slack badge changed to discord badge -
Bump console dep to be 1.8 compatible.
We bump theconsole
dependency to a newer version that is compatible with client-java 1.8 and 1.8. -
Include protocol datetime instead of date.
We update the protocol to include new usage ofdatetime
instead ofdate
, which is reflected here. vaticle/typedb-protocol#34 . -
Add platform-specific instructions for installing Bazelisk.
In #5732 we added instructions on how to build Core usingbazelisk
. This PR elaborates on them by providing platform-specific instructions on installing Bazelisk itself. -
Update README to mention Bazelisk.
Ensure whoever wants to build Grakn Core from sources uses the correct Bazel version. -
Bump Graql Dependency and use
DateTime
.
Re-synchronise dependencies to usemaster
of different repositories. This change includes usingdatetime
instead ofdate
for the Date attribute type. -
Support for Graql Delete and validate keys on deletion of ownership.
Delete BDD scenarios are implemented in vaticle/typedb-behaviour#38 - this PR implements the new steps required to execute the new scenarios. We also find and fix a bug where validation was not performed for keys when attributes were "un-owned". -
Update circle ci file for incorrect behavior steps.
Fix the CI file that ran thetransaction
behaviour tests twice and not theundefine
behaviour tests at all.