Package com.c8db
Interface C8Graph
-
- All Superinterfaces:
C8SerializationAccessor
- All Known Implementing Classes:
C8GraphImpl
public interface C8Graph extends C8SerializationAccessor
Interface for operations on C8DB graph level.- See Also:
- API Documentation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GraphEntityaddEdgeDefinition(EdgeDefinition definition)Adds the given edge definition to the graph.GraphEntityaddVertexCollection(String name)Adds a vertex collection to the set of collections of the graph.GraphEntitycreate(Collection<EdgeDefinition> edgeDefinitions)Creates the graph in the graph module.GraphEntitycreate(Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options)Creates the graph in the graph module.C8Databasedb()The the handler of the database the named graph is withinvoiddrop()Deletes the graph from the database.voiddrop(boolean dropCollections)Deletes the graph from the database.C8EdgeCollectionedgeCollection(String name)Returns aArangoEdgeCollectioninstance for the given edge collection name.booleanexists()Checks whether the graph existsCollection<String>getEdgeDefinitions()Fetches all edge collections from the graph and returns a list of collection names.GraphEntitygetInfo()Retrieves general information about the graph.Collection<String>getVertexCollections()Fetches all vertex collections from the graph and returns a list of collection names.Stringname()The name of the graphGraphEntityremoveEdgeDefinition(String definitionName)Remove one edge definition from the graph.GraphEntityreplaceEdgeDefinition(EdgeDefinition definition)Change one specific edge definition.C8VertexCollectionvertexCollection(String name)Returns aArangoVertexCollectioninstance for the given vertex collection name.-
Methods inherited from interface com.c8db.C8SerializationAccessor
util, util
-
-
-
-
Method Detail
-
db
C8Database db()
The the handler of the database the named graph is within- Returns:
- database handler
-
name
String name()
The name of the graph- Returns:
- graph name
-
exists
boolean exists() throws C8DBExceptionChecks whether the graph exists- Returns:
- true if the graph exists, otherwise false
- Throws:
C8DBException
-
create
GraphEntity create(Collection<EdgeDefinition> edgeDefinitions) throws C8DBException
Creates the graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Parameters:
edgeDefinitions- An array of definitions for the edge- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
create
GraphEntity create(Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options) throws C8DBException
Creates the graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Parameters:
edgeDefinitions- An array of definitions for the edgeoptions- Additional options, can be null- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
drop
void drop() throws C8DBException
Deletes the graph from the database.- Throws:
C8DBException- See Also:
- API Documentation
-
drop
void drop(boolean dropCollections) throws C8DBException
Deletes the graph from the database.- Parameters:
dropCollections- Drop collections of this graph as well. Collections will only be dropped if they are not used in other graphs.- Throws:
C8DBException- See Also:
- API Documentation
-
getInfo
GraphEntity getInfo() throws C8DBException
Retrieves general information about the graph.- Returns:
- the definition content of this graph
- Throws:
C8DBException- See Also:
- API Documentation
-
getVertexCollections
Collection<String> getVertexCollections() throws C8DBException
Fetches all vertex collections from the graph and returns a list of collection names.- Returns:
- all vertex collections within this graph
- Throws:
C8DBException- See Also:
- API Documentation
-
addVertexCollection
GraphEntity addVertexCollection(String name) throws C8DBException
Adds a vertex collection to the set of collections of the graph. If the collection does not exist, it will be created.- Parameters:
name- Name of the vertex collection- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
vertexCollection
C8VertexCollection vertexCollection(String name)
Returns aArangoVertexCollectioninstance for the given vertex collection name.- Parameters:
name- Name of the vertex collection- Returns:
- collection handler
-
edgeCollection
C8EdgeCollection edgeCollection(String name)
Returns aArangoEdgeCollectioninstance for the given edge collection name.- Parameters:
name- Name of the edge collection- Returns:
- collection handler
-
getEdgeDefinitions
Collection<String> getEdgeDefinitions() throws C8DBException
Fetches all edge collections from the graph and returns a list of collection names.- Returns:
- all edge collections within this graph
- Throws:
C8DBException- See Also:
- API Documentation
-
addEdgeDefinition
GraphEntity addEdgeDefinition(EdgeDefinition definition) throws C8DBException
Adds the given edge definition to the graph.- Parameters:
definition- The edge definition- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
replaceEdgeDefinition
GraphEntity replaceEdgeDefinition(EdgeDefinition definition) throws C8DBException
Change one specific edge definition. This will modify all occurrences of this definition in all graphs known to your database- Parameters:
definition- The edge definition- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
removeEdgeDefinition
GraphEntity removeEdgeDefinition(String definitionName) throws C8DBException
Remove one edge definition from the graph. This will only remove the edge collection, the vertex collections remain untouched and can still be used in your queries- Parameters:
definitionName- The name of the edge collection used in the definition- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
-