Search in sources :

Example 1 with Frequency

use of com.baidu.hugegraph.structure.constant.Frequency in project incubator-hugegraph-toolchain by apache.

the class EdgeLabelService method convert.

private static EdgeLabel convert(EdgeLabelEntity entity, HugeClient client) {
    if (entity == null) {
        return null;
    }
    Frequency frequency = entity.isLinkMultiTimes() ? Frequency.MULTIPLE : Frequency.SINGLE;
    EdgeLabelStyle style = entity.getStyle();
    return client.schema().edgeLabel(entity.getName()).sourceLabel(entity.getSourceLabel()).targetLabel(entity.getTargetLabel()).frequency(frequency).properties(toStringArray(entity.getPropNames())).sortKeys(toStringArray(entity.getSortKeys())).nullableKeys(toStringArray(entity.getNullableProps())).enableLabelIndex(entity.isOpenLabelIndex()).userdata(USER_KEY_CREATE_TIME, entity.getCreateTime()).userdata(USER_KEY_STYLE, JsonUtil.toJson(style)).build();
}
Also used : Frequency(com.baidu.hugegraph.structure.constant.Frequency) EdgeLabelStyle(com.baidu.hugegraph.entity.schema.EdgeLabelStyle)

Aggregations

EdgeLabelStyle (com.baidu.hugegraph.entity.schema.EdgeLabelStyle)1 Frequency (com.baidu.hugegraph.structure.constant.Frequency)1