public abstract class GraphDB
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static GraphDB |
instance
The singleton implementation of our graph DB.
|
| Constructor and Description |
|---|
GraphDB() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.apache.tinkerpop.gremlin.structure.Graph |
connectGraphDBImpl(org.apache.commons.configuration2.Configuration config)
Obtain a graph DB with the connection details specified in the given
Configuration. |
static void |
createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String[] keys,
java.lang.Class<?>[] datatypes,
boolean element,
boolean uniq)
Create a single-property index in the given graph DB.
|
static void |
createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String[] keys,
java.lang.Class<?>[] datatypes,
boolean element,
boolean uniq,
boolean mixed)
Create a single-property index in the given graph DB.
|
static void |
createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq)
Create a single-property index in the given graph DB.
|
static void |
createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq,
boolean mixed)
Create a single-property index in the given graph DB.
|
protected abstract void |
createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String[] keys,
java.lang.Class<?>[] datatypes,
boolean element,
boolean uniq,
boolean mixed)
Create a multy-property index in the given graph DB.
|
protected abstract void |
createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq,
boolean mixed)
Create a single-property index in the given graph DB.
|
static org.apache.tinkerpop.gremlin.structure.Graph |
obtainGraphDB(org.apache.commons.configuration2.Configuration config)
Obtain a graph DB with the connection details specified in the given
Configuration. |
private static final GraphDB instance
public static org.apache.tinkerpop.gremlin.structure.Graph obtainGraphDB(org.apache.commons.configuration2.Configuration config)
Configuration.config - The connection details.public static void createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq)
db - The graph DB.key - The property key name to be indexed. This will also be the index name.datatype - The key's type.element - true if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq - true if the index should enforce uniqueness of the given key.public static void createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq,
boolean mixed)
db - The graph DB.key - The property key name to be indexed. This will also be the index name.datatype - The key's type.element - true if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq - true if the index should enforce uniqueness of the given key.mixed - Flag indicating this index will be created in 'mixed' mode, using an external
index.public static void createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String[] keys,
java.lang.Class<?>[] datatypes,
boolean element,
boolean uniq)
db - The graph DB.keys - The property key names to be indexed. This will also be the index name.datatypes - The keys' types.element - true if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq - true if the index should enforce uniqueness of the given key.public static void createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String[] keys,
java.lang.Class<?>[] datatypes,
boolean element,
boolean uniq,
boolean mixed)
db - The graph DB.keys - The property key names to be indexed. This will also be the index name.datatypes - The keys' types.element - true if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq - true if the index should enforce uniqueness of the given key.mixed - Flag indicating this index will be created in 'mixed' mode, using an external
index.protected abstract org.apache.tinkerpop.gremlin.structure.Graph connectGraphDBImpl(org.apache.commons.configuration2.Configuration config)
Configuration.config - The connection details.protected abstract void createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq,
boolean mixed)
TODO: multiple properties and custom index backends.
db - The graph DB.key - The property key name to be indexed. This will also be the index name.datatype - The key's type.element - true if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq - true if the index should enforce uniqueness of the given key.mixed - Flag indicating this index will be created in 'mixed' mode, using an external
index.protected abstract void createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String[] keys,
java.lang.Class<?>[] datatypes,
boolean element,
boolean uniq,
boolean mixed)
db - The graph DB.keys - The property key names to be indexed. This will also be the index name.datatypes - The keys' types.element - true if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq - true if the index should enforce uniqueness of the given key.mixed - Flag indicating this index will be created in 'mixed' mode, using an external
index.