スキーマの検証
スキーマを検証する方法。
スキーマを検証することで、スキーマを作成する前に、スキーマが存在するかどうかを確認することができます。
手順
-
すべてのスキーマのリストは、次のコマンドで取得できます。
schema.describe()表示方法は異なりますが、StudioとGremlin Consoleでリストが取得できます。以下にStudioの結果の一部を示します。

-
特定の要素のスキーマは、より具体的なスキーマに
describe()を追加することで検証できます。schema.edgeLabel('includedIn').describe()schema.edgeLabel("includedIn").multiple().properties("amount").create() schema.edgeLabel("includedIn").connection("recipe", "meal").connection("recipe", "book").connection("recipe", "ingredient").connection("ingredient", "recipe").connection("meal", "book").add() -
Gremlinクエリーでは、特定のスキーマ記述を見つけるためにいくつかのGroovyの手順が役立ちます。たとえば、頂点ラベルとそのインデックスのみを検査するには、
split()およびgrep()ステップを使用します。schema.describe().split('\n').grep(~/.*vertexLabel.*/)Studioの場合:
