Broken rexster.show_types=true

7 views
Skip to first unread message

Pierre De Wilde

unread,
Apr 13, 2011, 10:26:50 PM4/13/11
to gremli...@googlegroups.com
Hi,

New version of rester does not return types anymore:

http://localhost:8182/tinkergraph/vertices/1?rexster.show_types=true

{"version":"0.3-SNAPSHOT","results":{"_id":"1","_type":"vertex","name":"marko","age":29},"query_time":0.512,"links":[{"title":"Gremlin extension for a vertex.","href":"tp\/gremlin"}]}

instead of

{"version":"0.3-SNAPSHOT","results": {"_id":{"type": "string","value": "1"},"_type":"vertex","name":{"type":"string","value":"marko"},"age":{"type":"int","value":29}}, ...

resulting errors in gremlin. e.g.

gremlin> g = new RexsterGraph('http://localhost:8182/tinkergraph')
gremlin> v = g.v(1)                                               
==>v[1]
gremlin> v.name
java.lang.String cannot be cast to org.json.simple.JSONObject
Display stack trace? [yN] 

Pierre


Marko Rodriguez

unread,
Apr 13, 2011, 10:33:33 PM4/13/11
to gremli...@googlegroups.com
Hey,

I believe Stephen is changing keys to be more "Java-style."

Try -- rexster.showTypes

Given the mass refactoring for extension model, we are going through and tightening other things as well.

This will all be documented as we move forward towards the 0.3 release... 

Thanks,
Marko.

Pierre De Wilde

unread,
Apr 13, 2011, 10:47:19 PM4/13/11
to gremli...@googlegroups.com
OK, thanks.

Therefore, RexsterGraph() is currently unusable until realigned with reXster version.

Pierre

2011/4/14 Marko Rodriguez <okram...@gmail.com>

Marko Rodriguez

unread,
Apr 13, 2011, 10:51:23 PM4/13/11
to gremli...@googlegroups.com
Hey,

> Therefore, RexsterGraph() is currently unusable until realigned with reXster version.


Yes. Rexster 0.3-SNAPSHOT is the main line, but its not a release. We will be sync'ing things and documenting over the next week...

Do you need RexsterGraph to work for you right now?

Thanks for the heads up,
Marko.

Pierre De Wilde

unread,
Apr 14, 2011, 3:44:08 AM4/14/11
to gremli...@googlegroups.com
I was doing a lots of tests with RexsterGraph() but can wait to the next week.

Do you plan to optimize RexsterGraph() in the next release?

1. use new POST requests as described by Stephen
2. reduce the number of calls to reXster server

To illustrate the last point:

gremlin> g = new RexsterGraph('http://localhost:8182/tinkergraph')
=> 3 (identical) GET calls

gremlin> g.V{it.name=='marko'}
=> 14 GET calls
instead of 1 (optimized) call:

gremlin> v = g.v(1)
=> 1 GET call (OK)

gremlin> v.outE('knows)
=> 4 GET calls
Only the first call is necessary since the response has enough results:
"results": [
    {
        "_id": "7", 
        "_inV": "2", 
        "_label": "knows", 
        "_outV": "1", 
        "_type": "edge", 
        "weight": 0.5
    }, 
    {
        "_id": "8", 
        "_inV": "4", 
        "_label": "knows", 
        "_outV": "1", 
        "_type": "edge", 
        "weight": 1.0
    }
],

...

And last but not least:

Thank you (+others) for tinkerpop products.
It's a fantastic way to explore graph databases.

Pierre


2011/4/14 Marko Rodriguez <okram...@gmail.com>
Hey,

stephen mallette

unread,
Apr 14, 2011, 6:54:31 AM4/14/11
to Gremlin-users
Marko, if you want, I can pick up maintaining RexsterGraph to stay in
synch with Rexster. Let me know if that helps.

On Apr 14, 3:44 am, Pierre De Wilde <pierredewi...@gmail.com> wrote:
> I was doing a lots of tests with RexsterGraph() but can wait to the next
> week.
>
> Do you plan to optimize RexsterGraph() in the next release?
>
> 1. use new POST requests as described by Stephen
> 2. reduce the number of calls to reXster server
>
> To illustrate the last point:
>
> gremlin> g = new RexsterGraph('http://localhost:8182/tinkergraph')
> => 3 (identical) GET callshttp://localhost:8182/tinkergraphhttp://localhost:8182/tinkergraphhttp://localhost:8182/tinkergraph
>
> gremlin> g.V{it.name=='marko'}
> => 14 GET callshttp://localhost:8182/tinkergraph/vertices?rexster.offset.start=0&rex...http://localhost:8182/tinkergraph/vertices/1http://localhost:8182/tinkergraph/vertices/2http://localhost:8182/tinkergraph/vertices/3http://localhost:8182/tinkergraph/vertices/4http://localhost:8182/tinkergraph/vertices/5http://localhost:8182/tinkergraph/vertices/6http://localhost:8182/tinkergraph/vertices/1?rexster.show_types=truehttp://localhost:8182/tinkergraph/vertices/2?rexster.show_types=truehttp://localhost:8182/tinkergraph/vertices/3?rexster.show_types=truehttp://localhost:8182/tinkergraph/vertices/4?rexster.show_types=truehttp://localhost:8182/tinkergraph/vertices/5?rexster.show_types=truehttp://localhost:8182/tinkergraph/vertices/6?rexster.show_types=truehttp://localhost:8182/tinkergraph/vertices?rexster.offset.start=100&r...
> instead of 1 (optimized) call:http://localhost:8182/tinkergraph/indices/vertices?key=name&value=marko
>
> gremlin> v = g.v(1)
> => 1 GET call (OK)http://localhost:8182/tinkergraph/vertices/1
>
> gremlin> v.outE('knows)
> => 4 GET callshttp://localhost:8182/tinkergraph/vertices/1/outE?_label=knows&rexste...http://localhost:8182/tinkergraph/edges/7http://localhost:8182/tinkergraph/edges/8http://localhost:8182/tinkergraph/vertices/1/outE?_label=knows&rexste...
> Only the first call is necessary since the response has enough results:
> "results": [
>     {
>         "_id": "7",
>         "_inV": "2",
>         "_label": "knows",
>         "_outV": "1",
>         "_type": "edge",
>         "weight": 0.5
>     },
>     {
>         "_id": "8",
>         "_inV": "4",
>         "_label": "knows",
>         "_outV": "1",
>         "_type": "edge",
>         "weight": 1.0
>     }
> ],
>
> ...
>
> And last but not least:
>
> Thank you (+others) for tinkerpop products.
> It's a fantastic way to explore graph databases.
>
> Pierre
>
> 2011/4/14 Marko Rodriguez <okramma...@gmail.com>

Marko Rodriguez

unread,
Apr 14, 2011, 7:01:33 AM4/14/11
to gremli...@googlegroups.com
Hey,

> 1. use new POST requests as described by Stephen

I will have to work with Stephen on it as I wasn't following that thread, but yes---I suppose :)

> 2. reduce the number of calls to reXster server

Hmm. RexsterGraph is not intended to be a "traveral engine." Its meant to just connect to Rexster as an "admin tool." I would not use RexsterGraph for algorithm development because, as you note, its very chatty (and JSON chatty at that). I would recommend using the GremlinExtension to pass Gremlin to Rexster (or write your own extension) if you want to do heavy algorithms against Rexster.
Question: in which way are you using RexsterGraph (i.e. use case)?

Thanks,
Marko.

Marko Rodriguez

unread,
Apr 14, 2011, 7:15:12 AM4/14/11
to gremli...@googlegroups.com
Yo Mallette da Machette,

That'd be dope.

To test it you would do this:
1. load up Rexster (with emptygraph being the graph that is tested against)
2. Run RexsterGraphTest (if you are in IntelliJ, "right click run test" as I have it turned off in the pom.xml properties <doTest>false</doTest>).

See ya,
Marko.

Pierre De Wilde

unread,
Apr 14, 2011, 8:17:25 AM4/14/11
to gremli...@googlegroups.com
Hi,

Thank you for your answer.

> RexsterGraph is not intended to be a "traveral engine.

Why not? 

RexsterGraph() is a very powerful idea because it offers a remote access on top of any local Blueprints graphDB.  
RexsterGraph can be used to communicate with a remote graph with complete HTTP-transparency to the user.

Moreover, by implementing reXster REST API compatible servers, Gremlin may be used as general-purpose traversal engine on top of ANY datastore, including non-graphDBs like RDBMS.
RexsterGraph() becomes the common interface to any Blueprints (Java) and non-Blueprints (non-Java) implementations.

Performance would probably be sub-optimal(*) compared with local Blueprints implementations. 
With the suggested RexsterGraph() optimizations, performance may be acceptable like any cloud service.

Hope that it echoes,

Pierre

(*) like any remote access with HTTP latency and JSON serialization/deserialization



2011/4/14 Marko Rodriguez <okram...@gmail.com>
Reply all
Reply to author
Forward
0 new messages