use of com.baidu.hugegraph.driver.SchemaManager in project incubator-hugegraph-toolchain by apache.
the class GraphsApiTest method initPropertyKey.
protected static void initPropertyKey(HugeClient client) {
SchemaManager schema = client.schema();
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("age").asInt().ifNotExist().create();
schema.propertyKey("city").asText().ifNotExist().create();
schema.propertyKey("lang").asText().ifNotExist().create();
schema.propertyKey("date").asDate().ifNotExist().create();
schema.propertyKey("price").asInt().ifNotExist().create();
schema.propertyKey("weight").asDouble().ifNotExist().create();
}
use of com.baidu.hugegraph.driver.SchemaManager in project incubator-hugegraph-toolchain by apache.
the class BaseClientTest method initIndexLabel.
protected static void initIndexLabel() {
SchemaManager schema = schema();
schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create();
schema.indexLabel("personByAge").onV("person").by("age").range().ifNotExist().create();
schema.indexLabel("knowsByDate").onE("knows").by("date").secondary().ifNotExist().create();
schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create();
}
use of com.baidu.hugegraph.driver.SchemaManager in project incubator-hugegraph-toolchain by apache.
the class BaseClientTest method initVertexLabel.
protected static void initVertexLabel() {
SchemaManager schema = schema();
schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").nullableKeys("city").ifNotExist().create();
schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").nullableKeys("price").ifNotExist().create();
schema.vertexLabel("book").useCustomizeStringId().properties("name", "price").nullableKeys("price").ifNotExist().create();
}
use of com.baidu.hugegraph.driver.SchemaManager in project incubator-hugegraph-toolchain by apache.
the class BaseClientTest method initEdgeLabel.
protected static void initEdgeLabel() {
SchemaManager schema = schema();
schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").multiTimes().properties("date", "city").sortKeys("date").nullableKeys("city").ifNotExist().create();
schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "city").nullableKeys("city").ifNotExist().create();
}
use of com.baidu.hugegraph.driver.SchemaManager in project incubator-hugegraph-toolchain by apache.
the class BaseClientTest method initPropertyKey.
protected static void initPropertyKey() {
SchemaManager schema = schema();
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("age").asInt().ifNotExist().create();
schema.propertyKey("city").asText().ifNotExist().create();
schema.propertyKey("lang").asText().ifNotExist().create();
schema.propertyKey("date").asDate().ifNotExist().create();
schema.propertyKey("price").asInt().ifNotExist().create();
schema.propertyKey("weight").asDouble().ifNotExist().create();
}
Aggregations