Search in sources :

Example 6 with EdgeRelation

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;
}
Also used : GraphProperty(com.alibaba.maxgraph.compiler.api.schema.GraphProperty) EdgeRelation(com.alibaba.maxgraph.compiler.api.schema.EdgeRelation)

Aggregations

EdgeRelation (com.alibaba.maxgraph.compiler.api.schema.EdgeRelation)6 GraphEdge (com.alibaba.maxgraph.compiler.api.schema.GraphEdge)4 JSONObject (com.alibaba.fastjson.JSONObject)3 GraphProperty (com.alibaba.maxgraph.compiler.api.schema.GraphProperty)3 GraphElement (com.alibaba.maxgraph.compiler.api.schema.GraphElement)2 GraphSchema (com.alibaba.maxgraph.compiler.api.schema.GraphSchema)2 SchemaFetcher (com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher)2 EdgeOtherVertexTreeNode (com.alibaba.maxgraph.compiler.tree.EdgeOtherVertexTreeNode)2 EdgeTreeNode (com.alibaba.maxgraph.compiler.tree.EdgeTreeNode)2 EdgeVertexTreeNode (com.alibaba.maxgraph.compiler.tree.EdgeVertexTreeNode)2 NodeType (com.alibaba.maxgraph.compiler.tree.NodeType)2 TreeNode (com.alibaba.maxgraph.compiler.tree.TreeNode)2 VertexTreeNode (com.alibaba.maxgraph.compiler.tree.VertexTreeNode)2 SourceTreeNode (com.alibaba.maxgraph.compiler.tree.source.SourceTreeNode)2 Lists (com.google.common.collect.Lists)2 Maps (com.google.common.collect.Maps)2 Sets (com.google.common.collect.Sets)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2