Releases: typedb/typedb-driver
Grakn Client Java 1.7.0
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>grakn-client</artifactid>
<version>{version}</version>
</dependency>
</dependencies>
New Features
-
Allow duplicate role players.
Allowing duplicate roles to be played in a relation as of typedb/typedb#5667.
This means now thatrelation.getRolePlayerMap()
should return a map fromRole
toList<Thing>
rather thanSet<Thing>
-
Read rules from the explanation response proto.
The rule that an explanation is explaining is now returned inside the explanation object. We receive this message via the gRPC and build aRule
instance for the user to access fromgetRule()
on an explanation.
This requires typedb/typedb-protocol#24
and is required by typedb/typedb#5657 -
Modify sup() behavior of Types Concept API.
We previously had the behavior that the supertype of one of the base types (Entity
,Relation
,Attribute
) returned null. This was because going further up the chain ofsup()
s results in a change of the Java Class itself when going fromEntity
toThing
.
To make this change,sup()
now generically returns aSchemaConcept
instead of a specialised type (such as anEntity
always returning aEntity
viasup()
)
Bugs Fixed
-
Close transaction on fully on commit.
A transaction can currently be committed but still returntrue
forisOpen()
. We should have the following behavior:- comitting the tx should close the tx; re-committing the tx should throw an exception
- closing a committed/closed tx should be idempotent and do nothing.
-
Fix nullpointer when there is a NOOP trace on the thread.
To fix a bug when there is a NOOP trace on the thread.
Code Refactors
Other Improvements
-
Refactor GraknClient public methods and add grabl tracing.
To add grabl tracing to GraknClient. -
Implement insert behavior BDD tests.
Implement steps and behaviors for Insert Graql BDD scenarios. Add BDD to CircleCI jobs. -
Add steps for tx commit and close BDD.
To match BDD steps for transaction close and commit, we implement corresponding steps for commit throwing and closing transactions explicitly -
Graql Behavior Steps and Define.
Create the framework for BDD-based definitions of the graql behavior tests. This includes creating the step definitions for testing graql queries. -
Test transactions new.
To implement transaction tests as defined in@graknlabs_behaviour//connection/transaction.feature
. -
Add tracing metadata to requests.
To add grabl tracing information to the metadata in the requests so that we can continue the tracing on the Grakn server side. -
Upgrade to Bazel 3.0.0.
Upgrade Bazel to latest upstream version -
Add sync-deps marker for grabl-tracing.
Add a sync-dependencies marker for grabl-tracing. -
Fix excessive rebuilding.
Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in this thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). -
Undefine and Match BDD tests.
Implement and get the Undefine and match BDD tests up and running. -
Avoids running
sync-dependencies-snapshot
on user-facing repositories.
examples
anddocs
are user-facing repositories that should always depend on the latest stable release ofclient-java
. For this reason, they have been removed from targets ofsync-dependencies-snapshot
. -
Update LICENSE.
In #75 we forgot to renameGrakn Labs Ltd
toGrakn Labs
-
Update license year.
Update year in Apache license and bumpbuild-tools
version
Grakn Client Java 1.6.2
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>grakn-client</artifactid>
<version>{version}</version>
</dependency>
</dependencies>
New Features
Bugs Fixed
- Upgrade gRPC to 1.16.0.
Upgrade gRPC version to match one in@graknlabs_protocol
Code Refactors
Other Improvements
-
Update Graql and Build Tools.
We have updatedgraql
andbuild-tools
. It fixes the broken build issue caused by the fact that Maven Central artefacts were no longer accessible as the URLs were all HTTP instead of HTTPS. -
Upgrade grpc to 1.24.1.
Update gRPC to a more recent version
Grakn Client Java 1.6.1
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>grakn-client</artifactid>
<version>{version}</version>
</dependency>
</dependencies>
New Features
Bugs Fixed
- Fix the issue of depending on a snapshot version of Graql.
We have fixed the issue which exist in 1.6.0, whereclient-java
depends on a snapshot version of Graql
Grakn Client Java 1.6.0
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>grakn-client</artifactid>
<version>{version}</version>
</dependency>
</dependencies>
New Features
- Retrieve Explanations Sequentially.
Matching protocol changes in typedb/typedb-protocol#20, we now iteratively retrieve layers of theExplanation
tree of aConceptMap
answer.ConceptMap.explanation()
does a round trip to the Grakn server and retrieves a list ofConceptMap
that explain how the given concept map was obtained. We also restrictExplanation
to only be obtainable fromConceptMap
, given that we have not implementedExplanation
on delete, count, etc. queries.
Bugs Fixed
-
Client-Java bugfix due to netty errors.
De-conflict netty dependency that was causing server and client-java errors in the tests. -
Fix a typo in README.
Fix a typo in Bazel target name inREADME
-
Adapt to latest changes in bazel-distribution.
typedb/bazel-distribution#191 changed the way Maven JARs are built. This PR adaptsprotocol
to latest changes -
Fix data in generated pom.xml.
Fix #26
Specify fields needed for Maven Central deployment -
Minor bugfixes.
Change incorrect return type to beapi.Type
and remove unused method -
Return Type rather than SchemaConcept in getMetaConcept().
Recent changes returnSchemaConcept
instead ofType
fromtx.getMetaConcept()
, which has been reverted to the old beavhior. -
Add Missing Tx Methods.
Add missing methods onclient.Transaction
that were present before, notable thegetMeta...()
and variousexecute()
methods do with aggregate and compute queries. -
Add autoclosable to session.
Previous PR #39 neglected to implementAutoClosable
onSession
, which is expected in Grakn Core for now
Code Refactors
-
Migrate //common to graknlabs/common.
Migrate common utility code - specificallyCollections
,Pair
andTriple
to depend on common code ingraknlabs/common
-
Refactor how version is provided to deployment rules.
Adapt@graknlabs_client_java
to latest changes in bazel-distribution (in particular, typedb/bazel-distribution#150) -
Re-implement grakn.client.concept.api Interfaces.
Reimplement the interfacesgrakn.client.concept.api
that used to exist ingrakn.core.concept.api
.
Previously, we directly exposed the Implementations of eachConcept
to the user, which included a confusing set of generics being exposed, such asTypeImpl<T extends SchemaConcept, S extends Thing> extends SchemaConceptImpl<...
.
So, to re-introduce a clean user API for concepts, the interface has been added back in.
The difference being able to do:// BEFORE either of these options: Stream instances = typeImpl.instances() //receive an untyped stream // OR enforce this: TypeImpl<Type, Thing> type = .... Stream<Thing> instances = type.instances(); // now we can receive properly constrained stream
and now we can more cleanly write:
Stream<Thing> instances = type.instances();
-
Readd missing Tx And ConceptMap methods.
Prior refactors forgot to re-implemented generic query methods from the now-removedTransaction
interface --Transaction.execute(GraqlQuery)
. This has been re-added. -
Break Grakn-Core Dependency.
Remove code dependencies of Client-Java on Grakn Core, specificallyapi.Transaction
andgrakn.core.concept
interfaces. This will allow us to update Client-Java independently of Grakn, only fixing compatibility issues mandated by the protocol, in line with the other drivers.
Resolves #5288, #5289, and part of #5272
Other Improvements
-
Prepare for a release by update graknlabs_common and graknlabs_protocol to release versions.
- We've updated
common
andprotocol
which are depended byclient-java
. - Add
common
to therelease-validate
CI job.
- We've updated
-
Add Apache License header to everything.
Fix #34 -
Behaviour-driven test implementation for client-java - Part 1.
Client Java implementation for the behaviour-driven test outline in issue typedb/typedb#4458.
Grakn Client Java 1.5.5
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>grakn-client</artifactid>
<version>{version}</version>
</dependency>
</dependencies>
New Features
Bugs Fixed
Code Refactors
Other Improvements
-
Use release-validate-deps to ensure that client-java depends on released versions of grakn and protocol.
We have added a validation step using//ci:release-validate-deps
in order to ensure that client-java is releasable only if it depends on released versions of grakn and protocol -
Adapt to latest @graknlabs_bazel_distribution.
Newest changes inbazel-distribution
(typedb/bazel-distribution#181) are backwards-incompatible.
Grakn Client Java 1.5.4
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>grakn-client</artifactid>
<version>1.5.4</version>
</dependency>
</dependencies>
New Features
- Supply authentication credentials for keyspace operations.
Recent changes in protocol (typedb/typedb-protocol#7) allow keyspace operations to be authenticated. This PR adapts Grakn Client Java to these recent changes.
Bugs Fixed
- Throw correct exception on failures with keyspace operations.
Failures with keyspace operations should throw exceptions of correct kind (GraknClientException
) instead of raw RPC exceptions.
Code Refactors
- Update License to 2019.
Other Improvements
-
CI job now waits for an existing apt process to finish before proceeding.
Sometimes theapt
command in the CI would fail because there is already an existingapt
background process started automatically by the machine. This PR usesbuild-tools
'sapt-wait.sh
to wait for it to finish before proceeding. -
Add Marco and Haikal as the code owners.
We've added Marco and Haikal as the code owners as the biggest contributors to the repository. -
Supply a title to Github Release.
Make GitHub releases less prone to error
Grakn Client Java 1.5.3
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>grakn-client</artifactid>
<version>1.5.3</version>
</dependency>
</dependencies>
Bugs Fixed
-
Prefixed artifact IDs of Maven packages with 'grakn-'.
When deploying Maven JARs to Sonatype, the JARs are renamed to beartifact-id-version.jar
, without thegroup-id
. This is done in Sonatype because the JARs are organised into folders where the folder names represent the Group IDs. However, in certain build systems, e.g. Gradle, the JARs are collected under one directory, which means the JAR names are not unique enough to disambiguate itself from each other. We have now renamed the artifact ID of our Maven packages to be prefixed withgrakn-
to solve this problem. -
Fix CI by synchronizing .bazelrc with @graknlabs_build_tools.
Recent upgrade ofbazel
version in@graknlabs_build_tools
broke CI forclient-nodejs
. This PR aims to fix it by synchronizing.bazelrc
with latest version inbuild-tools
.
Code Refactors
-
Remove dependency on SimpleURI.
Remove dependency onSimpleURI
class which is not used anywhere else and will be soon deleted from Grakn common package -
Propagate full exception on Error.
Before we were only propagating the error message when getting a grpc exception, this would hide the real issue sometimes.
With this PR client Java will report the full exception when throwing aGraknClientException
.
This is needed when reporting internal exceptions, e.g.:Caused by: io.grpc.StatusRuntimeException: at io.grpc.Status.asRuntimeException(Status.java:526) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:434) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:678) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:403) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459) at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:531) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: io.grpc.StatusRuntimeException: INTERNAL: Invalid protobuf byte sequence at io.grpc.Status.asRuntimeException(Status.java:517) at io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller.parse(ProtoLiteUtils.java:218) at io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller.parse(ProtoLiteUtils.java:118) at io.grpc.MethodDescriptor.parseResponse(MethodDescriptor.java:266) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:519) ... 5 more Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message had too many levels of nesting. May be malicious. Use CodedInputStream.setRecursionLimit() to increase the depth limit. at com.google.protobuf.InvalidProtocolBufferException.recursionLimitExceeded(InvalidProtocolBufferException.java:132)
-
Handle query cancellation.
We want to enable the possibility to cancel running queries.
This PR updates client-java to handle interrupted state of Transaction, more specifically:
it might now happen that the client, while blocked on a queue waiting for the server response, receives aCOMPLETED
response. This case was not handled before as it was not possible to complete a connection while a query was running (before we were expecting either anOK
response or anERROR
response).
Grakn Client Java 1.5.2
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>api</artifactid>
<version>1.5.2</version>
</dependency>
</dependencies>
Changelogs
- Supports Grakn Core 1.5.2 (PR 14)
Grakn Client Java 1.5.0
Documentation: http://dev.grakn.ai/docs/client-api/java
Distribution
Now officially available through https://repo.grakn.ai
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupid>io.grakn.client</groupid>
<artifactid>api</artifactid>
<version>1.5.0</version>
</dependency>
</dependencies>
Architecture
- The architecture for client-java has been significantly refactored and cleaned up.
- The client-java module no longer depends on server. This means, adding client-java as a dependency (e.g. through Maven) no longer pulls in transitive dependencies from Grakn Core server and other heavy-weight and low-level dependencies. This makes client-java much lighter, and easier to use and manage.
- The client-java module now has its own repository (hit star on graknlabs/client-java!). This allows us to iterate on client-java more flexibly, independent of grakn-core.
- The client-java driver will be compatible for both grakn-core and grakn-kgms (starting from
client-java:1.5.2
). - New Maven coordinates:
grakn.client:api:{version}
, and new package address: starts withgrakn.client.
followed by sub-package name, e.g.grakn.client.concept
.
BatchExecutorClient
has been removed, as the newGraknClient
provides the full expressivity for you to create your own "batch loader" which streams over RPC to the server.- Removed performance benchmark instrumentation from client-java. We don't need to extend
GraknClient
with additional constructors for performance tracing, because not only it makes the codebase heavier, it also doesn't cover all use cases. So now we simply provide the ability to override theManagedChannel
with a custom built one by calling.overrideChannel(...)
.
API
- In addition to calling
transaction.close()
at the end of a transaction,session.close()
at the end of a session, now you should also callclient.close()
at the end of using the database to close the actual HTTP2 connection to the server. - Reasoner Explanation is now available through client-java. For every
ConceptMap
in the list of answers (List<ConceptMap>
) of aget
query, the explanation for an inferred concept can be retrieved using theConceptMap.explanation()
method. - New functionalities for managing keyspaces through client-java:
- List all keyspaces by calling
client.keyspaces().retrieve()
- Delete a keyspace by calling
client.keyspaces().delete("keyspacename")
- List all keyspaces by calling