opencypher / cypher-for-gremlin

Cypher for Gremlin adds Cypher support to any Gremlin graph database.
Apache License 2.0
359 stars 48 forks source link

Cannot translate cypher query to gremlin query #358

Open canbax opened 4 years ago

canbax commented 4 years ago

I downloaded the JAR files "cypher-gremlin-console-plugin-1.0.4-all.jar" and "cypher-gremlin-server-plugin-1.0.4-all.jar". I added these JAR files as dependencies to my project. (I'm using IntelliJ Idea)

Below is my very simple Java class to simply convert cypher query string to gremlin query string.

package org.ivis;

import org.opencypher.gremlin.translation.TranslationFacade;

public class App
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );

        String cypher = "MATCH (p:Person) WHERE p.age > 25 RETURN p.name";
        TranslationFacade cfog = new TranslationFacade();
        String gremlin = cfog.toGremlinGroovy(cypher);

        System.out.println( "gremlin: " + gremlin );
    }
}

IDE does NOT complain about any thing but in run time I get below error.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal at org.opencypher.gremlin.translation.translator.Translator.builder(Translator.java:148) at org.opencypher.gremlin.translation.TranslationFacade.toGremlinGroovy(TranslationFacade.java:55) at org.opencypher.gremlin.translation.TranslationFacade.toGremlinGroovy(TranslationFacade.java:43) at org.ivis.App.main(App.java:18) Caused by: java.lang.ClassNotFoundException: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 4 more

image