Search in sources :

Example 6 with CompositeId

use of com.alibaba.maxgraph.sdkcommon.graph.CompositeId in project GraphScope by alibaba.

the class VertexResponseFunction method apply.

@Override
public Vertex apply(GremlinQuery.VertexResponse nextV) {
    GremlinQuery.VertexId id = nextV.getId();
    CompositeId rId = new CompositeId(id.getId(), id.getTypeId());
    GraphElement type = schema.getElement(id.getTypeId());
    Map<String, Object> properties = RpcProcessorUtils.deserializeProperty(nextV.getPros().toByteArray(), type, schema);
    return new Vertex(rId, type.getLabel(), properties, this.graph);
}
Also used : Vertex(com.alibaba.maxgraph.structure.Vertex) GraphElement(com.alibaba.maxgraph.compiler.api.schema.GraphElement) CompositeId(com.alibaba.maxgraph.sdkcommon.graph.CompositeId) GremlinQuery(com.alibaba.maxgraph.proto.GremlinQuery)

Aggregations

CompositeId (com.alibaba.maxgraph.sdkcommon.graph.CompositeId)6 Vertex (com.alibaba.maxgraph.structure.Vertex)5 MxVertex (com.alibaba.maxgraph.structure.MxVertex)4 GraphElement (com.alibaba.maxgraph.compiler.api.schema.GraphElement)3 GremlinQuery (com.alibaba.maxgraph.proto.GremlinQuery)3 ElementId (com.alibaba.maxgraph.sdkcommon.graph.ElementId)3 VertexResult (com.alibaba.maxgraph.result.VertexResult)2 QueryResult (com.alibaba.maxgraph.sdkcommon.graph.QueryResult)2 Map (java.util.Map)2 Set (java.util.Set)2 CacheFactory (com.alibaba.maxgraph.cache.CacheFactory)1 GraphSchema (com.alibaba.maxgraph.compiler.api.schema.GraphSchema)1 GraphVertex (com.alibaba.maxgraph.compiler.api.schema.GraphVertex)1 ValueType (com.alibaba.maxgraph.compiler.tree.value.ValueType)1 EdgeResult (com.alibaba.maxgraph.result.EdgeResult)1 ListResult (com.alibaba.maxgraph.result.ListResult)1 MapValueResult (com.alibaba.maxgraph.result.MapValueResult)1 PathValueResult (com.alibaba.maxgraph.result.PathValueResult)1 PropertyResult (com.alibaba.maxgraph.result.PropertyResult)1 PropertyValueResult (com.alibaba.maxgraph.result.PropertyValueResult)1