public class Grakn extends Object
To connect to a knowledge graph, first make sure you have a Grakn Engine server running. You can also instantiate an in-memory knowledge graph for testing or experimentation purposes.
To establish a connection, you first need to obtain a GraknGraphFactory by calling
the factory(String, String) method. A GraknGraphFactory to a given physical
location and specific database instance within that location. Once you've instantiated a factory,
you can obtain multiple concurrent graph connections, represented by the GraknGraph
interface.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_URI
Constant to be passed to
factory(String, String) to specify the default localhost Grakn Engine location. |
static String |
IN_MEMORY
Constant to be passed to
factory(String, String) to specify an in-memory graph. |
| Constructor and Description |
|---|
Grakn() |
| Modifier and Type | Method and Description |
|---|---|
static GraknGraphFactory |
factory(String location,
String keyspace)
Returns a factory instances to produce concurrent connections to the Grakn knowledge graph.
|
public static final String DEFAULT_URI
factory(String, String) to specify the default localhost Grakn Engine location.public static final String IN_MEMORY
factory(String, String) to specify an in-memory graph.public static GraknGraphFactory factory(String location, String keyspace)
This method obtains the GraknGraphFactory for the specified location and keyspace.
location - The location from which to create the graph. For an in-memory graph,
use the IN_MEMORY constant defined in this class. For the default, localhost
Grakn Engine location, use the DEFAULT_URI constant provided in this class.keyspace - The keyspace, or database name, where the knowledge graph is stored. A given
database server will support multiple database instances. You need to explicitly name
the instance to be used. In general, if one doesn't exist, it will be created for you.Copyright © 2016 Grakn Labs Ltd. All rights reserved.