Adding edge with label = "type"

105 views
Skip to first unread message

are...@asu.edu

unread,
Nov 12, 2013, 1:46:41 PM11/12/13
to aureliu...@googlegroups.com
I receive the following error when trying to add an edge:

        BaseConfiguration conf = new BaseConfiguration();
        conf.setProperty("storage.backend", "cassandra");
        conf.setProperty("storage.hostname", "127.0.0.1");
       
        TitanGraph g = TitanFactory.open(conf);
       
        Vertex v = g.getVertex(536);
        System.out.println(v);
       
        Vertex u = g.getVertex(524);
        System.out.println(u);
       
        g.addEdge(null, v, u, "type");

Exception in thread "main" java.lang.IllegalArgumentException: The type of given name is not a label: type
    at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.getEdgeLabel(StandardTitanTx.java:618)
    at com.thinkaurelius.titan.graphdb.blueprints.TitanBlueprintsTransaction.addEdge(TitanBlueprintsTransaction.java:104)
    at com.thinkaurelius.titan.graphdb.blueprints.TitanBlueprintsTransaction.addEdge(TitanBlueprintsTransaction.java:96)
    at com.thinkaurelius.titan.graphdb.blueprints.TitanBlueprintsGraph.addEdge(TitanBlueprintsGraph.java:205)
    at com.ibm.research.titan.Main.main(Main.java:23)

Is "type" some sort of reserved word that cannot be used for a label? Are there any workarounds?

Thanks,

JT

Marko Rodriguez

unread,
Nov 12, 2013, 1:52:25 PM11/12/13
to aureliu...@googlegroups.com
Do you have a vertex property called "type"? If so, in Titan, you can't have the same name for a property key and an edge label.

HTH,
Marko.
--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

are...@asu.edu

unread,
Nov 12, 2013, 2:02:07 PM11/12/13
to aureliu...@googlegroups.com
Marko:

Thanks for the quick response. I actually do not currently have any vertex properties called "type" but I did create a Vertex key index for "type" (in case I was going to use it later). I suppose this could be causing the conflict.

Thanks,

JT

are...@asu.edu

unread,
Nov 12, 2013, 2:51:00 PM11/12/13
to aureliu...@googlegroups.com
Sure enough. That was it. Thanks for the help.
Reply all
Reply to author
Forward
0 new messages