public abstract class GraphBase extends Object implements Graph
| Modifier | Constructor and Description |
|---|---|
protected |
GraphBase() |
| Modifier and Type | Method and Description |
|---|---|
Edge |
addEdge(String edgeId,
String outVertexId,
String inVertexId,
String label,
Visibility visibility,
Authorizations authorizations)
Adds an edge between two vertices.
|
Edge |
addEdge(String outVertexId,
String inVertexId,
String label,
Visibility visibility,
Authorizations authorizations)
Adds an edge between two vertices.
|
Edge |
addEdge(String edgeId,
Vertex outVertex,
Vertex inVertex,
String label,
Visibility visibility,
Authorizations authorizations)
Adds an edge between two vertices.
|
Edge |
addEdge(Vertex outVertex,
Vertex inVertex,
String label,
Visibility visibility,
Authorizations authorizations)
Adds an edge between two vertices.
|
void |
addGraphEventListener(GraphEventListener graphEventListener)
Adds a graph event listener that will be called when graph events occur.
|
Vertex |
addVertex(String vertexId,
Visibility visibility,
Authorizations authorizations)
Adds a vertex to the graph.
|
Vertex |
addVertex(Visibility visibility,
Authorizations authorizations)
Adds a vertex to the graph.
|
Iterable<Vertex> |
addVertices(Iterable<ElementBuilder<Vertex>> vertices,
Authorizations authorizations)
Adds the vertices to the graph.
|
abstract DefinePropertyBuilder |
defineProperty(String propertyName)
Creates a defines property builder.
|
Map<String,Boolean> |
doEdgesExist(List<String> ids,
Authorizations authorizations)
Tests the existence of edges with the given authorizations.
|
boolean |
doesEdgeExist(String edgeId,
Authorizations authorizations)
Tests the existence of a edge with the given authorizations.
|
boolean |
doesVertexExist(String vertexId,
Authorizations authorizations)
Tests the existence of a vertex with the given authorizations.
|
Map<String,Boolean> |
doVerticesExist(List<String> ids,
Authorizations authorizations)
Tests the existence of vertices with the given authorizations.
|
Iterable<Path> |
findPaths(String sourceVertexId,
String destVertexId,
int maxHops,
Authorizations authorizations)
Finds all paths between two vertices.
|
Iterable<Path> |
findPaths(String sourceVertexId,
String destVertexId,
int maxHops,
ProgressCallback progressCallback,
Authorizations authorizations)
Finds all paths between two vertices.
|
Iterable<Path> |
findPaths(Vertex sourceVertex,
Vertex destVertex,
int maxHops,
Authorizations authorizations)
Finds all paths between two vertices.
|
Iterable<Path> |
findPaths(Vertex sourceVertex,
Vertex destVertex,
int maxHops,
ProgressCallback progressCallback,
Authorizations authorizations)
Finds all paths between two vertices.
|
Iterable<String> |
findRelatedEdges(Iterable<String> vertexIds,
Authorizations authorizations)
Given a list of vertex ids, find all the edge ids that connect them.
|
protected void |
fireGraphEvent(GraphEvent graphEvent) |
abstract void |
flush()
Flushes any pending mutations to the graph.
|
Edge |
getEdge(String edgeId,
Authorizations authorizations)
Get an edge from the graph.
|
Edge |
getEdge(String edgeId,
EnumSet<FetchHint> fetchHints,
Authorizations authorizations)
Get an edge from the graph.
|
Iterable<Edge> |
getEdges(Authorizations authorizations)
Gets all edges on the graph.
|
abstract Iterable<Edge> |
getEdges(EnumSet<FetchHint> fetchHints,
Authorizations authorizations)
Gets all edges on the graph.
|
Iterable<Edge> |
getEdges(Iterable<String> ids,
Authorizations authorizations)
Gets all edges on the graph matching the given ids.
|
Iterable<Edge> |
getEdges(Iterable<String> ids,
EnumSet<FetchHint> fetchHints,
Authorizations authorizations)
Gets all edges on the graph matching the given ids.
|
abstract Iterable<GraphMetadataEntry> |
getMetadata()
Gets all metadata.
|
Object |
getMetadata(String key)
Gets metadata from the graph.
|
abstract SearchIndexSecurityGranularity |
getSearchIndexSecurityGranularity()
Gets the granularity of the search index
SearchIndexSecurityGranularity |
Vertex |
getVertex(String vertexId,
Authorizations authorizations)
Get a vertex from the graph.
|
Vertex |
getVertex(String vertexId,
EnumSet<FetchHint> fetchHints,
Authorizations authorizations)
Get a vertex from the graph.
|
Iterable<Vertex> |
getVertices(Authorizations authorizations)
Gets all vertices on the graph.
|
abstract Iterable<Vertex> |
getVertices(EnumSet<FetchHint> fetchHints,
Authorizations authorizations)
Gets all vertices on the graph.
|
Iterable<Vertex> |
getVertices(Iterable<String> ids,
Authorizations authorizations)
Gets all vertices matching the given ids on the graph.
|
Iterable<Vertex> |
getVertices(Iterable<String> ids,
EnumSet<FetchHint> fetchHints,
Authorizations authorizations)
Gets all vertices matching the given ids on the graph.
|
List<Vertex> |
getVerticesInOrder(Iterable<String> ids,
Authorizations authorizations)
Gets all vertices matching the given ids on the graph.
|
List<Vertex> |
getVerticesInOrder(Iterable<String> ids,
EnumSet<FetchHint> fetchHints,
Authorizations authorizations)
Gets all vertices matching the given ids on the graph.
|
protected boolean |
hasEventListeners() |
abstract boolean |
isFieldBoostSupported()
Determine if field boost is support.
|
boolean |
isQuerySimilarToTextSupported() |
EdgeBuilderByVertexId |
prepareEdge(String outVertexId,
String inVertexId,
String label,
Visibility visibility)
Prepare an edge to be added to the graph.
|
EdgeBuilder |
prepareEdge(Vertex outVertex,
Vertex inVertex,
String label,
Visibility visibility)
Prepare an edge to be added to the graph.
|
VertexBuilder |
prepareVertex(Visibility visibility)
Prepare a vertex to be added to the graph.
|
abstract GraphQuery |
query(Authorizations authorizations)
Creates a query builder object used to query the graph.
|
abstract GraphQuery |
query(String queryString,
Authorizations authorizations)
Creates a query builder object used to query the graph.
|
SimilarToGraphQuery |
querySimilarTo(String[] fields,
String text,
Authorizations authorizations) |
abstract void |
reindex(Authorizations authorizations)
Reindex all vertices and edges.
|
abstract void |
removeEdge(Edge edge,
Authorizations authorizations)
Removes an edge from the graph.
|
void |
removeEdge(String edgeId,
Authorizations authorizations)
Removes an edge from the graph.
|
abstract void |
removeVertex(Vertex vertex,
Authorizations authorizations)
Removes a vertex from the graph.
|
abstract void |
setMetadata(String key,
Object value)
Sets metadata on the graph.
|
abstract void |
shutdown()
Cleans up or disconnects from the underlying storage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearData, createAuthorizations, getIdGenerator, isVisibilityValid, markEdgeHidden, markEdgeVisible, markVertexHidden, markVertexVisible, prepareEdge, prepareEdge, prepareVertexpublic Vertex addVertex(Visibility visibility, Authorizations authorizations)
Graphpublic Vertex addVertex(String vertexId, Visibility visibility, Authorizations authorizations)
Graphpublic Iterable<Vertex> addVertices(Iterable<ElementBuilder<Vertex>> vertices, Authorizations authorizations)
GraphaddVertices in interface Graphvertices - The vertices to add.authorizations - The authorizations required to add and retrieve the new vertex.public VertexBuilder prepareVertex(Visibility visibility)
GraphprepareVertex in interface Graphvisibility - The visibility to assign to the new vertex.public boolean doesVertexExist(String vertexId, Authorizations authorizations)
GraphdoesVertexExist in interface GraphvertexId - The vertex id to check existence of.authorizations - The authorizations required to load the vertex.public Vertex getVertex(String vertexId, EnumSet<FetchHint> fetchHints, Authorizations authorizations)
GraphgetVertex in interface GraphvertexId - The vertex id to retrieve from the graph.fetchHints - Hint at what parts of the vertex to fetch.authorizations - The authorizations required to load the vertex.public Vertex getVertex(String vertexId, Authorizations authorizations) throws VertexiumException
GraphgetVertex in interface GraphvertexId - The vertex id to retrieve from the graph.authorizations - The authorizations required to load the vertex.VertexiumExceptionpublic Iterable<Vertex> getVertices(Iterable<String> ids, EnumSet<FetchHint> fetchHints, Authorizations authorizations)
GraphGraph.getVerticesInOrder(Iterable, Authorizations).
Vertices are not kept in memory during the iteration.getVertices in interface Graphids - The ids of the vertices to get.fetchHints - Hint at what parts of the vertex to fetch.authorizations - The authorizations required to load the vertex.public Map<String,Boolean> doVerticesExist(List<String> ids, Authorizations authorizations)
GraphdoVerticesExist in interface Graphids - The vertex ids to check existence of.authorizations - The authorizations required to load the vertices.public Iterable<Vertex> getVertices(Iterable<String> ids, Authorizations authorizations)
GraphGraph.getVerticesInOrder(Iterable, Authorizations).
Vertices are not kept in memory during the iteration.getVertices in interface Graphids - The ids of the vertices to get.authorizations - The authorizations required to load the vertex.public List<Vertex> getVerticesInOrder(Iterable<String> ids, EnumSet<FetchHint> fetchHints, Authorizations authorizations)
GraphGraph.getVertices(Iterable, Authorizations)
but returns the vertices in the order that you passed in the ids. This requires loading
all the vertices in memory to sort them.getVerticesInOrder in interface Graphids - The ids of the vertices to get.fetchHints - Hint at what parts of the vertex to fetch.authorizations - The authorizations required to load the vertex.public List<Vertex> getVerticesInOrder(Iterable<String> ids, Authorizations authorizations)
GraphGraph.getVertices(Iterable, Authorizations)
but returns the vertices in the order that you passed in the ids. This requires loading
all the vertices in memory to sort them.getVerticesInOrder in interface Graphids - The ids of the vertices to get.authorizations - The authorizations required to load the vertex.public Iterable<Vertex> getVertices(Authorizations authorizations) throws VertexiumException
GraphgetVertices in interface Graphauthorizations - The authorizations required to load the vertex.VertexiumExceptionpublic abstract Iterable<Vertex> getVertices(EnumSet<FetchHint> fetchHints, Authorizations authorizations)
GraphgetVertices in interface GraphfetchHints - Hint at what parts of the vertex to fetch.authorizations - The authorizations required to load the vertex.public abstract void removeVertex(Vertex vertex, Authorizations authorizations)
GraphremoveVertex in interface Graphvertex - The vertex to remove.authorizations - The authorizations required to remove the vertex.public Edge addEdge(Vertex outVertex, Vertex inVertex, String label, Visibility visibility, Authorizations authorizations)
GraphaddEdge in interface GraphoutVertex - The source vertex. The "out" side of the edge.inVertex - The destination vertex. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.visibility - The visibility to assign to the new edge.authorizations - The authorizations required to add and retrieve the new edge.public Edge addEdge(String edgeId, Vertex outVertex, Vertex inVertex, String label, Visibility visibility, Authorizations authorizations)
GraphaddEdge in interface GraphedgeId - The id to assign the new edge.outVertex - The source vertex. The "out" side of the edge.inVertex - The destination vertex. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.visibility - The visibility to assign to the new edge.authorizations - The authorizations required to add and retrieve the new edge.public Edge addEdge(String outVertexId, String inVertexId, String label, Visibility visibility, Authorizations authorizations)
GraphaddEdge in interface GraphoutVertexId - The source vertex id. The "out" side of the edge.inVertexId - The destination vertex id. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.visibility - The visibility to assign to the new edge.authorizations - The authorizations required to add and retrieve the new edge.public Edge addEdge(String edgeId, String outVertexId, String inVertexId, String label, Visibility visibility, Authorizations authorizations)
GraphaddEdge in interface GraphedgeId - The id to assign the new edge.outVertexId - The source vertex id. The "out" side of the edge.inVertexId - The destination vertex id. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.visibility - The visibility to assign to the new edge.authorizations - The authorizations required to add and retrieve the new edge.public EdgeBuilderByVertexId prepareEdge(String outVertexId, String inVertexId, String label, Visibility visibility)
GraphprepareEdge in interface GraphoutVertexId - The source vertex id. The "out" side of the edge.inVertexId - The destination vertex id. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.visibility - The visibility to assign to the new edge.public EdgeBuilder prepareEdge(Vertex outVertex, Vertex inVertex, String label, Visibility visibility)
GraphprepareEdge in interface GraphoutVertex - The source vertex. The "out" side of the edge.inVertex - The destination vertex. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.visibility - The visibility to assign to the new edge.public boolean doesEdgeExist(String edgeId, Authorizations authorizations)
GraphdoesEdgeExist in interface GraphedgeId - The edge id to check existence of.authorizations - The authorizations required to load the edge.public Edge getEdge(String edgeId, EnumSet<FetchHint> fetchHints, Authorizations authorizations)
GraphgetEdge in interface GraphedgeId - The edge id to retrieve from the graph.fetchHints - Hint at what parts of the edge to fetch.authorizations - The authorizations required to load the edge.public Edge getEdge(String edgeId, Authorizations authorizations)
Graphpublic Map<String,Boolean> doEdgesExist(List<String> ids, Authorizations authorizations)
GraphdoEdgesExist in interface Graphids - The edge ids to check existence of.authorizations - The authorizations required to load the edges.public Iterable<Edge> getEdges(Iterable<String> ids, EnumSet<FetchHint> fetchHints, Authorizations authorizations)
Graphpublic Iterable<Edge> getEdges(Iterable<String> ids, Authorizations authorizations)
Graphpublic Iterable<Edge> getEdges(Authorizations authorizations)
Graphpublic abstract Iterable<Edge> getEdges(EnumSet<FetchHint> fetchHints, Authorizations authorizations)
Graphpublic abstract void removeEdge(Edge edge, Authorizations authorizations)
GraphremoveEdge in interface Graphedge - The edge to remove.authorizations - The authorizations required to remove the edge.public Iterable<Path> findPaths(Vertex sourceVertex, Vertex destVertex, int maxHops, Authorizations authorizations)
GraphfindPaths in interface GraphsourceVertex - The source vertex to start the search from.destVertex - The destination vertex to get to.maxHops - The maximum number of hops to make before giving up.authorizations - The authorizations required to load all edges and vertices.public Iterable<Path> findPaths(Vertex sourceVertex, Vertex destVertex, int maxHops, ProgressCallback progressCallback, Authorizations authorizations)
GraphfindPaths in interface GraphsourceVertex - The source vertex to start the search from.destVertex - The destination vertex to get to.maxHops - The maximum number of hops to make before giving up.progressCallback - Callback used to report progress.authorizations - The authorizations required to load all edges and vertices.public Iterable<Path> findPaths(String sourceVertexId, String destVertexId, int maxHops, ProgressCallback progressCallback, Authorizations authorizations)
GraphfindPaths in interface GraphsourceVertexId - The source vertex id to start the search from.destVertexId - The destination vertex id to get to.maxHops - The maximum number of hops to make before giving up.progressCallback - Callback used to report progress.authorizations - The authorizations required to load all edges and vertices.public Iterable<Path> findPaths(String sourceVertexId, String destVertexId, int maxHops, Authorizations authorizations)
GraphfindPaths in interface GraphsourceVertexId - The source vertex id to start the search from.destVertexId - The destination vertex id to get to.maxHops - The maximum number of hops to make before giving up.authorizations - The authorizations required to load all edges and vertices.public Iterable<String> findRelatedEdges(Iterable<String> vertexIds, Authorizations authorizations)
GraphfindRelatedEdges in interface GraphvertexIds - The list of vertex ids.authorizations - The authorizations required to load the edges.public void removeEdge(String edgeId, Authorizations authorizations)
GraphremoveEdge in interface GraphedgeId - The edge id of the vertex to remove from the graph.authorizations - The authorizations required to remove the edge.public abstract Iterable<GraphMetadataEntry> getMetadata()
GraphgetMetadata in interface Graphpublic Object getMetadata(String key)
GraphgetMetadata in interface Graphkey - The key to the metadata.public abstract void setMetadata(String key, Object value)
GraphsetMetadata in interface Graphkey - The key to the metadata.value - The value to set.public abstract GraphQuery query(Authorizations authorizations)
Graphpublic abstract GraphQuery query(String queryString, Authorizations authorizations)
Graphpublic abstract void reindex(Authorizations authorizations)
Graphpublic abstract void flush()
Graphpublic abstract void shutdown()
Graphpublic abstract DefinePropertyBuilder defineProperty(String propertyName)
GraphdefineProperty in interface GraphpropertyName - The name of the property to define.public abstract boolean isFieldBoostSupported()
GraphisFieldBoostSupported in interface Graphpublic abstract SearchIndexSecurityGranularity getSearchIndexSecurityGranularity()
GraphSearchIndexSecurityGranularitygetSearchIndexSecurityGranularity in interface Graphpublic void addGraphEventListener(GraphEventListener graphEventListener)
GraphaddGraphEventListener in interface Graphprotected boolean hasEventListeners()
protected void fireGraphEvent(GraphEvent graphEvent)
public boolean isQuerySimilarToTextSupported()
isQuerySimilarToTextSupported in interface Graphpublic SimilarToGraphQuery querySimilarTo(String[] fields, String text, Authorizations authorizations)
querySimilarTo in interface GraphCopyright © 2014–2015. All rights reserved.