IBM Graph Java client library

This Java client provides basic access to the IBM Graph engine.

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.ibm.graph
ArtifactId

ArtifactId

graphclient
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

IBM Graph Java client library
This Java client provides basic access to the IBM Graph engine.
Project URL

Project URL

https://github.com/ibm-cds-labs/java-graph
Source Code Management

Source Code Management

https://github.com/ibm-cds-labs/java-graph/tree/master

Download graphclient

How to add to project

<!-- https://jarcasting.com/artifacts/com.ibm.graph/graphclient/ -->
<dependency>
    <groupId>com.ibm.graph</groupId>
    <artifactId>graphclient</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.ibm.graph/graphclient/
implementation 'com.ibm.graph:graphclient:0.1.0'
// https://jarcasting.com/artifacts/com.ibm.graph/graphclient/
implementation ("com.ibm.graph:graphclient:0.1.0")
'com.ibm.graph:graphclient:jar:0.1.0'
<dependency org="com.ibm.graph" name="graphclient" rev="0.1.0">
  <artifact name="graphclient" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ibm.graph', module='graphclient', version='0.1.0')
)
libraryDependencies += "com.ibm.graph" % "graphclient" % "0.1.0"
[com.ibm.graph/graphclient "0.1.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.apache.httpcomponents : httpclient jar 4.5.2
org.apache.httpcomponents : httpmime jar 4.5.2
org.apache.wink : wink-json4j jar 1.4
org.apache.commons : commons-lang3 jar 3.5
org.slf4j : slf4j-api jar 1.7.21

test (2)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.21
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Experimental Java Client for IBM Graph

🚫 This project is no longer maintained

This is an Experimental Java library for working with IBM Graph.

Currently the library supports:

  • Executing Gremlin queries
  • Adding/switching/deleting graphs
  • Adding/getting/updating/deleting vertices
  • Adding/getting/updating/deleting edges
  • Creating/loading/updating schema
  • Deleting indexes
  • Data loading from GraphSON
  • Data loading from GraphML

How to consume

Add the following dependency to your application's pom.xml:

   <dependency>
      <groupId>com.ibm.graph</groupId>
      <artifactId>graphclient</artifactId>
      <version>0.1.0</version>
    </dependency> 

Use this link to identify the latest library version.

The following example illustrates how to create a graph and connect to it. Refer to the Sample application or the Javadoc for details on how to manipulate and traverse a graph using this library.

// connect to IBM Graph service
IBMGraphClient graphClient = new IBMGraphClient(apiURL, username, password);
// create a new graph
String graphId = graphClient.createGraph();
// switch to new graph
graphClient.setGraph(graphId);

How to build

To build and unit test the library

$ git clone https://github.com/ibm-cds-labs/java-graph.git
$ cd java-graph
$ cf create-service "IBM Graph" Standard ibm-graph-test
$ cf create-service-key ibm-graph-sample Credentials-1
$ cf service-key ibm-graph-test Credentials-1
$ export TEST_API_URL=<apiURL from Credentials-1>
$ export TEST_USERNAME=<username from Credentials-1>
$ export TEST_PASSWORD=<password from Credentials-1>
$ mvn clean package

Source code and javadoc are located in the target directory.

To build the library and skip the JUNIT test

$ git clone https://github.com/ibm-cds-labs/java-graph.git
$ cd java-graph
$ mvn clean package -Dmaven.test.skip=true

To build and install the library in your local Maven repository

$ git clone https://github.com/ibm-cds-labs/java-graph.git
$ cd java-graph
$ mvn clean install -Dmaven.test.skip=true -Dgpg.skip=true

How to test

To run the JUnit tests

$ git clone https://github.com/ibm-cds-labs/java-graph.git
$ cd java-graph
$ cf create-service "IBM Graph" Standard ibm-graph-test
$ cf create-service-key ibm-graph-sample Credentials-1
$ cf service-key ibm-graph-test Credentials-1
$ export TEST_API_URL=<apiURL from Credentials-1>
$ export TEST_USERNAME=<username from Credentials-1>
$ export TEST_PASSWORD=<password from Credentials-1>
$ mvn clean test

Edit /src/test/resources/simplelogger.properties and follow the instructions to enable DEBUG output.

Versions

Version
0.1.0