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 all schema:
  • 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.
  • Using the vertex label and index name, remove the index. Running describe() again will verify that the index is removed.
  • Remove only one property from a search index:
Clean up
  • If schema changes cause inconsistencies in the graph data, OLAP analytic operations can be blocked and queries will not run. Use the graph cleanup tool to remove any orphaned edge or unattached vertex properties that cause problems.
    For example, after removing an edgelabel:
    Set the graph test_graph to analytics mode and run a cleanup:
    // Set the graph to OLAP mode
    :remote config alias g test_graph.a
    // Allow full scans
    // Run the cleanup

    The results details the cleanup actions:

    Edges with unknown labels deleted:      8
    Orphaned edges deleted:                 0
    Unattached vertex properties deleted:   0
    Graph cleanup finished at 20 seconds
    Please run `nodetool repair -pr test_graph` on each cluster node to finish the cleanup

    Note that a nodetool repair command will be required post-cleanup.