Skip to content

Releases: typedb/typedb-driver

Grakn Client Java 1.7.0

14 Apr 22:13
dab3431
Compare
Choose a tag to compare

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 that relation.getRolePlayerMap() should return a map from Role to List<Thing> rather than Set<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 a Rule instance for the user to access from getRule() 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 of sup()s results in a change of the Java Class itself when going from Entity to Thing.
    To make this change, sup() now generically returns a SchemaConcept instead of a specialised type (such as an Entity always returning a Entity via sup())

Bugs Fixed

  • Close transaction on fully on commit.
    A transaction can currently be committed but still return true for isOpen(). We should have the following behavior:

    1. comitting the tx should close the tx; re-committing the tx should throw an exception
    2. 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 and docs are user-facing repositories that should always depend on the latest stable release of client-java. For this reason, they have been removed from targets of sync-dependencies-snapshot.

  • Update LICENSE.
    In #75 we forgot to rename Grakn Labs Ltd to Grakn Labs

  • Update license year.
    Update year in Apache license and bump build-tools version

Grakn Client Java 1.6.2

17 Jan 12:08
c46c9d6
Compare
Choose a tag to compare

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 updated graql and build-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

04 Dec 23:42
1154587
Compare
Choose a tag to compare

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, where client-java depends on a snapshot version of Graql

Grakn Client Java 1.6.0

25 Nov 17:00
53d597e
Compare
Choose a tag to compare

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 the Explanation tree of a ConceptMap answer. ConceptMap.explanation() does a round trip to the Grakn server and retrieves a list of ConceptMap that explain how the given concept map was obtained. We also restrict Explanation to only be obtainable from ConceptMap, given that we have not implemented Explanation 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 in README

  • Adapt to latest changes in bazel-distribution.
    typedb/bazel-distribution#191 changed the way Maven JARs are built. This PR adapts protocol 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 be api.Type and remove unused method

  • Return Type rather than SchemaConcept in getMetaConcept().
    Recent changes return SchemaConcept instead of Type from tx.getMetaConcept(), which has been reverted to the old beavhior.

  • Add Missing Tx Methods.
    Add missing methods on client.Transaction that were present before, notable the getMeta...() and various execute() methods do with aggregate and compute queries.

  • Add autoclosable to session.
    Previous PR #39 neglected to implement AutoClosable on Session, which is expected in Grakn Core for now

Code Refactors

  • Migrate //common to graknlabs/common.
    Migrate common utility code - specifically Collections, Pair and Triple to depend on common code in graknlabs/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 interfaces grakn.client.concept.api that used to exist in grakn.core.concept.api.
    Previously, we directly exposed the Implementations of each Concept to the user, which included a confusing set of generics being exposed, such as TypeImpl<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-removed Transaction interface -- Transaction.execute(GraqlQuery). This has been re-added.

  • Break Grakn-Core Dependency.
    Remove code dependencies of Client-Java on Grakn Core, specifically api.Transaction and grakn.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 and protocol which are depended by client-java.
    • Add common to the release-validate CI job.
  • 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

25 Sep 09:34
624a824
Compare
Choose a tag to compare

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 in bazel-distribution (typedb/bazel-distribution#181) are backwards-incompatible.

Grakn Client Java 1.5.4

10 Sep 10:56
c38722a
Compare
Choose a tag to compare

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 the apt command in the CI would fail because there is already an existing apt background process started automatically by the machine. This PR uses build-tools's apt-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

18 Jul 13:41
Compare
Choose a tag to compare

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 be artifact-id-version.jar, without the group-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 with grakn- to solve this problem.

  • Fix CI by synchronizing .bazelrc with @graknlabs_build_tools.
    Recent upgrade of bazel version in @graknlabs_build_tools broke CI for client-nodejs. This PR aims to fix it by synchronizing .bazelrc with latest version in build-tools.

Code Refactors

  • Remove dependency on SimpleURI.
    Remove dependency on SimpleURI 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 a GraknClientException.
    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 a COMPLETED 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 an OK response or an ERROR response).

Grakn Client Java 1.5.2

25 Apr 20:10
f672292
Compare
Choose a tag to compare

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

30 Mar 12:07
Compare
Choose a tag to compare

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 with grakn.client. followed by sub-package name, e.g. grakn.client.concept.
  • BatchExecutorClient has been removed, as the new GraknClient 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 the ManagedChannel 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 call client.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 a get query, the explanation for an inferred concept can be retrieved using the ConceptMap.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")