Skip to content
Java API for RedisGraph
Branch: master
Clone or download
Latest commit a30ba55 Mar 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
src
.circleci.settings.xml
.gitignore
LICENSE
README.md
pom.xml

README.md

license CircleCI Maven Central GitHub issues Javadocs Codecov

JRedisGraph

RedisGraph Java client

Official Releases

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jredisgraph</artifactId>
      <version>1.0.4</version>
    </dependency>
  </dependencies>

Snapshots

  <repositories>
    <repository>
      <id>snapshots-repo</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

and

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jredisgraph</artifactId>
      <version>1.0.5-SNAPSHOT</version>
    </dependency>
  </dependencies>

Example: Using the Java Client

package com.redislabs.redisgraph;

public class RedisGraphExample {
	public static void main(String[] args) {

		RedisGraphAPI api = new RedisGraphAPI("social");

		api.query("CREATE (:person{name:'roi',age:32})");
		api.query("CREATE (:person{name:%s,age:%d})", "amit", 30);

		api.query("MATCH (a:person), (b:person) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[:knows]->(b)");

		ResultSet resultSet = api.query("MATCH (a:person)-[:knows]->(b:person) RETURN a, b");

		while(resultSet.hasNext()){
			Record record = resultSet.next();
			System.out.println(record.getString("a.name"));
		}
	}
}
You can’t perform that action at this time.