blazegraph / tinkerpop3

Blazegraph Tinkerpop3 Implementation
GNU General Public License v2.0
61 stars 10 forks source link

Plugin installation in gremlin console not works #4

Open generall opened 8 years ago

generall commented 8 years ago
gremlin> :install com.blazegraph blazegraph-gremlin 1.0.0
==>Conflicting module versions. Module [groovy-xml is loaded in version 2.4.6 and you are trying to load version 2.4.1
bdecarne commented 8 years ago

+1

gremlin> :install com.blazegraph blazegraph-gremlin 1.0.0
==>Conflicting module versions. Module [groovy-xml is loaded in version 2.4.7 and you are trying to load version 2.4.1
rulai-huajunzeng commented 7 years ago

+1

chetanism commented 7 years ago

+1 Is there any workaround for this?

chetanism commented 7 years ago

Ok, found this warning on gremlin-documentation

Plugins must be compatible with the version of the Gremlin Console (or Gremlin Server) being used. Attempts to use incompatible versions cannot be guaranteed to work. Moreover, be prepared for dependency conflicts in third-party plugins, that may only be resolved via manual jar removal from the ext/{plugin} directory.

After you have installed the plugin and see the error, exit gremlin-console. To fix the problem:

  1. browse to [gremlin-console-path]/ext/blazegraph-gremlin/plugin (in file browser or another shell)
  2. Try running gremlin-console, for each jar it throws an error, remove it from the plugin directory from step 1.
  3. Keep repeating step 2, till it finally runs!
kuzeko commented 7 years ago

The fix is the following:

     rm -vf ${GREMLIN3_HOME}/lib/groovy-swing-2.4.*.jar
     rm -vf ${GREMLIN3_HOME}/lib/groovy-jsr223-2.4.*-indy.jar
     rm -vf ${GREMLIN3_HOME}/lib/groovy-xml-2.4.*.jar

Also, you should have .groovy/grapeConfig.xml in your home with something like:

<ivysettings>
  <settings defaultResolver="downloadGrapes"/>
  <resolvers>
    <chain name="downloadGrapes">
      <filesystem name="cachedGrapes">
        <ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
        <artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
      </filesystem>
      <ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/>
      <ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
      <ibiblio name="central" root="http://central.maven.org/maven2/" m2compatible="true"/>
      <ibiblio name="jitpack" root="https://jitpack.io" m2compatible="true"/>
      <ibiblio name="java.net2" root="http://download.java.net/maven/2/" m2compatible="true"/>
     </chain>
  </resolvers>
</ivysettings>

And you should use the last (3.2.4) version of gremlin

curl -L -o /tmp/gremlin.zip \
    http://mirror.nohup.it/apache/tinkerpop/3.2.4/apache-tinkerpop-gremlin-console-3.2.4-bin.zip && \
    unzip /tmp/gremlin.zip -d /opt/ && \
    rm /tmp/gremlin.zip && \
    ln -s /opt/apache-tinkerpop-gremlin-console-3.2.4 ${GREMLIN3_HOME}
kuzeko commented 7 years ago

Hi greenguy33, I'm sorry to hear that! First note that what we are discussing here is a workaround, until the libs are updated in the repo.

Anyway, I have a docker image, that I just rebuilt, which executes the steps (below more details) and I can confirm that it works. Maybe you had other dependencies involved?

My dockerfile does the following:

 RUN   ${GREMLIN3_HOME}/bin/gremlin.sh -e /tmp/install-blazegraph.groovy &&
            rm -vf ${GREMLIN3_HOME}/lib/groovy-swing-2.4.*.jar &&
            rm -vf ${GREMLIN3_HOME}/lib/groovy-jsr223-2.4.*-indy.jar &&   
            rm -vf ${GREMLIN3_HOME}/lib/groovy-xml-2.4.*.jar &&     
            ${GREMLIN3_HOME}/bin/gremlin.sh -e /tmp/activate-blazegraph.groovy

The content of /tmp/install-blazegraph.groovy is only:

  :install com.blazegraph blazegraph-gremlin 1.0.0

and the content of /tmp/activate-blazegraph.groovy is just

 :plugin use tinkerpop.blazegraph
 :plugin use tinkerpop.sugar

I hope this helps

greenguy33 commented 7 years ago

Hi kuzeko, you will notice that I deleted my comment. This is because I tried your method a second time and on the second attempt it worked. I am not sure why the first time my console was broken and the second time it worked.

kuzeko commented 7 years ago

Ok, good to know! 👍

greenguy33 commented 7 years ago

@kuzeko Actually it didn't quite work...after I removed those three files and ran :install com.blazegraph blazegraph-gremlin 1.0.0 in Gremlin Console I got this error:

==>No signature of method: org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber.copyDependenciesToPath() is applicable for argument types: (org.apache.tinkerpop.gremlin.groovy.util.Artifact) values: [org.apache.tinkerpop.gremlin.groovy.util.Artifact@ee7a6491] Possible solutions: copyDependenciesToPath(org.apache.tinkerpop.gremlin.groovy.plugin.Artifact)

kuzeko commented 7 years ago

As I said, I just re-run my makefiles, and everything checks out. So I would ask you to check the following: Do you have the .groovy/grapeConfig.xml in your home with the above content? Did you download a fresh version of apache-tinkerpop-gremlin-console-3.2.4-bin.zip ? Also run install just before removing, and use the /bin/gremlin.sh -e command not the interactive console for installing.

greenguy33 commented 7 years ago

I did the following steps and was able to have the blazegraph plugin show up in my :plugin list:

  1. Added the line "ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/" to my graphConfig.xml
  2. Downloaded a fresh version of Gremlin Console
  3. Removed the 3 files that you mentioned to remove
  4. Created tmp/install-blazegraph.groovy containing just the text :install com.blazegraph blazegraph-gremlin 1.0.0
  5. Ran (from windows): gremlin.bat -e tmp/install-blazegraph.groovy
  6. Opened gremlin console and ran from inside the console :plugin use tinkerpop.blazegraph
  7. Restarted the console.

Thanks for your help! Seems to be working great now.

jianfa commented 6 years ago

@greenguy33 I followed your steps, but it doesn't work. My gremlin-console is version 3.3.1

greenguy33 commented 6 years ago

@jianfa Sorry to hear that. My team gave up on trying to use Gremlin with Blazegraph long ago. Ran into all sorts of problems like this throughout and eventually decided it wasn't worth it.

jianfa commented 6 years ago

@greenguy33 Thank you for your response. Are you still using TinkerPop? My team is trying to compare the performance of BlazeGraph to JanusGraph. Maybe you have the experience in both BlazeGraph and JanusGraph. Do you have any suggestion for a newbie? Thanks.

greenguy33 commented 6 years ago

@jianfa I actually have not heard of JanusGraph. My team was interested in putting together an application for storing/manipulating RDF data, and we initially explored Blazegraph. However we have moved on to using Ontotext Graph DB, which has met our needs better. It does not support TinkerPop, so we are using dynamically generated SPARQL instead. Sorry I can't be of more help.

jianfa commented 6 years ago

@greenguy33 Thank you for the helpful information.

kuzeko commented 6 years ago

Hi @jianfa , it depends if you need to deal with SPARQL or not. I've run extensive experiments for the NON-SPARQL part, but if you need to go through SPARQL then you should not use tinkerpop/gremlin at all.

prashanthmadi commented 6 years ago

Can we install plugin without firing gremlin console ?

In other words.. i would like to automate plugin installation instead of manually typing :install and things like that..

kuzeko commented 6 years ago

You can run the gremlin console like a command, I have it working in a docker file without being interactive.

You pass it a command, or a file to run

prashanthmadi commented 6 years ago

Thanks @kuzeko . I was able to do this using -e option but it doesn't print output on console :(

echo ":install org.apache.tinkerpop spark-gremlin 3.4.0-SNAPSHOT" > init.groovy echo ":plugin use tinkerpop.spark" >> init.groovy bin/gremlin.sh -e init.groovy


It works for now but i have no way to debug if things go wrong.