in hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeCoreTest.java [86:201]
public void initSchema() {
SchemaManager schema = graph().schema();
LOG.debug("=============== propertyKey ================");
schema.propertyKey("id").asInt().create();
schema.propertyKey("name").asText().create();
schema.propertyKey("dynamic").asBoolean().create();
schema.propertyKey("time").asText().create();
schema.propertyKey("timestamp").asLong().create();
schema.propertyKey("age").asInt().valueSingle().create();
schema.propertyKey("comment").asText().valueSet().create();
schema.propertyKey("contribution").asText().create();
schema.propertyKey("score").asInt().create();
schema.propertyKey("lived").asText().create();
schema.propertyKey("city").asText().create();
schema.propertyKey("amount").asFloat().create();
schema.propertyKey("message").asText().create();
schema.propertyKey("place").asText().create();
schema.propertyKey("tool").asText().create();
schema.propertyKey("reason").asText().create();
schema.propertyKey("hurt").asBoolean().create();
schema.propertyKey("arrested").asBoolean().create();
schema.propertyKey("date").asDate().create();
LOG.debug("=============== vertexLabel ================");
schema.vertexLabel("person")
.properties("name", "age", "city")
.primaryKeys("name")
.enableLabelIndex(false)
.create();
schema.vertexLabel("author")
.properties("id", "name", "age", "lived")
.primaryKeys("id")
.enableLabelIndex(false)
.create();
schema.vertexLabel("language")
.properties("name", "dynamic")
.primaryKeys("name")
.nullableKeys("dynamic")
.enableLabelIndex(false)
.create();
schema.vertexLabel("book")
.properties("name")
.primaryKeys("name")
.enableLabelIndex(false)
.create();
LOG.debug("=============== edgeLabel ================");
schema.edgeLabel("transfer")
.properties("id", "amount", "timestamp", "message")
.nullableKeys("message")
.multiTimes().sortKeys("id")
.link("person", "person")
.enableLabelIndex(false)
.create();
schema.edgeLabel("authored").singleTime()
.properties("contribution", "comment", "score")
.nullableKeys("score", "contribution", "comment")
.link("author", "book")
.enableLabelIndex(true)
.create();
schema.edgeLabel("write").properties("time")
.multiTimes().sortKeys("time")
.link("author", "book")
.enableLabelIndex(false)
.create();
schema.edgeLabel("look").properties("time", "score")
.nullableKeys("score")
.multiTimes().sortKeys("time")
.link("person", "book")
.enableLabelIndex(true)
.create();
schema.edgeLabel("know").singleTime()
.link("author", "author")
.enableLabelIndex(true)
.create();
schema.edgeLabel("followedBy").singleTime()
.link("author", "person")
.enableLabelIndex(false)
.create();
schema.edgeLabel("friend").singleTime()
.link("person", "person")
.enableLabelIndex(true)
.create();
schema.edgeLabel("follow").singleTime()
.link("person", "author")
.enableLabelIndex(true)
.create();
schema.edgeLabel("created").singleTime()
.link("author", "language")
.enableLabelIndex(true)
.create();
schema.edgeLabel("strike").link("person", "person")
.properties("id", "timestamp", "place", "tool", "reason",
"hurt", "arrested")
.multiTimes().sortKeys("id")
.nullableKeys("tool", "reason", "hurt")
.enableLabelIndex(false)
.ifNotExist().create();
schema.edgeLabel("read").link("person", "book")
.properties("place", "date")
.ttl(3000L)
.enableLabelIndex(true)
.ifNotExist()
.create();
schema.edgeLabel("borrow").link("person", "book")
.properties("place", "date")
.ttl(3000L)
.ttlStartTime("date")
.enableLabelIndex(true)
.ifNotExist()
.create();
}