Rexster REST API crashes with hyper-edges

57 views
Skip to first unread message

Stefano Parmesan

unread,
Nov 28, 2014, 3:01:58 AM11/28/14
to aureliu...@googlegroups.com
Hi all,

I fear Rexster has issues with hyper-edges (the 2.5.0 at least); here's a simple snippet of code to reproduce the issue, copy/pasted from a previous email here on the list:

g = rexster.getGraph("graph")
mgmt = g.getManagementSystem()
p_name = mgmt.makePropertyKey('name').dataType(String.class).make()
p_through = mgmt.makeEdgeLabel('through').unidirected().make()
mgmt.buildIndex('byName', Vertex.class).addKey(p_name).buildCompositeIndex()
mgmt.commit()

v = g.addVertex(['name': 'Anne'])
u = g.addVertex(['name': 'Bob'])
w = g.addVertex(['name': 'Eve'])
v.addEdge('knows', u).setProperty('through', w)

g.commit()

If you point rexster to get the v node (in my case with ID 256) it works as expected:

{"version":"2.5.0","results":{"name":"Anne","_id":256,"_type":"vertex"},"queryTime":10.315556} 

But trying to retrieve the out-edges fails miserably:


The log file contains an anonymous:
395215 [Grizzly(3)] ERROR com.tinkerpop.rexster.VertexResource  - java.lang.NullPointerException

But on our production server, where we first had this bug tonight, we got something more meaningful:

127234354 [Grizzly(3)] ERROR com.tinkerpop.rexster.gremlin.GremlinExtension  - Gremlin Extension: null
java.lang.NullPointerException
        at java.util.HashSet.<init>(HashSet.java:116)
        at com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility.objectNodeFromElement(GraphSONUtility.java:405)
        at com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility.createJSONMap(GraphSONUtility.java:559)
        at com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility.objectNodeFromElement(GraphSONUtility.java:218)
        at com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility.jsonFromElement(GraphSONUtility.java:198)
        at com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility.jsonFromElement(GraphSONUtility.java:388)
        at com.tinkerpop.rexster.gremlin.converter.JSONResultConverter.prepareOutput(JSONResultConverter.java:98)
        at com.tinkerpop.rexster.gremlin.converter.JSONResultConverter.convert(JSONResultConverter.java:67)
        at com.tinkerpop.rexster.gremlin.GremlinExtension.tryExecuteGremlinScript(GremlinExtension.java:278)
        at com.tinkerpop.rexster.gremlin.GremlinExtension.evaluateGetOnGraph(GremlinExtension.java:175)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...

I'm sure Stephen will find and fix the bug in a flash, but in case it's something more complicated than what it seems, does anybody know a workaround for this?

Thank you

--
Dott. Stefano Parmesan
Backend Web Developer and Data Lover ~ SpazioDati s.r.l.
Via Adriano Olivetti, 13 – 4th floor
"Le Albere" district – 38122 Trento – Italy

Stephen Mallette

unread,
Nov 28, 2014, 7:41:49 AM11/28/14
to aureliu...@googlegroups.com
I guess GraphSON doesn't know how to deal with serialization of that type of object.  I can look into it...please create a Rexster issue in github and reference this thread.  As for workarounds, all you need to do is avoid the standard REST routes, use the REST Gremlin Extension and supply your own serialization function in your gremlin itself to write instances of it to a Map which Rexster shouldn't have a problem dealing with by default.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/CAB8vuViBnpOqhRmZyUYtOKuR%3DMnOt1c2ZxEMW_n4Cbd0_2pfsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Stefano Parmesan

unread,
Nov 30, 2014, 4:57:13 PM11/30/14
to aureliu...@googlegroups.com
Thank you Stephen. You've  probably already received the notification email from github, but for future reference let me paste the link to the issue here as well: https://github.com/tinkerpop/rexster/issues/376


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages