@Test public void testVariableMappingCreation() throws Exception { AddGraphElementToNewGraph<EPGMVertex, EPGMGraphHead> udf = new AddGraphElementToNewGraph<>(new EPGMGraphHeadFactory(), "a"); EPGMVertex vertex = new EPGMVertexFactory().createVertex(); Tuple2<EPGMVertex, EPGMGraphHead> result = udf.map(vertex); assertTrue(result.f1.hasProperty(PatternMatching.VARIABLE_MAPPING_KEY)); Map<PropertyValue, PropertyValue> variableMapping = result.f1.getPropertyValue(PatternMatching.VARIABLE_MAPPING_KEY).getMap(); assertEquals(vertex.getId(), variableMapping.get(PropertyValue.create("a")).getGradoopId()); }
@Override public Tuple2<GE, G> map(GE value) { reuseVariableMapping.clear(); reuseVariableMapping.put( PropertyValue.create(this.variable), PropertyValue.create(value.getId()) ); G graphHead = graphHeadFactory.createGraphHead(); graphHead.setProperty(PatternMatching.VARIABLE_MAPPING_KEY, reuseVariableMapping); value.addGraphId(graphHead.getId()); reuseTuple.f0 = value; reuseTuple.f1 = graphHead; return reuseTuple; }
AddGraphElementToNewGraph implements MapFunction<GE, Tuple2<GE, G>> { @Override public Tuple2<GE, G> map(GE value) { reuseVariableMapping.clear(); reuseVariableMapping.put( PropertyValue.create(this.variable), PropertyValue.create(value.getId()) ); G graphHead = graphHeadFactory.createGraphHead(); graphHead.setProperty(PatternMatching.VARIABLE_MAPPING_KEY, reuseVariableMapping); value.addGraphId(graphHead.getId()); reuseTuple.f0 = value; reuseTuple.f1 = graphHead; return reuseTuple; } }
AddGraphElementToNewGraph implements MapFunction<GE, Tuple2<GE, G>> { @Override public Tuple2<GE, G> map(GE value) { reuseVariableMapping.clear(); reuseVariableMapping.put( PropertyValue.create(this.variable), PropertyValue.create(value.getId()) ); G graphHead = graphHeadFactory.createGraphHead(); graphHead.setProperty(PatternMatching.VARIABLE_MAPPING_KEY, reuseVariableMapping); value.addGraphId(graphHead.getId()); reuseTuple.f0 = value; reuseTuple.f1 = graphHead; return reuseTuple; } AddGraphElementToNewGraph(GraphHeadFactory<G> graphHeadFactory,
    String variable); }
AddGraphElementToNewGraph implements MapFunction<GE, Tuple2<GE, G>> { @Override public Tuple2<GE, G> map(GE value) { reuseVariableMapping.clear(); reuseVariableMapping.put( PropertyValue.create(this.variable), PropertyValue.create(value.getId()) ); G graphHead = graphHeadFactory.createGraphHead(); graphHead.setProperty(PatternMatching.VARIABLE_MAPPING_KEY, reuseVariableMapping); value.addGraphId(graphHead.getId()); reuseTuple.f0 = value; reuseTuple.f1 = graphHead; return reuseTuple; } AddGraphElementToNewGraph(GraphHeadFactory<G> graphHeadFactory,
    String variable); @Override Tuple2<GE, G> map(GE value); }
AddGraphElementToNewGraph implements MapFunction<GE, Tuple2<GE, G>> { @Override public Tuple2<GE, G> map(GE value) { reuseVariableMapping.clear(); reuseVariableMapping.put( PropertyValue.create(this.variable), PropertyValue.create(value.getId()) ); G graphHead = graphHeadFactory.createGraphHead(); graphHead.setProperty(PatternMatching.VARIABLE_MAPPING_KEY, reuseVariableMapping); value.addGraphId(graphHead.getId()); reuseTuple.f0 = value; reuseTuple.f1 = graphHead; return reuseTuple; } AddGraphElementToNewGraph(GraphHeadFactory<G> graphHeadFactory,
    String variable); @Override Tuple2<GE, G> map(GE value);  }