Last active
December 26, 2015 15:39
-
-
Save espeed/7174642 to your computer and use it in GitHub Desktop.
Bulbs/Rexster server-side Gremlin scripts example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bulbs/Rexster server-side Gremlin script example. | |
# by James Thornton, http://jamesthornton.com | |
>>> from bulbs.rexster import Graph, DEBUG | |
>>> g = Graph() | |
>>> g.config.server_scripts = True | |
>>> g.config.set_logger(DEBUG) | |
>>> james = g.vertices.create(name="James") | |
POST url: http://localhost:8182/graphs/emptygraph/vertices | |
POST body: {"name":"James"} | |
>>> julie = g.vertices.create(name="Julie") | |
POST url: http://localhost:8182/graphs/emptygraph/vertices | |
POST body: {"name":"Julie"} | |
>>> g.edges.create(james, "knows", julie) | |
POST url: http://localhost:8182/graphs/emptygraph/edges | |
POST body: {"_label":"knows","_outV":471,"_inV":472} | |
<Edge: http://localhost:8182/graphs/emptygraph/edges/473> | |
>>> james.outV("knows") | |
POST url: http://localhost:8182/graphs/emptygraph/tp/gremlin | |
POST body: {"load":["gremlin"],"params":{"start":null,"_id":471,"limit":null,"label":"knows"},"script":"outV(_id, label, start, limit)"} | |
<generator object <genexpr> at 0x1de4140> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment