Dropping graphs

Dropping (deleting) graphs.

Graphs can be dropped (deleted) . All schema and data for the graph will be lost, so be sure that you intend to remove a graph before using the steps below. Best practice is to truncate a graph before removing it, for better performance.
Note: Graphs use many tables in the storage system. If a graph is no longer in use, drop it to ensure that you stay within the acceptable limit of the number of tables.

Procedure

  • A system command is required to drop a graph. If using the Gremlin console, the graph traversal alias can be cleared, to be certain no action effects the currently selected graph in the Gremlin console:
    :remote config alias reset
    ==>Aliases cleared
  • Optional: If unsure of the graph name, examine what graphs exist.
  • Truncate the graph before dropping it:
    system.graph('food').truncate()
    ==>OK
  • Drop the desired graph by running the drop() command:
    system.graph('food').drop()
    Use the ifExists() step to check if a graph exists before dropping.
    ==>OK
  • Recommended: Truncate the graph:
    system.graph('food').truncate()
    Use the ifExists() step to check if a graph exists before truncating.
    ==>OK