public class SampleKBLoader extends Object
Builds GraknTx bypassing engine.
A helper class which is used to build GraknTx for testing purposes.
This class bypasses requiring an instance of engine to be running in the background.
Rather it acquires the necessary properties for building a graph directly from system properties.
This does however mean that commit logs are not submitted and no post processing is ran
| Modifier | Constructor and Description |
|---|---|
protected |
SampleKBLoader(java.util.function.Consumer<GraknTx> preLoad) |
| Modifier and Type | Method and Description |
|---|---|
static SampleKBLoader |
empty() |
void |
load(java.util.function.Consumer<GraknTx> preLoad) |
static void |
loadFromFile(GraknTx graph,
String file) |
static SampleKBLoader |
preLoad(java.util.function.Consumer<GraknTx> build) |
static SampleKBLoader |
preLoad(String[] files) |
static Keyspace |
randomKeyspace() |
void |
rollback() |
GraknTx |
tx() |
protected SampleKBLoader(@Nullable java.util.function.Consumer<GraknTx> preLoad)
public static SampleKBLoader empty()
public static SampleKBLoader preLoad(java.util.function.Consumer<GraknTx> build)
public static SampleKBLoader preLoad(String[] files)
public GraknTx tx()
public void load(java.util.function.Consumer<GraknTx> preLoad)
public void rollback()
public static Keyspace randomKeyspace()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.