Open generall opened 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
+1
+1 Is there any workaround for this?
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:
[gremlin-console-path]/ext/blazegraph-gremlin/plugin
(in file browser or another shell)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}
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
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.
Ok, good to know! 👍
@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)
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.
I did the following steps and was able to have the blazegraph plugin show up in my :plugin list:
Thanks for your help! Seems to be working great now.
@greenguy33 I followed your steps, but it doesn't work. My gremlin-console is version 3.3.1
@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.
@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.
@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.
@greenguy33 Thank you for the helpful information.
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.
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..
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
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.