Gremlin & Inheritance like trees

58 views
Skip to first unread message

jerome moliere

unread,
Feb 13, 2013, 12:33:50 PM2/13/13
to gremli...@googlegroups.com
Hi all,
part from my graph contains some structures using an inheritance form.
I deal with categories , any category can be the mother of many others ...
Is there some special pattern & syntax tips to help me finding all category instances or all nodes(vertices) being children from a given category.

On my vertices I have some properties:
- name
- type (= 'Category for all category instances)

And a mother category is linked to a sub-category with an edge 'is child from'

Thanks for your help
Kind regards
jerome

PS:
I 'll just complain that many docs contain a tree path syntax and I cannot use this syntax from my gremlin console.
It 's a little bit confusing .Is it a bug or problem in my install but something like ./V/inE[@label='foo'] does not work
It's a sample and all examples extracted from slides refuse to work...

PS 2:
I was quite relax with the Cypher syntax but I am not so relax with the Gremlin's one...

Marko Rodriguez

unread,
Feb 13, 2013, 12:36:48 PM2/13/13
to gremli...@googlegroups.com
Hi,

> I 'll just complain that many docs contain a tree path syntax and I cannot use this syntax from my gremlin console.
> It 's a little bit confusing .Is it a bug or problem in my install but something like ./V/inE[@label='foo'] does not work
> It's a sample and all examples extracted from slides refuse to work…

That is Gremlin probably version 0.1-0.2 (over 3 years old). You will want to read the Gremlin docs.

http://gremlin.tinkerpop.com

Slides get dated …. Wiki documentation is always current.

Good luck,
Marko.

http://markorodriguez.com

jerome moliere

unread,
Feb 13, 2013, 12:48:43 PM2/13/13
to gremli...@googlegroups.com
Ok marko thanks for your answer..
So no point trying to make this syntax works...Ok...
And about inheritance trees how do you handle that in Gremlin?
Most of the samples assume that we know where to start (vertex's index) but when you have no idea at all ?
Should I use technical IDs indexed to start the queries at the good vertex ?
In samples v(89) is a song writer while v(1) is the index for Marko in the small graph used in the docs ...
While using Neo4J I noticed that even the APi provides a way to get the id for any vertex ,it 's a very bad practice to use them because they can be reused at any moment...


Kind regards
Jerome

J.MOLIERE - Mentor/J
auteur Eyrolles
blog: http://romjethoughts.blogspot.com
OSGi book available now!!!


2013/2/13 Marko Rodriguez <okram...@gmail.com>

--
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.
For more options, visit https://groups.google.com/groups/opt_out.



Marko Rodriguez

unread,
Feb 13, 2013, 12:57:31 PM2/13/13
to gremli...@googlegroups.com
Hi,

You would use indices. In Gremlin:

g.V('name','marko').out.out….

Please look over Blueprints and Gremlin documentation for getting started.


Marko.

jerome moliere

unread,
Feb 13, 2013, 2:24:41 PM2/13/13
to gremli...@googlegroups.com
Thanks

J.MOLIERE - Mentor/J
auteur Eyrolles
blog: http://romjethoughts.blogspot.com
OSGi book available now!!!


2013/2/13 Marko Rodriguez <okram...@gmail.com>
Hi,
Reply all
Reply to author
Forward
0 new messages