Dropping graph schema

Dropping (deleting) graph schema.

Schema can be dropped (deleted) using the drop() step; see propertyKey, vertexLabel, and edgeLabel for more information.


Drop schema

  • To drop the schema and all data without dropping the graph, use a drop() step. Running describe() after will verify that the schema is dropped. After the schema is dropped, new schema and data can be loaded to the graph.
  • To drop schema for a particular property key, specify the property key and then use the drop() step:
    Warning: To drop a property key for a vertex label that has a materialized view index, additional steps are required to prevent data loss or cluster errors. Drop any materialized indexes for the vertex label, drop the property key, and then rebuild the schema for the materialized view indexes. The MV index data will be recreated from the base table, with the exception of the data for the dropped property key.
  • To drop schema for a particular vertex label, specify the vertex label and then use the drop() step:

Drop index

  • To drop an index from the schema, such as the byMeal index, identify the index by name. Use describe() to examine all indexes for the desired vertex label first.
    gremlin> schema.vertexLabel('meal').describe()
  • Using the vertex label and index name, remove the index. Running describe() again will verify that the index is removed.
    gremlin> schema.vertexLabel('meal').index('byMeal').drop()
  • Remove only one property from a search index: