Skip to content

Instantly share code, notes, and snippets.

@spmallette
Created March 29, 2012 11:49
Show Gist options
  • Save spmallette/2236430 to your computer and use it in GitHub Desktop.
Save spmallette/2236430 to your computer and use it in GitHub Desktop.
OrientDB and Rexster
curl -X POST http://localhost:8182/graphs/orientdbsample/vertices
curl -X POST http://localhost:8182/graphs/orientdbsample/vertices
curl -X POST "http://localhost:8182/graphs/orientdbsample/edges?_outV=6:0&_inV=6:1&_label=friend"
curl -X POST "http://localhost:8182/graphs/orientdbsample/edges?_outV=6:0&_inV=6:1&_label=pal"
curl -X POST "http://localhost:8182/graphs/orientdbsample/edges?_outV=6:0&_inV=6:1&_label=buddy"
C:\>curl -X POST http://localhost:8182/graphs/orientdbsample/vertices
{"version":"0.8","results":{"_id":"#6:0","_type":"vertex"},"queryTime":211.033525}
C:\>curl -X POST http://localhost:8182/graphs/orientdbsample/vertices
{"version":"0.8","results":{"_id":"#6:1","_type":"vertex"},"queryTime":3.88541}
C:\>curl -X POST "http://localhost:8182/graphs/orientdbsample/edges?_outV=6:0&_inV=6:1&_label=friend"
{"version":"0.8","results":{"_id":"#7:-2","_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"friend"},"queryTime":13.
763761}
C:\>curl -X POST "http://localhost:8182/graphs/orientdbsample/edges?_outV=6:0&_inV=6:1&_label=pal"
{"version":"0.8","results":{"_id":"#7:-2","_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"pal"},"queryTime":7.0860
96}
C:\>curl -X POST "http://localhost:8182/graphs/orientdbsample/edges?_outV=6:0&_inV=6:1&_label=buddy"
{"message":"Transaction failed on POST of edge.","error":"Cannot update record #6:0 in storage 'orientdb-graph' because
the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v2 yo
ur=v0)"}
C:\>curl http://localhost:8182/graphs/orientdbsample/edges
{"version":"0.8","results":[{"_id":"#7:0","_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"friend"},{"_id":"#7:1","
_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"pal"}],"totalSize":2,"queryTime":6.756166}
C:\>curl http://localhost:8182/graphs/orientdbsample/vertices/6:0/bothE
{"version":"0.8","results":[{"_id":"#7:0","_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"friend"},{"_id":"#7:1","
_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"pal"}],"totalSize":2,"queryTime":5.471086}
C:\>curl -X POST "http://localhost:8182/graphs/orientdbsample/edges?_outV=6:0&_inV=6:1&_label=buddy"
{"version":"0.8","results":{"_id":"#7:-2","_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"buddy"},"queryTime":8.71
4795}
C:\>curl http://localhost:8182/graphs/orientdbsample/edges
{"version":"0.8","results":[{"_id":"#7:0","_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"friend"},{"_id":"#7:1","
_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"pal"},{"_id":"#7:2","_type":"edge","_outV":"#6:0","_inV":"#6:1","_l
abel":"buddy"}],"totalSize":3,"queryTime":3.45435}
C:\>curl "http://localhost:8182/graphs/orientdbsample/vertices/6:1/inE"
{"version":"0.8","results":[{"_id":"#7:0","_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"friend"},{"_id":"#7:1","
_type":"edge","_outV":"#6:0","_inV":"#6:1","_label":"pal"}],"totalSize":2,"queryTime":1.45661}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment