public class BlueprintsGraphManager<T extends com.tinkerpop.blueprints.Graph> extends Object implements GraphManager
This class can be extended for when specific graph implementations (such as Neo4j) can provide more efficient implementations of certain methods.
| Modifier and Type | Field and Description |
|---|---|
protected com.tinkerpop.frames.FramedGraph<T> |
graph |
protected static String |
METADATA_PREFIX |
| Constructor and Description |
|---|
BlueprintsGraphManager(com.tinkerpop.frames.FramedGraph<T> graph) |
| Modifier and Type | Method and Description |
|---|---|
com.tinkerpop.blueprints.Vertex |
createVertex(String id,
EntityClass type,
Map<String,?> data)
Create a vertex with the given id, type, and data.
|
void |
deleteVertex(String id)
Delete a vertex with the given ID.
|
void |
deleteVertex(com.tinkerpop.blueprints.Vertex vertex)
Delete the given vertex.
|
boolean |
exists(String id)
Check if a node with the given ID exists or not.
|
<E> com.tinkerpop.blueprints.CloseableIterable<E> |
getEntities(EntityClass type,
Class<E> cls)
Get an Iterable of vertices of the given type, frames with the given
interface class.
|
<E> com.tinkerpop.blueprints.CloseableIterable<E> |
getEntities(String key,
Object value,
EntityClass type,
Class<E> cls)
Get a CloseableIterable of entities with the given type, and the given
key/value property.
|
<E> E |
getEntity(String id,
Class<E> cls)
Get a node with the given ID, and frame it with the given interface
class.
|
<E> E |
getEntity(String id,
EntityClass type,
Class<E> cls)
Get a node with the given ID and type, framing it with the given
interface class.
|
EntityClass |
getEntityClass(Entity entity)
Get the type of an arbitrary framed vertex.
|
EntityClass |
getEntityClass(com.tinkerpop.blueprints.Vertex vertex)
Get the type of an arbitrary vertex.
|
com.tinkerpop.frames.FramedGraph<T> |
getGraph()
Get a pointer to the underlying graph.
|
String |
getId(com.tinkerpop.blueprints.Vertex vertex)
Get the id of a given vertex.
|
Map<String,Object> |
getProperties(com.tinkerpop.blueprints.Vertex vertex)
Get a vertex's properties.
|
String |
getType(com.tinkerpop.blueprints.Vertex vertex)
Get the id of a given vertex.
|
com.tinkerpop.blueprints.Vertex |
getVertex(String id)
Get a node with the given ID.
|
com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> |
getVertices(EntityClass type)
Get a CloseableIterable of vertices with the given entity class.
|
com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> |
getVertices(Iterable<String> ids)
Get a CloseableIterable of vertices with the given ids.
|
com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> |
getVertices(String key,
Object value,
EntityClass type)
Get a CloseableIterable of vertices with the given type, and the given
key/value property.
|
void |
initialize() |
void |
renameVertex(com.tinkerpop.blueprints.Vertex vertex,
String oldId,
String newId)
Rename an existing vertex, changing its ID.
|
void |
setProperty(com.tinkerpop.blueprints.Vertex vertex,
String key,
Object value)
Set a property on a vertex.
|
com.tinkerpop.blueprints.Vertex |
updateVertex(String id,
EntityClass type,
Map<String,?> data)
Create a vertex with the given id, type, and data.
|
protected static final String METADATA_PREFIX
protected final com.tinkerpop.frames.FramedGraph<T extends com.tinkerpop.blueprints.Graph> graph
public BlueprintsGraphManager(com.tinkerpop.frames.FramedGraph<T> graph)
public com.tinkerpop.frames.FramedGraph<T> getGraph()
GraphManagergetGraph in interface GraphManagerpublic String getId(com.tinkerpop.blueprints.Vertex vertex)
GraphManagergetId in interface GraphManagervertex - A vertexpublic String getType(com.tinkerpop.blueprints.Vertex vertex)
GraphManagergetType in interface GraphManagervertex - A vertexpublic Map<String,Object> getProperties(com.tinkerpop.blueprints.Vertex vertex)
GraphManagergetProperties in interface GraphManagerpublic EntityClass getEntityClass(com.tinkerpop.blueprints.Vertex vertex)
GraphManagergetEntityClass in interface GraphManagervertex - A vertexpublic EntityClass getEntityClass(Entity entity)
GraphManagergetEntityClass in interface GraphManagerentity - A framed vertexpublic boolean exists(String id)
GraphManagerexists in interface GraphManagerid - A string idpublic <E> E getEntity(String id, Class<E> cls) throws ItemNotFound
GraphManagergetEntity in interface GraphManagerid - The vertex's string IDcls - The desired frame classItemNotFoundpublic <E> E getEntity(String id, EntityClass type, Class<E> cls) throws ItemNotFound
GraphManagergetEntity in interface GraphManagerid - The vertex's string IDtype - The entity typecls - The desired frame classItemNotFoundpublic <E> com.tinkerpop.blueprints.CloseableIterable<E> getEntities(EntityClass type, Class<E> cls)
GraphManagergetEntities in interface GraphManagertype - The entity typepublic <E> com.tinkerpop.blueprints.CloseableIterable<E> getEntities(String key, Object value, EntityClass type, Class<E> cls)
GraphManagergetEntities in interface GraphManagerkey - the property keyvalue - property valuetype - the entity typepublic com.tinkerpop.blueprints.Vertex getVertex(String id) throws ItemNotFound
GraphManagergetVertex in interface GraphManagerid - The vertex's string IDItemNotFoundpublic com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> getVertices(EntityClass type)
GraphManagergetVertices in interface GraphManagertype - The entity typepublic com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> getVertices(Iterable<String> ids)
GraphManagergetVertices in interface GraphManagerids - An iterable of String IDspublic com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> getVertices(String key, Object value, EntityClass type)
GraphManagergetVertices in interface GraphManagerkey - the property keyvalue - property valuetype - the entity typepublic com.tinkerpop.blueprints.Vertex createVertex(String id, EntityClass type, Map<String,?> data) throws IntegrityError
GraphManagercreateVertex in interface GraphManagerid - The vertex's string IDtype - The entity typedata - The data mapIntegrityError - if an item with the given id already existspublic com.tinkerpop.blueprints.Vertex updateVertex(String id, EntityClass type, Map<String,?> data) throws ItemNotFound
GraphManagerupdateVertex in interface GraphManagerid - The vertex's string IDtype - The entity typedata - The data mapItemNotFoundpublic void setProperty(com.tinkerpop.blueprints.Vertex vertex,
String key,
Object value)
GraphManagersetProperty in interface GraphManagervertex - The vertexkey - The property keyvalue - The property valuepublic void renameVertex(com.tinkerpop.blueprints.Vertex vertex,
String oldId,
String newId)
GraphManagerrenameVertex in interface GraphManagervertex - the vertexoldId - the old IDnewId - the new IDpublic void deleteVertex(String id) throws ItemNotFound
GraphManagerdeleteVertex in interface GraphManagerid - The vertex's string IDItemNotFoundpublic void deleteVertex(com.tinkerpop.blueprints.Vertex vertex)
GraphManagerdeleteVertex in interface GraphManagervertex - The vertex to deletepublic void initialize()
initialize in interface GraphManagerCopyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.