g.V().has("name","Query1").fold().Cheers,
coalesce(
__.unfold(),
__.addV("SQL").
property("name","Query1")).
unfold().as("q").
coalesce(
__.V().has("name","Table2"),
__.addV("Table").
property("name","Table2")).
addE("INSERT").from("q").iterate();
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7b1824a4-60e5-4f99-95a4-87317c27f458%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The method coalesce(Traversal<?,E2>...) in the type GraphTraversal<Vertex,List<Vertex>> is not applicable for the arguments (GraphTraversal<Object,Object>, GraphTraversal<Object,Vertex>)
The method as(String, String...) in the type GraphTraversal<Vertex,Object> is not applicable for the arguments (String, GraphTraversal<Vertex,Vertex>)
Syntax error on token ")", delete this token
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
With
((GraphTraversal) g).V().has(NAME,"Query1").fold().
coalesce(
__.unfold(),
__.addV("SQL").
property(NAME,"Query1")).
unfold().as("q").
coalesce(
__.V().has(NAME,"Table2"),
__.addV("Table").
property("name","Table2")).
addE("INSERT").from("q").iterate();
I get runtime exception message:
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource cannot be cast to org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal
import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
public class RemoteExample {
public static void main(String[] args) {
Graph graph = EmptyGraph.instance();
GraphTraversalSource g = null;
try {
g = graph.traversal().withRemote("conf/remote-graph.properties");
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
g.V().has("name", "Query1").fold().
coalesce(unfold(), addV("SQL").property("name", "Query1")).unfold().as("q").
coalesce(V().has("name", "Table2"), addV("Table").property("name", "Table2")).
addE("INSERT").from("q").iterate();
System.out.println("vertices: " + g.V().valueMap(true).toList().toString());
System.out.println("edges: " + g.E().valueMap(true).toList().toString());
System.exit(0);
}
}