/** * {@inheritDoc} */ @Override public GraphHead map(Tuple1<GradoopId> idTuple) { return graphHeadFactory.initGraphHead(idTuple.f0); }
@Override public G map(GradoopId graphId) throws Exception { G graphHead = graphHeadFactory .createGraphHead(BusinessTransactionGraphs.BTG_LABEL); graphHead.setId(graphId); return graphHead; }
/** * {@inheritDoc} */ @Override public TypeInformation<GraphHead> getProducedType() { return TypeExtractor.createTypeInfo(graphHeadFactory.getType()); } }
@Override public GraphHead map(Tuple1<GradoopId> idTuple) { return graphHeadFactory.initGraphHead(idTuple.f0); }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public TypeInformation<G> getProducedType() { return TypeExtractor.createTypeInfo(graphHeadFactory.getType()); } }
@Override public G map(GradoopId graphId) throws Exception { G graphHead = graphHeadFactory .createGraphHead(BusinessTransactionGraphs.BTG_LABEL); graphHead.setId(graphId); return graphHead; }
@Override protected G initFrom(G graphHead) { return graphHeadFactory.initGraphHead(graphHead.getId(), GradoopConstants.DEFAULT_GRAPH_LABEL); } }
/** * {@inheritDoc} */ @Override public TypeInformation<GraphHead> getProducedType() { return TypeExtractor.createTypeInfo(graphHeadFactory.getType()); } }
@Override public Tuple2<GE, GraphHead> map(GE value) throws Exception { reuseVariableMapping.clear(); reuseVariableMapping.put( PropertyValue.create(this.variable), PropertyValue.create(value.getId()) ); GraphHead graphHead = graphHeadFactory.createGraphHead(); graphHead.setProperty(PatternMatching.VARIABLE_MAPPING_KEY, reuseVariableMapping); value.addGraphId(graphHead.getId()); reuseTuple.f0 = value; reuseTuple.f1 = graphHead; return reuseTuple; } }
@Override protected G initFrom(G graphHead) { return graphHeadFactory.initGraphHead(graphHead.getId(), GradoopConstants.DEFAULT_GRAPH_LABEL); } }
@Override public TypeInformation<GraphHead> getProducedType() { return TypeExtractor.createTypeInfo(graphHeadFactory.getType()); } }
@Override public Tuple2<GE, GraphHead> map(GE value) throws Exception { reuseVariableMapping.clear(); reuseVariableMapping.put( PropertyValue.create(this.variable), PropertyValue.create(value.getId()) ); GraphHead graphHead = graphHeadFactory.createGraphHead(); graphHead.setProperty(PatternMatching.VARIABLE_MAPPING_KEY, reuseVariableMapping); value.addGraphId(graphHead.getId()); reuseTuple.f0 = value; reuseTuple.f1 = graphHead; return reuseTuple; } }
/** * {@inheritDoc} */ @Override public GraphHead map(Tuple2<GradoopId, GradoopId> idTuple) { GraphHead head = graphHeadFactory.initGraphHead(idTuple.f0); Properties properties = Properties.createWithCapacity(1); properties.set("lineage", idTuple.f1); head.setProperties(properties); return head; }
@Override public TypeInformation<GraphHead> getProducedType() { return TypeExtractor.createTypeInfo(graphHeadFactory.getType()); } }
.createGraphHead(canonicalLabel, properties);
@Override public GraphHead map(Tuple2<GradoopId, GradoopId> idTuple) { GraphHead head = graphHeadFactory.initGraphHead(idTuple.f0); Properties properties = Properties.createWithCapacity(1); properties.set("lineage", idTuple.f1); head.setProperties(properties); return head; }
@SuppressWarnings("unchecked") @Override public TypeInformation<G> getProducedType() { return TypeExtractor.createTypeInfo(graphHeadFactory.getType()); } }
.createGraphHead(canonicalLabel, properties);
@Override public GraphHead readRow(EPGMGraphHead origin) { return factory.initGraphHead( /*edge id*/origin.getId(), /*label*/origin.getLabel(), /*properties*/origin.getProperties()); }
@Override protected GraphCollection executeForVertex(LogicalGraph graph) { GradoopFlinkConfig config = graph.getConfig(); EPGMGraphHeadFactory<GraphHead> graphHeadFactory = config.getGraphHeadFactory(); EPGMVertexFactory<Vertex> vertexFactory = config.getVertexFactory(); String variable = getQueryHandler().getVertices().iterator().next().getVariable(); DataSet<Vertex> matchingVertices = graph.getVertices() .filter(new MatchingVertices<>(getQuery())); if (!doAttachData()) { matchingVertices = matchingVertices .map(new Id<>()) .map(new ObjectTo1<>()) .map(new VertexFromId(vertexFactory)); } DataSet<Tuple2<Vertex, GraphHead>> pairs = matchingVertices .map(new AddGraphElementToNewGraph<>(graphHeadFactory, variable)) .returns(new TupleTypeInfo<>( TypeExtractor.getForClass(vertexFactory.getType()), TypeExtractor.getForClass(graphHeadFactory.getType()))); return config.getGraphCollectionFactory().fromDataSets( pairs.map(new Value1Of2<>()), pairs.map(new Value0Of2<>())); }