vertexLabel
頂点ラベルの作成方法。
構文
schema.vertexLabel('vertexLabel').[ partitionKey(propertyKey, [ partitionKey(propertyKey) ] ].[ clusteringKey(propertyKey) ].[ ttl ].[ properties(property, property) ].[ index ].[ partition() ].[ cache() ].[ ifNotExists() ].[ create() | add() | describe() | exists() ]
説明
頂点ラベルは、DSE Graphに格納できる頂点のタイプを指定します。
例
vertexLabel
author
を作成します。schema.vertexLabel('author').create()
頂点ラベルがまだ存在しない場合は、vertexLabel
ingredient
を作成します。schema.vertexLabel('ingredient').ifNotExists().create()
パーティションおよびクラスタ化キーについては、「partitionKey-clusteringKey」を参照してください。
プロパティをvertexLabelに追加します。
schema.vertexLabel('author').properties('location','restaurant').add()
インデックスについては、スキーマAPIの各インデックス・エントリー(辺インデックス、プロパティ・インデックス、頂点インデックス)を参照してください。
author
頂点のすべてのプロパティを最大1時間(3600秒)キャッシュします。schema.vertexLabel('author').cache().properties().ttl(3600).add()
プロパティ・キャッシュを有効にすると、インデックス・クエリーでは、指定された頂点ラベルのIndexCacheを使用します。author
頂点の内向きと外向きの両方のcreated
辺を最大1分(60秒)間キャッシュします。schema.vertexLabel('author').cache().bothE('created').ttl(00).add()
特定のedgeLabelに基づいてvertexLabelのパーティション分割を行います。
schema.vertexLabel('author').partition().inE('created').add()
vertexLabelが存在するかどうかを確認します。
schema.vertexLabel('author').exists()
describe()
コマンドを使用してvertexLabelのスキーマ作成コマンドを取得します。schema.vertexLabel('author').describe()