use of com.alibaba.maxgraph.compiler.api.schema.EdgeRelation in project GraphScope by alibaba.
the class EdgeTypeMapper method parseFromEdgeType.
public static SchemaElementMapper parseFromEdgeType(GraphEdge graphEdge) {
EdgeTypeMapper edgeTypeMapper = new EdgeTypeMapper();
edgeTypeMapper.setId(graphEdge.getLabelId());
edgeTypeMapper.setLabel(graphEdge.getLabel());
edgeTypeMapper.setType(TypeEnum.EDGE.toString());
List<EdgeRelationMapper> relationMapperList = Lists.newArrayList();
for (EdgeRelation edgeRelation : graphEdge.getRelationList()) {
relationMapperList.add(EdgeRelationMapper.parseFromEdgeRelation(graphEdge.getLabel(), edgeRelation));
}
edgeTypeMapper.setRelationShips(relationMapperList);
List<GraphPropertyMapper> propertyMapperList = Lists.newArrayList();
for (GraphProperty graphProperty : graphEdge.getPropertyList()) {
propertyMapperList.add(GraphPropertyMapper.parseFromGrapyProperty(graphProperty));
}
edgeTypeMapper.setPropertyDefList(propertyMapperList);
return edgeTypeMapper;
}
Aggregations