Replies: 5 comments 16 replies
-
I can help with this as we've started to do something similar against our Arcade server where I work. |
Beta Was this translation helpful? Give feedback.
-
Hi I am evaluating some DB for a new project, and ArcadeDB seems quite promising, in my point of view. However, the missing python lib is for sure a drawback. We had considered doing our own wrappers using the REST interface, and packaging it in a way that we "forget" the calls, and that is it. We have done like that in the past with other things, like Elasticseach before the pip packaged lib was available. One thing we could do is to share that, after it is ready (but the project didn't even started and we are not sure we will infact use arcadedb yet...) May I ask if there were some advances on this, and if yes, how are you thinking to do it? A wrapper over the REST, using something like JPype to access directly java's bytecode? |
Beta Was this translation helpful? Give feedback.
-
Just a silly question. |
Beta Was this translation helpful? Give feedback.
-
While the usefulness has not been exactly proved, I started toying around with it using jpype. Beside this error, just starting it seems to work : I tested creating a database and running a "create" and "match" cypher query, it works
The python code is the following : import jpype
import jpype.imports
from jpype.types import *
# Launch the JVM
jpype.startJVM(classpath=['G:/arcadedb-23.10.1/lib/*'])
import com.arcadedb
config = com.arcadedb.ContextConfiguration()
server = com.arcadedb.server.ArcadeDBServer(config)
server.start() Now the issue is that you would expect that replacing import threading
def threadedFunc (server):
server.start()
thread = threading.Thread(target = threadedFunc, args = (server, ))
import traceback
thread.start()
while True:
pass
#keep the whole thing running But surprisingly it doesn't work that well, the server starts but running any cypher command fails with the following error <ArcadeDB_0> Error on initializing Cypher query engine
java.lang.NullPointerException: Cannot invoke "java.lang.ClassLoader.loadClass(String)" because "ctxtLoader" is null
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getParentLoader(GroovyScriptEngineImpl.java:452)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.access$000(GroovyScriptEngineImpl.java:89)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl$1.run(GroovyScriptEngineImpl.java:119)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl$1.run(GroovyScriptEngineImpl.java:116)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.createClassLoader(GroovyScriptEngineImpl.java:116)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.<init>(GroovyScriptEngineImpl.java:111)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.<init>(GremlinGroovyScriptEngine.java:215)
at com.arcadedb.gremlin.ArcadeGraph.init(ArcadeGraph.java:468)
at com.arcadedb.gremlin.ArcadeGraph.<init>(ArcadeGraph.java:120)
at com.arcadedb.gremlin.ArcadeGraph.open(ArcadeGraph.java:143)
at com.arcadedb.cypher.query.CypherQueryEngineFactory.getInstance(CypherQueryEngineFactory.java:44)
at com.arcadedb.query.QueryEngineManager.getInstance(QueryEngineManager.java:66)
at com.arcadedb.database.EmbeddedDatabase.getQueryEngine(EmbeddedDatabase.java:1298)
at com.arcadedb.database.EmbeddedDatabase.command(EmbeddedDatabase.java:1334)
at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:467)
at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:129)
at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:96)
at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:99)
at com.arcadedb.server.http.handler.AbstractServerHttpHandler.handleRequest(AbstractServerHttpHandler.java:126)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
at java.base/java.lang.Thread.run(Thread.java:1583)
<ArcadeDB_0> Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandParsingException: Error on initializing Cypher query engine
at com.arcadedb.cypher.query.CypherQueryEngineFactory.getInstance(CypherQueryEngineFactory.java:50)
at com.arcadedb.query.QueryEngineManager.getInstance(QueryEngineManager.java:66)
at com.arcadedb.database.EmbeddedDatabase.getQueryEngine(EmbeddedDatabase.java:1298)
at com.arcadedb.database.EmbeddedDatabase.command(EmbeddedDatabase.java:1334)
at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:467)
at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:129)
at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:96)
at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:99)
at com.arcadedb.server.http.handler.AbstractServerHttpHandler.handleRequest(AbstractServerHttpHandler.java:126)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.ClassLoader.loadClass(String)" because "ctxtLoader" is null
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getParentLoader(GroovyScriptEngineImpl.java:452)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.access$000(GroovyScriptEngineImpl.java:89)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl$1.run(GroovyScriptEngineImpl.java:119)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl$1.run(GroovyScriptEngineImpl.java:116)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.createClassLoader(GroovyScriptEngineImpl.java:116)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.<init>(GroovyScriptEngineImpl.java:111)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.<init>(GremlinGroovyScriptEngine.java:215)
at com.arcadedb.gremlin.ArcadeGraph.init(ArcadeGraph.java:468)
at com.arcadedb.gremlin.ArcadeGraph.<init>(ArcadeGraph.java:120)
at com.arcadedb.gremlin.ArcadeGraph.open(ArcadeGraph.java:143)
at com.arcadedb.cypher.query.CypherQueryEngineFactory.getInstance(CypherQueryEngineFactory.java:44)
... 15 more
|
Beta Was this translation helpful? Give feedback.
-
Posted my rework of the rest api for python : https://github.com/ExtReMLapin/pyarcade |
Beta Was this translation helpful? Give feedback.
-
COMMUNITY HELP
Hi guys, we're working on the new Vector Model in ArcadeDB, and one fundamental piece of the puzzle is having a Python driver. This is because most of the AI/ML projects/frameworks out there are in Python. You can use ArcadeDB with HTTP/JSON from Python right now, but a simple driver that wraps the HTTP/JSON calls would be fantastic to have. Is anybody fluent in Python that can help? Please write here or DM me. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions