{"action":"created","issue":{"url":"https://api.github.com/repos/thinkaurelius/neo4j-gremlin-plugin/issues/6","labels_url":"https://api.github.com/repos/thinkaurelius/neo4j-gremlin-plugin/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/thinkaurelius/neo4j-gremlin-plugin/issues/6/comments","events_url":"https://api.github.com/repos/thinkaurelius/neo4j-gremlin-plugin/issues/6/events","html_url":"https://github.com/thinkaurelius/neo4j-gremlin-plugin/issues/6","id":63546368,"number":6,"title":"How to keep loaded graph in memory","user":{"login":"NitinJamadagni","id":5332958,"avatar_url":"https://avatars.githubusercontent.com/u/5332958?v=3","gravatar_id":"","url":"https://api.github.com/users/NitinJamadagni","html_url":"https://github.com/NitinJamadagni","followers_url":"https://api.github.com/users/NitinJamadagni/followers","following_url":"https://api.github.com/users/NitinJamadagni/following{/other_user}","gists_url":"https://api.github.com/users/NitinJamadagni/gists{/gist_id}","starred_url":"https://api.github.com/users/NitinJamadagni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NitinJamadagni/subscriptions","organizations_url":"https://api.github.com/users/NitinJamadagni/orgs","repos_url":"https://api.github.com/users/NitinJamadagni/repos","events_url":"https://api.github.com/users/NitinJamadagni/events{/privacy}","received_events_url":"https://api.github.com/users/NitinJamadagni/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-22T15:51:00Z","updated_at":"2015-03-22T18:05:50Z","closed_at":"2015-03-22T18:05:50Z","body":"Hey,\r\nHow does the \"load\" exactly work?\r\nLet's say I issue a curl request with a gremlin script where I load the given script.\r\n\r\n     curl -s -G --data-urlencode 'script=constructgraph()' --data-urlencode 'load=trial_load_users' http://localhost:7474/tp/gremlin/execute\r\n\r\nScript:::\r\n\r\n             g= new Neo4j2Graph('/home/nitin/Desktop/MINOR_PROJECT/neo4j-community-2.1.7/data/user_appl.db')\r\n          \r\n            def constructgraph()\r\n           {\r\n\t          g.addVertex([identity:\"kkns1\",gender:\"male\"]);\r\n                  g.addVertex([identity:\"kkns2\",gender:\"male\"]);\r\n                  g.addVertex([identity:\"kkns3\",gender:\"male\"]);\r\n                  g.addVertex([identity:\"kkns4\",gender:\"female\"]);\r\n                  g.addVertex([identity:\"kkns5\",gender:\"male\"]);\r\n                  g.V.has('identity').sideEffect({it.weight=0});\r\n                  g.addVertex([appname:\"VLC\",genre:\"player\"]);\r\n                  g.addVertex([appname:\"Eclipse\",genre:\"IDE\"]);\r\n                  g.addVertex([appname:\"NetBeans\",genre:\"IDE\"]);\r\n                  g.addVertex([appname:\"XChat\",genre:\"IRC\"]);\r\n                  g.addVertex([appname:\"TPA\",genre:\"none\"]);\r\n                  g.V.has(\"identity\",\"kkns1\").next().addEdge(\"uses\",g.V.has(\"appname\",\"VLC\").next());\r\n                  g.V.has(\"identity\",\"kkns1\").next().addEdge(\"uses\",g.V.has(\"appname\",\"Eclipse\").next());\r\n                  g.V.has(\"identity\",\"kkns2\").next().addEdge(\"uses\",g.V.has(\"appname\",\"VLC\").next());\r\n                  g.V.has(\"identity\",\"kkns2\").next().addEdge(\"uses\",g.V.has(\"appname\",\"Eclipse\").next());\r\n\t          g.V.has(\"identity\",\"kkns2\").next().addEdge(\"uses\",g.V.has(\"appname\",\"XChat\").next());\r\n\t          g.V.has(\"identity\",\"kkns3\").next().addEdge(\"uses\",g.V.has(\"appname\",\"VLC\").next());\r\n\t          g.V.has(\"identity\",\"kkns3\").next().addEdge(\"uses\",g.V.has(\"appname\",\"TPA\").next());\r\n\t         g.V.has(\"identity\",\"kkns3\").next().addEdge(\"uses\",g.V.has(\"appname\",\"NetBeans\").next());\r\n\t         g.V.has(\"identity\",\"kkns4\").next().addEdge(\"uses\",g.V.has(\"appname\",\"NetBeans\").next());\r\n\t         g.V.has(\"identity\",\"kkns4\").next().addEdge(\"uses\",g.V.has(\"appname\",\"TPA\").next());\r\n\t         g.V.has(\"identity\",\"kkns5\").next().addEdge(\"uses\",g.V.has(\"appname\",\"Eclipse\").next());\r\n\t         g.E.sideEffect{it.weight=1}\r\n\t         g.V.map;\r\n\t         g.E;\r\n           }\r\n          \r\n\r\n           def display()\r\n           {\r\n\t          g.V.map;\r\n           }\r\n\r\n\r\n\r\nIt writes fine to the .db file,but on the next curl request where I call display() it does not display the map of the vertices.\r\n\r\n     curl -s -G --data-urlencode 'script=display()' --data-urlencode 'load=trial_load_users' http://localhost:7474/tp/gremlin/execute\r\n\r\nHow does the plugin work,does it spawn one gremlin shell and take curl requests?\r\nHow do I keep the g variable in memory,so that I can write different scripts to do different functions on the graph in memory and save the graph later?  "},"comment":{"url":"https://api.github.com/repos/thinkaurelius/neo4j-gremlin-plugin/issues/comments/84667763","html_url":"https://github.com/thinkaurelius/neo4j-gremlin-plugin/issues/6#issuecomment-84667763","issue_url":"https://api.github.com/repos/thinkaurelius/neo4j-gremlin-plugin/issues/6","id":84667763,"user":{"login":"NitinJamadagni","id":5332958,"avatar_url":"https://avatars.githubusercontent.com/u/5332958?v=3","gravatar_id":"","url":"https://api.github.com/users/NitinJamadagni","html_url":"https://github.com/NitinJamadagni","followers_url":"https://api.github.com/users/NitinJamadagni/followers","following_url":"https://api.github.com/users/NitinJamadagni/following{/other_user}","gists_url":"https://api.github.com/users/NitinJamadagni/gists{/gist_id}","starred_url":"https://api.github.com/users/NitinJamadagni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NitinJamadagni/subscriptions","organizations_url":"https://api.github.com/users/NitinJamadagni/orgs","repos_url":"https://api.github.com/users/NitinJamadagni/repos","events_url":"https://api.github.com/users/NitinJamadagni/events{/privacy}","received_events_url":"https://api.github.com/users/NitinJamadagni/received_events","type":"User","site_admin":false},"created_at":"2015-03-22T18:05:50Z","updated_at":"2015-03-22T18:05:50Z","body":"@dkuppitz  :Thanks, I think i get it now! "}}