tp3 on ms windows

241 views
Skip to first unread message

Thomas Murphy

unread,
Oct 14, 2014, 10:28:17 AM10/14/14
to gremli...@googlegroups.com
After extracting the M3 zip file; I found some .sh files but no .bat files in the /bin directory.  Is MS supported?  I looked for documentation.... but I have
zero asciidoc experience! Must  I scale that mountain too?  Is there a startup tutorial around.  With 2.5 I was able to read/write genealogy flatfiles for
relationship analysis... hoping to convert the effort to TP3..

Stephen Mallette

unread,
Oct 14, 2014, 11:08:21 AM10/14/14
to gremli...@googlegroups.com
After extracting the M3 zip file; I found some .sh files but no .bat files in the /bin directory.  Is MS supported?  

I'm not sure where you got your zip file, but I just freshly downloaded the M3 releases from the links provided on tinkerpop.com and both contain .bat files in the bin directory.  We haven't done a lot of testing on Windows, so it would be great to get some feedback there.
 
I looked for documentation.... but I have zero asciidoc experience! Must  I scale that mountain too?  Is there a startup tutorial around.  

I'm not sure why you need "asciidoc experience" so I don't think you have any mountains to scale.  We generate the asciidoc to HTML and publish it on the tinkerpop.com site - here is the link to M3:




--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/2dd585d3-32c4-4cd5-b4d0-31055a2c0d8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Murphy

unread,
Oct 14, 2014, 11:50:10 AM10/14/14
to gremli...@googlegroups.com
I extracted file:///C:/Users/Thomas/Downloads/tinkerpop3-3.0.0.M3%20(1).zip  to /tp3.     /tp3/bin only had .sh files.     I forgot I tried:
 /tp3/gremlin-console/bin/gremlin.bat      Without a target specified, this bat went into a stack disipating loop on win8...    I guess I need to specify either
a .ini or .grv file?  I can try that....    Sorry for the snarky mountain climb comment;  all the /tp3/docs files are asciidoc files.     I was able to easily read the online
pages you pointed to.  How are the  tp3/docs/xxx.asciidocs   files meant to be used?   Thanks for the help; I've liked pipes since I first found them years ago in an early MSDOS.

Stephen Mallette

unread,
Oct 14, 2014, 12:35:12 PM10/14/14
to gremli...@googlegroups.com
I extracted file:///C:/Users/Thomas/Downloads/tinkerpop3-3.0.0.M3%20(1).zip  to /tp3.     /tp3/bin only had .sh files.     I forgot I tried:
 /tp3/gremlin-console/bin/gremlin.bat      Without a target specified, this bat went into a stack disipating loop on win8...    I guess I need to specify either
a .ini or .grv file?  I can try that....    

I can't say I completely follow what you're saying here.  I would run gremlin.bat from within the bin directory - that should work.  i have this weird sense you downloaded your TP3 distribution from here:


if you did, that's not the official distribution (and not useful unless you are building from source i guess).  you should visit http://tinkerpop.com and download from there.
 
all the /tp3/docs files are asciidoc files.     I was able to easily read the online
pages you pointed to.  How are the  tp3/docs/xxx.asciidocs   files meant to be used?   

the asciidocs are the "source files" for our documentation that you see generated to the link i sent you.  it is somewhat similar to markdown, but is much more robust.  you can read more about it here:

 
Thanks for the help; I've liked pipes since I first found them years ago in an early MSDOS.

What would you say is your favorite thing about pipes?

 

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Thomas Murphy

unread,
Oct 14, 2014, 3:00:41 PM10/14/14
to gremli...@googlegroups.com
Ok, I'm getting much closer; I got the _3_ logo... but I still didn't get to a clean console.  Does TP3 perhaps require Java8?  Here's my console

C:\Users\Thomas>totp3

C:\Users\Thomas>cd /program files/tp3/bin

C:\Program Files\tp3\bin>set EDITOR="C:\\PROGRA~2\\notepad++\\notepad++.exe"

C:\Program Files\tp3\bin>set JAVA_HOME=C:\Program Files\Java\jre7\bin

C:\Program Files\tp3\bin>set GROOVY_HOME=\groovy

C:\Program Files\tp3\bin>gremlin

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
Exception in thread "main" java.lang.NoClassDefFoundError: java/util/concurrent/CompletableFuture
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getDeclaredMethods(Unknown Source)
        at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:84)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81)
        at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250)
        at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:390)
        at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:340)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3225)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:210)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:241)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255)
        at org.codehaus.groovy.vmplugin.v7.Selector$InitSelector.getMetaClass(Selector.java:365)
        at org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.setCallSiteTarget(Selector.java:947)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:211)
        at com.tinkerpop.gremlin.console.Console.<init>(Console.groovy:48)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at com.tinkerpop.gremlin.console.Console.main(Console.groovy:230)
Caused by: java.lang.ClassNotFoundException: java.util.concurrent.CompletableFuture
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 22 more

C:\Program Files\tp3\bin>



Thanks again for your help.

Marko Rodriguez

unread,
Oct 14, 2014, 3:57:34 PM10/14/14
to gremli...@googlegroups.com
Hello,

Yes, it requires Java8.

Marko.
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Thomas Murphy

unread,
Oct 14, 2014, 6:29:38 PM10/14/14
to gremli...@googlegroups.com

Success!!   Thanks for your help....  with 2 minor glitchs: a) After I installed Java8, the gremlin bat couldn't find /tp3/bin/ext  directory.So I copied /tp3/ext/*.txt files into /tp3/bin/ext
b) Happier gremlin.bat... but I got an access denied from Win8;   When I reran dos CMD in administrative mode; I happily got following:
==================================================================================
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd /users/thomas

C:\Users\Thomas>totp3

C:\Users\Thomas>cd /program files/tp3/bin

C:\Program Files\tp3\bin>set EDITOR="C:\\PROGRA~2\\notepad++\\notepad++.exe"

C:\Program Files\tp3\bin>set JAVA_HOME=C:\Program Files\Java\jre1.8.0_25\bin

C:\Program Files\tp3\bin>set GROOVY_HOME=\groovy

C:\Program Files\tp3\bin>gremlin

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: server
plugin activated: utilities
plugin activated: tinkergraph
gremlin> 9+60
==>69
gremlin>

Thomas Murphy

unread,
Dec 20, 2014, 11:28:25 PM12/20/14
to gremli...@googlegroups.com
I suspended use of tp3m3 because of console problems on windows (command history didn't work;  and also it looked like 
gremlin> help     was responding with ascii wrapped with ]m3... gibberish).
....I made application progress with TP3; but now I'm running into traversal issues that TP3 might make easy; so
I'm trying to install M6.    Seems to be some problem  with RemoteAcceptor plugin.   Any ideas?? 



C:\Users\Thomas>cd /users/thomas/documents/tp3m6/gremlin-console-3.0.0.M6/bin
C:\Users\Thomas\Documents\tp3m6\gremlin-console-3.0.0.M6\bin>set EDITOR="C:\\PROGRA~2\\notepad++\\notepad++.exe"
C:\Users\Thomas\Documents\tp3m6\gremlin-console-3.0.0.M6\bin>set JAVA_HOME=C:\Program Files\Java\jre1.8.0_25\bin
C:\Users\Thomas\Documents\tp3m6\gremlin-console-3.0.0.M6\bin>set GROOVY_HOME=\groovy
C:\Users\Thomas\Documents\tp3m6\gremlin-console-3.0.0.M6\bin>gremlin

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
Exception in thread "main" java.lang.NoClassDefFoundError: com/tinkerpop/gremlin/groovy/plugin/RemoteAcceptor
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getDeclaredMethods(Unknown Source)
        at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:84)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81)
        at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250)
        at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:390)
        at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:340)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3225)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:210)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:241)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255)
        at org.codehaus.groovy.vmplugin.v7.Selector$InitSelector.getMetaClass(Selector.java:365)
        at org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.setCallSiteTarget(Selector.java:947)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:211)
        at com.tinkerpop.gremlin.console.Console.<init>(Console.groovy:48)
        at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at com.tinkerpop.gremlin.console.Console.main(Console.groovy:252)
Caused by: java.lang.ClassNotFoundException: com.tinkerpop.gremlin.groovy.plugin.RemoteAcceptor
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 23 more
        
        
                                  some relavent info from DOS  SET command:
GROOVY_HOME=\groovy
HOMEDRIVE=C:
HOMEPATH=\Users\Thomas
JAVA_HOME=C:\Program Files\Java\jre1.8.0_25\bin
JAVA_OPTIONS=-Xms32m -Xmx512m
LIBDIR=..\lib        

Thomas Murphy

unread,
Dec 21, 2014, 8:05:26 AM12/21/14
to gremli...@googlegroups.com
my help request of late last night should have said " made progress with TP2, but now....".


On Tuesday, October 14, 2014 10:28:17 AM UTC-4, Thomas Murphy wrote:

Dave

unread,
Dec 21, 2014, 12:16:29 PM12/21/14
to gremli...@googlegroups.com
Hi Thomas,

I'm also on Windows and working off of the SNAPSHOT version (downloaded and built from source). I just ran gremlin.bat and have the same problem. I also recall having the same problem with the official M5 distribution from the website when it was available. I did fix it back then and it was something simple (I wish I noted it!!)  I want to say it was something like CLASSPATH but I don't think this is it because I recall gremlin.bat setting up the classpath for itself (I might be wrong). Sorry that this is not that helpful but I wanted to say that you are not alone, keep persevering and know that I am doing the same to solve the problem.

Regards,
Dave 

Stephen Mallette

unread,
Dec 21, 2014, 12:21:36 PM12/21/14
to gremli...@googlegroups.com
It would be great to get some community help on this windows issue - we don't have much windows batch scripting experience in TinkerPop - pull requests would be very helpful in this area.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Dave

unread,
Dec 21, 2014, 12:47:33 PM12/21/14
to gremli...@googlegroups.com
OK. I noticed that the bat file creates a copy of the existing classpath and generates a new one by defining its own classpath items in CP (run "set" from command line to see) i.e. set CLASSPATH = %CP%; %OLD_CLASSPATH%. I also noticed that CP is generated from the files in the ..\lib directory. The lib directory was missing gremlin-groovy-3.0.0.SNAPSHOT. I copied this missing jar file from the gremlin-groovy build directory to \lib and was then able to successfully run gremlin.bat. 

Regards,
Dave

Dave

unread,
Dec 21, 2014, 2:01:52 PM12/21/14
to gremli...@googlegroups.com
I noticed that the Tinkerpop.tinkergraph plugin was not installed by default. I tried the following but received an error:-

gremlin> :install com.tinkerpop tinkergraph-gremlin 3.0.0.SNAPSHOT
Error grabbing Grapes -- [unresolved dependency: com.tinkerpop#tinkergraph-gremlin;3.0.0.SNAPSHOT: not found]

I got around it by copying the tinkergraph-gremlin jar file into the Gremlin lib directory so the plugin was installed at startup. But I am curious as to what I did wrong with the command-line install.

Thanks,
Dave

Dave

unread,
Dec 21, 2014, 3:42:01 PM12/21/14
to gremli...@googlegroups.com
Was a typo:- should have been "3.0.0-SNAPSHOT". However, I then got the following error:-

gremlin> :install com.tinkerpop tinkergraph-gremlin 3.0.0-SNAPSHOT
Detected a non-standard Gremlin directory structure during install.  Expecting a 'lib' directory sibling to 'ext'. This message does not necessarily imply failure, however the console requires a certain directory structure for proper execution. Altering that structure can lead to unexpected behavior.
Illegal char <:> at index 2: /C:/Users/davidc/.groovy/grapes/com.tinkerpop/tinkergraph-gremlin/jars/tinkergraph-gremlin-3.0.0-SNAPSHOT.jar

The "ext" and "lib" directories exist in the ../gremlin-console/target/gremlin-console-3.0.0-SNAPSHOT-standalone directory and there are gremlin-groovy and tinkergraph-gremlin sub-directories with the appropriate jar file in each. 

I assume the note above is just a warning but wanted to report it in case it was something specific to running on Windows. 

Dave 

Thomas Murphy

unread,
Dec 21, 2014, 5:48:57 PM12/21/14
to gremli...@googlegroups.com
Thanks Dave;
My gremlin...\\lib  and ...\ext are at the directory level     
DOS Set shows:
CP=..\lib\..\lib\commons-beanutils-1.8.0.jar;..\lib\..\lib\commons-codec-1.6.jar;............................................
r;..\lib\..\lib\xml-apis-1.3.04.jar;..\lib\..\lib\xml-resolver-1.2.jar

I'm hardly literate with Java these days.   Are all the classes Gremlin looks for in the   ..\lib jars?  I looked in the list of 44/43 files in the m3/m6  lib directories; but
found nothing that had the word remote or acceptor in the file name...   I did notice a November issue 349 by Steve that talks about an acceptor message.
I suspect  some .jar is missing from the Windows zip file ...

(perhaps 50 years of computers is getting to ME:  I couldn't even figure out ow to post this comment  WITHOUT the embareassing  Oct14 comment below...oh
well Christmas and the New Year is almost here...  I'll just continue with TP2 a while longer!           ;)






On Tuesday, October 14, 2014 10:28:17 AM UTC-4, Thomas Murphy wrote:

Dave

unread,
Dec 22, 2014, 1:00:31 AM12/22/14
to gremli...@googlegroups.com
HI Thomas,

The class not found error almost always points to a missing file or incorrect Classpath (but Gremlin.bat configures its own). I found the RemoteAcceptor class in the gremlin-groovy-3.0.0.M6.jar file (...3.0.0-SNAPSHOT.jar for me) but could not find this file in the lib directory, which is where I believe it should have been. 

Now, I had downloaded all of the source and built the whole project, hence the reason why I could get my hands on the missing jar file. I believe (but am not certain) that if you look in the ext directory you might see a "gremlin-groovy" directory, which also contains the missing gremlin-groovy-3.0.0-M6.jar file. Copy it to the lib directory and gremlin.bat should work. You may have to do the same thing with the tinkergraph-gremlin jar file if you want to use TinkerGraph.

Regards,
Dave

Stephen Mallette

unread,
Dec 22, 2014, 8:07:21 AM12/22/14
to gremli...@googlegroups.com
I'm also on Windows and working off of the SNAPSHOT version (downloaded and built from source)

If you are building from source and then trying to run the .bat files from the source directories you will likely run into problems.  Even the .sh files dont' work so well in that way and there doesn't seem to be a way to make them work nicely there.  You have to either:

1. unpack the zip distribution and use that after build
2. cd into the gremlin-console/target/*stand* directory and run the .sh/.bat from there

I think I was hoping that we could get those scripts to work from the source directories as they once did in TP2, but i don't think that's going to be possible.  We likely just need to delete those to avoid confusion at this point.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Thomas Murphy

unread,
Dec 22, 2014, 9:22:36 AM12/22/14
to gremli...@googlegroups.com

Dave, thanks again.. my (windows)    ...\ext only contains 2 smll .txt files   so that's not a workaround.
Steve, I am NOT trying to build from source; I'm trying to install the M6 windows (zip) file.  What is name of the .jar file that deals  with remote acceptor?  
..and which levels work with M6?    Of course, it may be that getting past that, may expose more issues... 

I did unzip, keeping the file structure unchanged (but a few levels deeper). I executed the gremlin.bat from the bin location... I don't think the .sh
file would work on windows 8; right?












On Tuesday, October 14, 2014 10:28:17 AM UTC-4, Thomas Murphy wrote:

Dave

unread,
Dec 22, 2014, 2:49:02 PM12/22/14
to gremli...@googlegroups.com
Thomas,

I have attached the jar file you need. Copy this to the lib directory and it should work.

Regards,
Dave
gremlin-groovy-3.0.0.M6.jar

Thomas Murphy

unread,
Dec 22, 2014, 5:39:38 PM12/22/14
to gremli...@googlegroups.com

Dave, Thanks, that work!!  The the official zip file must be missing that jar....   The DOS history mechanism (. ie. the up arrow key to retrieve a previous
command) still does not work.     And the gibberish (see below) is still present.   I have to go out now, but I'm guessing that Gremlin is basically working.
I should probably persue this history problem as a separate Topic.   Thanks again.

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
gremlin> Gremlin.version
log4j:WARN No appenders could be found for logger (com.jcabi.manifests.Manifests).
log4j:WARN Please initialize the log4j system properly.
==>3.0.0.M6
gremlin> ?

For information about ←[32mGroovy←[m, visit:
    ←[36mhttp://groovy.codehaus.org←[m

Available commands:
  ←[1m:help     ←[m  (←[1m:h  ←[m) Display this help message
  ←[1m?         ←[m  (←[1m:?  ←[m) Alias to: ←[1m:help←[m
  ←[1m:exit     ←[m  (←[1m:x  ←[m) Exit the shell
  ←[1m:quit     ←[m  (←[1m:q  ←[m) Alias to: ←[1m:exit←[m

























On Tuesday, October 14, 2014 10:28:17 AM UTC-4, Thomas Murphy wrote:

Stephen Mallette

unread,
Jan 1, 2015, 1:26:56 PM1/1/15
to gremli...@googlegroups.com
the problem with the .bat files was not related to a missing jar (though moving that gremlin-groovy.jar to the lib directory does solve the problem).  That "missing" jar is actually present in the distribution but is not in the lib directory - it is in the ext directory because it contains plugin infrastructure.  i've modified the .bat files (gremlin.bat and gremlin-server.bat) to actually add the jars in the ext directories to the path so they should now work out of the box without having to copy any files around (this change will be part of the next release of TP3).

The weird "gibberish" you're getting with the help command i can't explain, but I am getting that too.  My guess is that this is an issue with the Groovy Shell and not something we are doing or have control of, but I'd have to investigate that more.  

Navigation of history in windows cannot be performed with up/down arrow given issues with jline/groovysh - try ctrl-p and ctrl-n - note the open issue here:




--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Thomas Murphy

unread,
May 2, 2016, 10:48:00 PM5/2/16
to Gremlin-users

Now  that the "gibberish" issue has hidden itself, and keyboard keys work  properly,  I've returned to the TP2->TP3 migration..


HELP!
I'm having trouble migrating my application from TP2 grammer to TP3.
I was able to create the Vertex s. But I'm having trouble making a 
2nd  pass over the Vertex set... to pick out connection info at the 
end of each Vertex.

See the last 5 lines below.  How do I  access the 111 Vertex?
Perhaps part of my problem is the extra square brackets; perhaps
indicating an extra level of imbedding...??



....then I'll be able to get this code working to add the edges..  :
def insed(aa,g){
aa.each{
v1=g.getVertex(it[0]);
v2=g.getVertex(it[7]);
v3=g.getVertex(it[8]);
v4=g.getVertex(it[9]);
if (v1 != null && v2 != null)
 g.addEdge(g.getVertex(it[7]),g.getVertex(it[0]),'father') ;
if (v1 != null && v3 != null)
 g.addEdge(g.getVertex(it[8]),g.getVertex(it[0]),'mother') ;
if ((v1 != null && v4 != null) && (v1.sx=='M'))
  g.addEdge(g.getVertex(it[9]),g.getVertex(it[0]),'wife') ;
if ((v1 != null && v4 != null) && (v1.sx=='F'))
  g.addEdge(g.getVertex(it[9]),g.getVertex(it[0]),'husband'); 
 } }
 
insed(aa,g)






         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> mydir = "C:\\Users\\Thomas\\Documents\\gene\\reports\\"
==>C:\Users\Thomas\Documents\gene\reports\
gremlin> myname = "Just3.csv"
==>Just3.csv
gremlin> myfile = new File(mydir + myname)
==>C:\Users\Thomas\Documents\gene\reports\Just3.csv
gremlin> aa=[]
gremlin> myfile.eachLine{l->fp=l.replaceAll('"','');
gremlin>  p=fp.split(",");
gremlin>  fxid=Integer.parseInt(p[0]);
gremlin>  p[0]=fxid;
gremlin>  aa=aa+p;}
==>[1, Murphy,  Thomas Robert, M,     18 Oct 1942,     24 Apr 1965, , 222, 332, 111]
==>[57, Murphy,  Timothy Robert, M,     17 Jan 1966,     21 Sep 2002, , 1, 111, 464]
==>[222, Murphy,  Raymond Joseph, M,     14 Jan 1902,     14 Jan 1925,     20 Dec 1987, 409, 420, 332]
==>[111, Szumiloski,  Elizabeth Ann, F,     15 Oct 1943,     24 Apr 1965, , 134, 145, 1]
gremlin> aa.each{if(it[3].size()==0){it[3]='    '}}
==>[1, Murphy,  Thomas Robert, M,     18 Oct 1942,     24 Apr 1965, , 222, 332, 111]
==>[57, Murphy,  Timothy Robert, M,     17 Jan 1966,     21 Sep 2002, , 1, 111, 464]
==>[222, Murphy,  Raymond Joseph, M,     14 Jan 1902,     14 Jan 1925,     20 Dec 1987, 409, 420, 332]
==>[111, Szumiloski,  Elizabeth Ann, F,     15 Oct 1943,     24 Apr 1965, , 134, 145, 1]
gremlin> // aa.each{if(it[2].size()>1){bn=it[2];it[2]=bn[1..-1];println it[2]}}.iterate()
==>true
gremlin> for (it in aa[0..aa.size-1]) {if(it[2].size()>1){bn=it[2];it[2]=bn[1..-1]}}
==>null
gremlin>
gremlin> gr = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> g=gr.traversal()
==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
gremlin> aa.each{gr.addVertex it[0],[lname:it[1],fname:it[2],sx:it[3],dob:it[4],dom:it[5],dod:it[6]]}
==>[1, Murphy, Thomas Robert, M,     18 Oct 1942,     24 Apr 1965, , 222, 332, 111]
==>[57, Murphy, Timothy Robert, M,     17 Jan 1966,     21 Sep 2002, , 1, 111, 464]
==>[222, Murphy, Raymond Joseph, M,     14 Jan 1902,     14 Jan 1925,     20 Dec 1987, 409, 420, 332]
==>[111, Szumiloski, Elizabeth Ann, F,     15 Oct 1943,     24 Apr 1965, , 134, 145, 1]
gremlin>


gremlin> g.V().values()
==>[lname:Murphy, fname:Thomas Robert, sx:M, dob:    18 Oct 1942, dom:    24 Apr 1965, dod:]
==>[lname:Murphy, fname:Timothy Robert, sx:M, dob:    17 Jan 1966, dom:    21 Sep 2002, dod:]
==>[lname:Murphy, fname:Raymond Joseph, sx:M, dob:    14 Jan 1902, dom:    14 Jan 1925, dod:    20 Dec 1987]
==>[lname:Szumiloski, fname:Elizabeth Ann, sx:F, dob:    15 Oct 1943, dom:    24 Apr 1965, dod:]
gremlin> g.V(111)   //  <== this line returns nothing at the Console?????

Daniel Kuppitz

unread,
May 3, 2016, 1:59:54 AM5/3/16
to gremli...@googlegroups.com
gremlin> aa.each{gr.addVertex it[0],[lname:it[1],fname:it[2],sx:it[3],dob:it[4],dom:it[5],dod:it[6]]}

I don't think this code does what you expect it to do.

Try this instead:

aa.each {gr.addVertex(id, it[0], "lname", it[1], "fname", it[2], "sx", it[3], "dob", it[4], "dom", it[5], "dod", it[6])}

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Thomas Murphy

unread,
May 3, 2016, 10:24:27 AM5/3/16
to Gremlin-users
Thanks. Structure looks much more sane! Can't believe I ever got it to work in TP2..  I dimly recall lots of ArrayList struggle...
However,  I still can't traverse to a 'given' vertex.  (Seems to be same problem as (search 'lebel' in forum); but the answers didn't help me...

gremlin> g.V().values()
==>Thomas Robert
==>Murphy
==>    24 Apr 1965
==>M
==>    18 Oct 1942
==>
==>Elizabeth Ann
==>Szumiloski
==>    24 Apr 1965
==>F
==>    15 Oct 1943
==>
==>Timothy Robert
==>Murphy
==>    21 Sep 2002
==>M
==>    17 Jan 1966
==>
==>Raymond Joseph
==>Murphy
==>    14 Jan 1925
==>M
==>    14 Jan 1902
==>    20 Dec 1987
gremlin> g.V(111)                        //  <============== no response to Console...???
gremlin> g.V()
==>v[1]
==>v[111]
==>v[57]
==>v[222]

Daniel Kuppitz

unread,
May 3, 2016, 10:38:44 AM5/3/16
to gremli...@googlegroups.com
Apparently your ids have a different type. Try this:

g.V("111")
g.V(111L)

Or just check what the actual type is:

g.V().id().next().getClass()

Cheers,
Daniel



--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Thomas Murphy

unread,
May 6, 2016, 9:25:14 AM5/6/16
to Gremlin-users

You nailed it: The id is a string!   which is odd because I had conversion code in the file-to-graphCreation sequence....

Thanks again; I'm moving forward to TP3 again. 

Reply all
Reply to author
Forward
0 new messages