Grakn Core 1.3.0
Grakn Core 1.3 has been unleashed!
Finally, the long-awaited 1.3 release has arrived! Kudos to our Grakn team (kuple-kuple!), and thank you to everyone in our community for helping us improve Grakn every day!
There is an incredible amount of work that has gone into this PR. So much so, that it has taught us the lesson to make much smaller releases and to do so more frequently. Below is the list of changes in this release. We’ve got quite exciting news to share, we hope you enjoy reading about it and we look forward to seeing you upgrade to it!
New Language Drivers
The changes and improvements in this category are actually very extensive for each component, but we'll keep the summary at a high level because the modules have either been heavily re-written or are completely new. And, all Grakn Client Drivers are released under the Apache 2 license!
- New client driver protocol (client-protocol): we now provide access to Grakn via a GRPC (Google’s Remote Procedure Call) framework, which allows us to provide Grakn drivers directly in more native languages! Please reach out to us if you’d like to collaborate on writing a Grakn driver in a new programming language!
- New Java client driver (client-java): we’ve upgraded our Java client driver to implement the latest GRPC protocol and fully support all Graql queries in a Java client.
- We've also migrated from our own Maven server to OSS Sonatype, so you can import our libraries from oss.sonatype.org, as instructed in Java Library Setup.
- New NodeJS client driver (client-nodejs): we’ve upgraded our NodeJS client driver to implement the latest GRPC protocol and fully support all Graql queries in a NodeJS client.
- New Python client Driver (client-python): we’ve upgraded our Python client driver to implement the new GRPC protocol and fully support all Graql queries in a Python client.
Engine
(This module will soon be renamed to "Server".)
-
New RPC Server, implemented using GRPC (Google’s Remote Procedure Call) framework - it's all about performance and control! So far, we've implemented 2 "services" for any Graql driver (in any language) to interact with Grakn remotely:
- Session Service: provides the full API of Grakn Transactions. This includes the Graql query API, as well as the all of the methods in the Concept API.
- Keyspace Service: provides Keyspace management functionalities -
create
,retrieve
, anddelete
. Onlyretrieve
anddelete
have been implemented in this release -create
will follow soon.
-
Improved boot-up process:
- No longer fails to start because it could not find the PID.
- Properly exits with code 1 on failure.
- Boots up even when located on a path which has whitespaces.
- Terminates immediately when there is a bootup failure.
- Outputs
stderr
into the log file whenever an error occurs. - The
grakn-bootup
module has been removed, and the codebase merged intograkn-engine
.
Graql: usability and performance
The following are the medium to large changes and improvements in this release. There have been a lot of smaller improvements and bug fixes that may not be included in this list.
-
Refinement of the Graql
compute
queriesWe have an improved Graql
compute
query grammar (Graql.g4:23-75) that produces a more generic and expressive language for analytics, whilst making it simpler to use. The new Graqlcompute
query now has the following behaviour:- A simple structure of:
compute <method> <conditions>? ;
- Uses commas (
,
) properly instead of semicolons (;
), and - Uses square brackets (
[
and]
) to provide a list of arguments. - Improved error messages for Graql
compute
queries.
Thus, analytics queries will look like:
compute cluster in [person, marriage], using connected-component, where [start = "V123"];
- A simple structure of:
-
Refinement of the Graql
compute path
queryGraql
compute path
(that returns one shortest path) andcompute paths
(that returns all shortest paths) are now merged into justcompute path
that returns all shortest paths. This change is also followed by:- Improved performance by streaming the results of
compute path
(which is a list of paths), both on server-side and client-side queries.
- Improved performance by streaming the results of
-
Graql reasoning
- Improved performance by considering rule resolvability and query atomicity when planning resolution.
- Improved performance for queries with missing type labels.
- Added transaction-level rule cache to improve performance with large rule bases.
- Added extra rule pruning step to improve performance with large rule bases.
- Improved query planning to guarantee production of complete plans.
- Improved validation of resolution plans.
- Corrected behaviour of
isa!
patterns. - Optimised propagation of partial substitutions within queries with
neq
predicates. - Fixed query cache inconsistencies involving disconnected id predicates and surplus variable mappings.
- Corrected behaviour of rules that attach a role player to an existing and/or new relations.
- Improved correctness of atom decomposition for conjunctions.
- Removed the
materialise
option for inferred answers as it unnecessarily cluttered the code, and the functionality can be accomplished straight-forwardly with the current API. - Improved resolution logging to be more meaningful.
-
Disambiguation of equality comparison operators
$x = $y
requires $x and $y to be the same concept$x != $y
requires $x and $y to be different concepts$x == $y
requires $x and $y to have the same value$x !== $y
requires $x and $y to have different values- As a result, the
val
keyword became redundant, thus it has been removed.
-
Concept API
- A lot of method renaming to be simpler, and more aligned with Graql terminology.
- Lightened the dependencies by removing TinkerPop.
-
Unification of Graql Query Answers
- All Graql queries now return a
List
ofAnswer
s, whereAnswer
could be one of 6 types of common data structures:Value
,ConceptMap
,ConceptList
,ConceptSet
,ConceptSetMeasure
, andAnswerGroup
. This includes queries that previously returned a single or void value, such asdelete
andaggregate
queries. - Given the above change, all Graql queries are now streamable.
- A
delete
query now returns the list ofConceptId
s that it has deleted. - Several
aggregate
queries are removed because they do not fit with any data structure, and do not deliver a strong and unique use case:ask
,select
, andas
aggregate. They have plenty of workarounds too.
- All Graql queries now return a
-
Graql correctness and reliability
- Graql queries that perform
match
over both instance and schema concepts now work correctly. - Graql queries of the form
match(...).get(var("x"))
(single var) no longer crash on remoteclient-java
. - Improved various error message and exception handling.
- Upgraded TinkerPop to 3.2.9 and removed the dependency on our custom TinkerPop
3.2.5-grakn-snapshot
. - Fixed
delete
queries to work remotely, and with an arbitrary number of given variables. match-insert
queries now execute inserts before streaming results.- Improved exception logging for execution of remote Graql queries via GRPC.
match-get
queries containing a relationship with roleplayers that share a role no longer break on remoteclient-java
.- Graql
aggregate count
queries now take in a variable in which it computes count on a distinct set of results. - Graql
aggregate
andcompute
queries that perform a numerical computation no longer return a just a value. Instead, they return a list containing the value. Therefore, when there are no instances of the aggregated attribute type, we no longer return a null value, but rather an empty list. I.e.match $x isa person, has age $y; aggregate min $y;
will return an empty list{}
, rather than 0, if there are no instances of anage
connected to a person in the graph.
- Graql queries that perform
Visualisation Dashboard
There hasn't been a lot of work going into Grakn Visualisation Dashboard. That's because we're putting all our effort on getting Grakn Workbase together - and it will be released very soon!
-
Added a command option to the main menu to display a window that lists all possible commands/shortcuts.
-
Added a button in the node settings panel to reset attribute labels of a concept.
-
Added a relationship settings to allow users to configure whether to autoload role players and also to limit them.
Continuous Integration
This may be more important/relevant to the Grakn developers than Grakn users right now, but as we prepare our codebase to be contributor-friendly, cleaning up our Continuous Integration framework is one of the first important steps.
-
All Grakn tests are now tested on CircleCI, which can be found at: circleci.com/gh/graknlabs.
-
More bootup, distribution and release integration tests have been added.
-
Notifications of GitHub Pull Requests and CI test run status can also be found in #github channel of the Grakn Community Slack (you can join here if you haven't: grakn.ai/slack).