Closed mjp0 closed 11 years ago
Hi zero-,
Have you added the relevant neo4j jar files to the lib directory?
Also are you able to provide the code that you used to create the graphDB variable.
Thanks Frank
I was getting errors that I'm missing files for Neo4j but I didn't have any clue what are relevant files so I downloaded Gremlin and copied all blueprint .jar files to gremlin-node directory. Now I've blueprints for every possible scenario ;)
var Neo4jGraph = g.java.import('com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph');
var graphDB = new Neo4jGraph(__dirname+"../temp/neo4j");
g.SetGraph(graphDB);
I use above to initialize the connection and I'm not getting any errors. Only thing I'm not sure is the location of Neo4j. Is it suppose to point at Neo4j's data directory or is it just a file for temp data? Also if I add vertex, I can see that there is vertexes with g.V() but they all seem empty like the name property wasn't saved or something.
Ok, I haven't used Neo4j before, maybe it's time I checked it out. Let me take a look at this and I'll see if I can get it up and running and provide an example. Give me a couple of days.
Frank
Ok, sounds good. Let me know if it's suppose to work or if I'm just doing it wrong :)
I just tried this with OrientDB and it's behaving similarly so I suspect it's my code. Take a look and let me know if you notice something.
var OrientGraph = g.java.import('com.tinkerpop.blueprints.impls.orient.OrientGraph');
var graphDB = new OrientGraph('local:127.0.0.1/tinkerpop', 'admin', 'admin');
g.SetGraph(graphDB);
graphDB.addVertex(null, function(err, personA){
personA.type = 'person'
personA.value = 'MarkoA'
console.log(personA)
graphDB.addVertex(null, function(err, personB){
personB.type = 'person'
personB.value = 'MarkoB'
console.log(personB)
graphDB.addEdge(null, personB, personA, "follows", function(err, edge){
if(err) throw err;
edge.createdAt = 1234
console.log(edge)
var list = g.V().index(0).property('type').toJSON();
console.log(list)
})
})
})
Ensure that the OrientDB server is running, then connect to the database using a remote connection like so
var graphDB = new OrientGraph('remote:localhost/tinkerpop', 'admin', 'admin');
local connection won't work.
Also can you try to run gremlinServer.js. You'll find the file in the examples directory.
Ok. I don't know if this goes out of scope but I'm getting this Caused by: com.orientechnologies.orient.core.exception.OConfigurationException: Error on opening database: the engine 'remote' was not found. URL was: remote:127.0.0.1/tinkerpop. Registered engines are: [local, memory]
if I use remote.
Do you happen to know how to register remote as engine with OrientDB? :)
That looks like you need to include more jar files. You should find them on the OrientDB site. In the meantime see if you can get the example node script running.
Ok, I included orientdb-client.jar but it now refuses to open the database: SEVERE: Error on opening database: 127.0.0.1/tinkerpop
. I know the database is accessible because OrientDB's own console works and connects with exactly same parameters. So I'm not sure whether I'm still missing some .jar or why it's not connecting properly.
This is from gremlin-console.js. gremlinServer.js worked without any issues.
Here's the full error log.
May 17, 2013 10:35:20 AM com.orientechnologies.common.log.OLogManager log
SEVERE: Error on opening database: 127.0.0.1/tinkerpop
java.lang.NoClassDefFoundError: com/orientechnologies/orient/enterprise/channel/binary/ORemoteServerEventListener
at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:39)
at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:163)
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.open(ODatabaseRaw.java:95)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:114)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47)
at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90)
at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:401)
at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:73)
at com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.java:68)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
Caused by: java.lang.ClassNotFoundException: com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 14 more
Error: Error creating class
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on opening database: 127.0.0.1/tinkerpop
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.orientechnologies.common.log.OLogManager.error(OLogManager.java:119)
at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:46)
at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:163)
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.open(ODatabaseRaw.java:95)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:114)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47)
at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90)
at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:401)
at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:73)
at com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.java:68)
... 4 more
Caused by: java.lang.NoClassDefFoundError: com/orientechnologies/orient/enterprise/channel/binary/ORemoteServerEventListener
at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:39)
... 13 more
Caused by: java.lang.ClassNotFoundException: com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 14 more
at new java.import.result (/Tests/node_modules/java/lib/nodeJavaBridge.js:22:33)
at repl:1:15
at REPLServer.self.eval (repl.js:111:21)
at rli.on.self.bufferedCmd (repl.js:258:20)
at REPLServer.self.eval (repl.js:116:5)
at Interface.<anonymous> (repl.js:248:12)
at Interface.EventEmitter.emit (events.js:96:17)
at Interface._onLine (readline.js:200:10)
at Interface._line (readline.js:518:8)
at Interface._ttyWrite (readline.js:736:14)
Ok. I think you're still missing some jar files. If I remember correctly you need to also add the jars that allow remote connection. On 17/05/2013 5:41 PM, "zero-" notifications@github.com wrote:
Ok, I included orientdb-client.jar but it now refuses to open the database: SEVERE: Error on opening database: 127.0.0.1/tinkerpop. I know the database is accessible because OrientDB's own console works and connects with exactly same parameters. So I'm not sure whether I'm still missing some .jar or why it's not connecting properly.
Here's the full error log.
May 17, 2013 10:35:20 AM com.orientechnologies.common.log.OLogManager log SEVERE: Error on opening database: 127.0.0.1/tinkerpop java.lang.NoClassDefFoundError: com/orientechnologies/orient/enterprise/channel/binary/ORemoteServerEventListener at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:39) at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:163) at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.open(ODatabaseRaw.java:95) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:114) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:401) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.
(OrientBaseGraph.java:73) at com.tinkerpop.blueprints.impls.orient.OrientGraph. (OrientGraph.java:68) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) Caused by: java.lang.ClassNotFoundException: com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 14 more Error: Error creating class java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on opening database: 127.0.0.1/tinkerpop at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.orientechnologies.common.log.OLogManager.error(OLogManager.java:119) at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:46) at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:163) at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.open(ODatabaseRaw.java:95) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:114) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:401) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.
(OrientBaseGraph.java:73) at com.tinkerpop.blueprints.impls.orient.OrientGraph. (OrientGraph.java:68) ... 4 more Caused by: java.lang.NoClassDefFoundError: com/orientechnologies/orient/enterprise/channel/binary/ORemoteServerEventListener at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:39) ... 13 more Caused by: java.lang.ClassNotFoundException: com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 14 more at new java.import.result (/Tests/node_modules/java/lib/nodeJavaBridge.js:22:33) at repl:1:15 at REPLServer.self.eval (repl.js:111:21) at rli.on.self.bufferedCmd (repl.js:258:20) at REPLServer.self.eval (repl.js:116:5) at Interface.<anonymous> (repl.js:248:12) at Interface.EventEmitter.emit (events.js:96:17) at Interface._onLine (readline.js:200:10) at Interface._line (readline.js:518:8) at Interface._ttyWrite (readline.js:736:14)
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18047829 .
See https://code.google.com/p/orient/wiki/JavaAPI
You need client, core, common and enterprise On 17/05/2013 5:41 PM, "zero-" notifications@github.com wrote:
Ok, I included orientdb-client.jar but it now refuses to open the database: SEVERE: Error on opening database: 127.0.0.1/tinkerpop. I know the database is accessible because OrientDB's own console works and connects with exactly same parameters. So I'm not sure whether I'm still missing some .jar or why it's not connecting properly.
Here's the full error log.
May 17, 2013 10:35:20 AM com.orientechnologies.common.log.OLogManager log SEVERE: Error on opening database: 127.0.0.1/tinkerpop java.lang.NoClassDefFoundError: com/orientechnologies/orient/enterprise/channel/binary/ORemoteServerEventListener at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:39) at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:163) at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.open(ODatabaseRaw.java:95) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:114) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:401) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.
(OrientBaseGraph.java:73) at com.tinkerpop.blueprints.impls.orient.OrientGraph. (OrientGraph.java:68) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) Caused by: java.lang.ClassNotFoundException: com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 14 more Error: Error creating class java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on opening database: 127.0.0.1/tinkerpop at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.orientechnologies.common.log.OLogManager.error(OLogManager.java:119) at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:46) at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:163) at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.open(ODatabaseRaw.java:95) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:114) at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:90) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:401) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.
(OrientBaseGraph.java:73) at com.tinkerpop.blueprints.impls.orient.OrientGraph. (OrientGraph.java:68) ... 4 more Caused by: java.lang.NoClassDefFoundError: com/orientechnologies/orient/enterprise/channel/binary/ORemoteServerEventListener at com.orientechnologies.orient.client.remote.OEngineRemote.createStorage(OEngineRemote.java:39) ... 13 more Caused by: java.lang.ClassNotFoundException: com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 14 more at new java.import.result (/Tests/node_modules/java/lib/nodeJavaBridge.js:22:33) at repl:1:15 at REPLServer.self.eval (repl.js:111:21) at rli.on.self.bufferedCmd (repl.js:258:20) at REPLServer.self.eval (repl.js:116:5) at Interface.<anonymous> (repl.js:248:12) at Interface.EventEmitter.emit (events.js:96:17) at Interface._onLine (readline.js:200:10) at Interface._line (readline.js:518:8) at Interface._ttyWrite (readline.js:736:14)
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18047829 .
Now it connects but addVertex() etc. don't work. I verified from OrientDB's console that there's no data in the database that matches what the code stores.
Ok leave it with me. On 17/05/2013 6:13 PM, "zero-" notifications@github.com wrote:
Now it connects but addVertex() etc. don't work. I verified from OrientDB's console that there's no data in the database that matches what the code stores.
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18048941 .
Hi zero-,
Can you try and install the latest version, it's probably best if you uninstall the old version. Once you've done that just type
npm install gremlin Then navigate to the examples directory and type node gremlinServer.js This should run the TinkerGraph test. If that works give Orient graphDB another go.
Frank
Hey.
Now gremlin-node doesn't install. Seems like some sort of compability issue with NPM because I just updated it.
Error:
npm ERR! TypeError: Arguments to path.resolve must be strings
npm ERR! at Object.exports.resolve (path.js:313:15)
npm ERR! at Object.exports.relative (path.js:370:20)
npm ERR! at installOne_ (/usr/local/lib/node_modules/npm/lib/install.js:711:26)
npm ERR! at installOne (/usr/local/lib/node_modules/npm/lib/install.js:638:3)
npm ERR! at /usr/local/lib/node_modules/npm/lib/install.js:525:9
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:54:35
npm ERR! at Array.forEach (native)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:54:11
npm ERR! at Array.forEach (native)
npm ERR! at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:53:8)
...
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.2
Try removing gremlin-node and try again. You will also need to install maven, if you haven't already.
Did that and installed Maven2. It actually started to install dependencies but had a fatal error and died. I thought it might be because of old NPM version (seen that happen before) so I updated NPM & Node and here we are now ;)
Ok. I just installed it on my system. I'm using npm 1.2.18 and node 10.6. I'll update my node and test. Have you installed python 2.x.?
Frank
Ok. I've installed successfully with node 10.7 and npm 1.2.21. What version of java are you running?
Yes, I have python installed.
I just manually upgraded from npm 1.2.2 to 1.2.21 and it seems that 1.2.2 is the culprit. Nice thing is that official 64bit NodeJS Linux package seems to be packaged with 1.2.2 :/
Now dependencies are installing.
Great! :) You should be able to run the gremlinServer.js script in the examples directory. Also you should be able to start a remote OrientDB server and then try to connect because I've included the required jar files. You will just need to download Orient graphdb and start the server. Let me know how you go.
Now everything runs but I'm actually still get nothing :dancers:
var OrientGraph = g.java.import('com.tinkerpop.blueprints.impls.orient.OrientGraph');
var graphDB = new OrientGraph('remote:192.168.1.12/temp', 'admin', '...');
g.SetGraph(graphDB);
graphDB.addVertex(null, function(err, personA){
if(err) throw err;
personA.type = 'person'
personA.value = 'MarkoA'
console.log(personA)
graphDB.addVertex(null, function(err, personB){
if(err) throw err;
personB.type = 'person'
personB.value = 'MarkoB'
console.log(personB)
graphDB.addEdge(null, personB, personA, "follows", function(err, edge){
if(err) throw err;
edge.createdAt = 1234
console.log(edge)
var list = g.V({type:'person'}).toJSON();
console.log(list)
})
})
})
}
Do you successfully get something out of list variable at the end?
Can't check it right now. Are you anle to check the permissions on the directory On 20/05/2013 6:17 PM, "zero-" notifications@github.com wrote:
Now everything runs but I'm actually still get nothing [image: :dancers:]
var OrientGraph = g.java.import('com.tinkerpop.blueprints.impls.orient.OrientGraph'); var graphDB = new OrientGraph('remote:192.168.1.12/temp', 'admin', '...'); g.SetGraph(graphDB);
graphDB.addVertex(null, function(err, personA){ if(err) throw err; personA.type = 'person' personA.value = 'MarkoA'
console.log(personA) graphDB.addVertex(null, function(err, personB){ if(err) throw err; personB.type = 'person' personB.value = 'MarkoB' console.log(personB) graphDB.addEdge(null, personB, personA, "follows", function(err, edge){ if(err) throw err; edge.createdAt = 1234 console.log(edge) var list = g.V({type:'person'}).toJSON(); console.log(list) }) }) })
}
Do you successfully get something out of list variable at the end?
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18136664 .
Ok, new thing.
I started OrientDB as a root to avoid any permission issues but now when I start the script java process eats 99% CPU and I get Exception in thread "Thread-1" com.orientechnologies.common.concur.OTimeoutException: Timeout on acquiring exclusive lock against resource of class: class com.orientechnologies.common.concur.resource.OSharedResourceAdaptiveExternal with timeout=5000
I can't believe how many things seems to go wrong :)
We'll get there. Are you using remote to orientdb? I'll also do some tests a bit later. On 20/05/2013 6:44 PM, "zero-" notifications@github.com wrote:
Ok, new thing.
I started OrientDB as a root to avoid any permission issues but now when I start the script java process eats 99% CPU and I get Exception in thread "Thread-1" com.orientechnologies.common.concur.OTimeoutException: Timeout on acquiring exclusive lock against resource of class: class com.orientechnologies.common.concur.resource.OSharedResourceAdaptiveExternal with timeout=5000
I can't believe how many things seems to go wrong :)
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18137512 .
Yeah, using the code above. I'll dive into OrientDB if there's something there. I'll also test Titan.
Have you ran the grelinServer.js script in the examples directory? On 20/05/2013 6:59 PM, "zero-" notifications@github.com wrote:
Yeah, using the code above. I'll dive into OrientDB if there's something there. I'll also test Titan.
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18138018 .
Yes and that works perfectly. That's why this is a bit puzzling and I'm not sure which end is not working correctly.
Ok. At least thats working. Have a play around but I'll take s look a bit later. On 20/05/2013 7:06 PM, "zero-" notifications@github.com wrote:
Yes and that works perfectly. That's why this is a bit puzzling and I'm not sure which end is not working correctly.
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18138230 .
Progress. I got g.V().toJSON()
to work. CPU problem disappeared when I just let it run for like 5 minutes. I've no idea what it was doing. Now the problem is that it seems my own values from the script like {type:'Person', value: 'MarkoA'}
are not saved but I do get values from database that I saved from OrientDB's console.
You will need to commit them On 20/05/2013 7:20 PM, "zero-" notifications@github.com wrote:
Progress. I got g.V().toJSON() to work. CPU problem disappeared when I just let it run for like 5 minutes. I've no idea what it was doing. Now the problem is that it seems my own values from the script like {type:'Person', value: 'MarkoA'} are not saved but I do get values from database that I saved from OrientDB's console.
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18138725 .
Not to be pain in the ass but how do I do that? :)
gremlinServer.js has this example and I can't seem to find anything on GremlimDocs:
tg.addVertex(100, function(err, newVertex){
newVertex.name = 'stephen';
console.log('Added Vertex Async==>'+newVertex.toString());
console.log('Added Vertex property==>'+newVertex.name.toString());
});
tg.commit () On 20/05/2013 7:45 PM, "zero-" notifications@github.com wrote:
Not to be pain in the ass but how do I do that? :)
gremlinServer.js has this example and I can't seem to find anything on GremlimDocs:
tg.addVertex(100, function(err, newVertex){ newVertex.name = 'stephen'; console.log('Added Vertex Async==>'+newVertex.toString()); console.log('Added Vertex property==>'+newVertex.name.toString()); });
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18139591 .
I'm doing commit but they're still not going in. Weird thing is that console.log(personA.toString())
prints v[#8:-2]
and the same vertex id is also repeat for personB. All existing vertexes are starting from 8:0 and up so you know what -2 could mean?
Yes. The -2 means that its a temporary id. 8 is the class id. Thats an Orient thing. Once you commit the id should update. Maybe try doing a commit with the call back, the id might come through then. On 20/05/2013 8:10 PM, "zero-" notifications@github.com wrote:
I'm doing commit but they're still not going in. Weird thing is that console.log(personA.toString) prints v[#8:-2] and the same vertex id is also repeat for personB. All existing vertexes are starting from 8:0 and up so you know what -2 could mean?
— Reply to this email directly or view it on GitHubhttps://github.com/entrendipity/gremlin-node/issues/9#issuecomment-18140405 .
I tried with callback but couldn't get it to print anything other than null. I switched to Titan because that's what we will be using (decided today, finally \o/). After I copied all .jars from titan/lib and everything seems to go ok with the script but still nothing gets committed. g.V().toJSON()
gives me empty array.
Tried with commit() callback and without.
Now I got it to commit successfully but it seems addEdge doesn't work as expected.
When I use addEdge function graphDB.addEdge(null, personB, personA, "follows", function(err, edge){})
I get:
Uncaught Error: Error running instance method
...
Caused by: java.lang.IllegalArgumentException: The vertex or type is not associated with this transaction [v[280008]]
Any ideas what I need to do to associate the vertex with the edge? Sorry if I'm asking dumb questions. I've only worked with Neo4j before and without Gremlin so it's a bit of learning process :)
No, not silly questions at all. Are you now using Titan?
Yes, I'm focusing on getting this to work on Titan.
I found out that for some reason if I call commit()
alone it doesn't commit but if I call shutdown()
after it, it commits. I wonder if there's some memory flush type of thing going on here.
Try commitSync()
Tried that, doesn't work any better. I'm using Titan with embedded Cassandra in case that makes any difference.
It seems that only way I can get my commits go thru is that if I close the script with shutdown()
. However obviously if I do g.V()
before shutdown()
I won't see those new vertexes. I'll only see them when I run the script the next time.
OK. I got it to work in Orient and theoretically this should work in Titan.
var luca = graphDB.addVertexSync(null); luca.setPropertySync( "name", "Luca" );
console.log(g.V('name','Luca').toJSON()); graphDB.commitSync(); console.log(g.V('name','Luca').toJSON());
and this...
var luca = graphDB.addVertexSync(null); luca.setPropertySync( "name", "Luca" );
var marko = graphDB.addVertexSync(null); marko.setPropertySync( "name", "Marko" );
var lucaKnowsMarko = graphDB.addEdgeSync(null, luca, marko, "knows"); console.log("Created edge: " + lucaKnowsMarko.getIdSync() );
graphDB.commitSync(); console.log(g.V().toJSON()); console.log(g.E().toJSON());
console.log(g.V().out().toJSON());
I'm starting to think the async call backs don't work.
Yes, I agree. I just followed your example and it's working with Titan as well.
Any performance penalty from using Sync versions?
That's great. With regards to performance, well yes there may be a performance penalty as the sync calls block i/o. This is quite a common senario for database calls, however for high traffic and large data processing I would look at employing techniques that push processing else where, like into a Worker. I will be looking into this some time in the future but I'm not sure when.
Anyway, I'm glad you got it working. Please feel free to ask any more questions but I'll close this one off now.
This is my first time using Neo4J with Gremlin so I'm a bit lost.
If I save a vertex like
graphDB.addVertex(null,function(err,v){ v.name = "test" })
am I suppose to get a vertex with property name with value test? If I now query database withg.V('name', 'test').out();
I get nothing. Doesn't matter if I add.toJSON()
or.toList()
- I still get nothing.