Ogre: do a query without a starting vertex

48 views
Skip to first unread message

Fairuz WAN ISMAIL

unread,
Dec 10, 2014, 4:10:20 AM12/10/14
to clojure-...@googlegroups.com
Hi,

Let say I want find all vertices that has a name Foo and age 12.

If I understand correctly, in Gremlin, this can be done with something like:

g.V().has('name', 'Foo').has(age, 12)

In Ogre, is it correct if I say the equivalent is as below?

(q/query (v/get-all-vertices tx)
(q/has :name "Foo")
(q/has :age 12)
q/into-vec!)

I'm just worried about the performance after seeing v/get-all-vertices in the query. Will it scan all vertices for this query?
Thanks.

Stephen Mallette

unread,
Dec 10, 2014, 6:33:36 AM12/10/14
to clojure-...@googlegroups.com
What version of Ogre are you using? 

--
You received this message because you are subscribed to the Google Groups "Clojure Titanium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-titani...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fairuz WAN ISMAIL

unread,
Dec 10, 2014, 6:59:29 AM12/10/14
to Stephen Mallette, clojure-...@googlegroups.com

Hi,

I use Ogre 2.5.0.0

You received this message because you are subscribed to a topic in the Google Groups "Clojure Titanium" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure-titanium/pWzM4o6za1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure-titani...@googlegroups.com.

Stephen Mallette

unread,
Dec 11, 2014, 6:56:23 AM12/11/14
to clojure-...@googlegroups.com
In 2.5.0.0 - something isn't clear to me.  Given:

(q/query (g/get-vertices tx)
(q/has :name "Foo")
(q/has :age 12)
q/into-vec!))

I think the problem I see is that such query won't optimize to use indices for the "has" portions.  I'm not an expert on the 2.5.0.0 code base, but I think the above is equivalent to constructing a Pipeline as below:

gremlin> new GremlinPipeline(g.getVertices()).has('name','Foo').has('age',12).toString()
==>[GremlinStartPipe, PropertyFilterPipe(name,EQUAL,Foo), PropertyFilterPipe(age,EQUAL,12)]

when you really want it to compile down to this:

gremlin> new GremlinPipeline(g).V().has('name','Foo').has('age',12).toString()
==>[GremlinStartPipe, GraphQueryPipe(has,vertex), IdentityPipe, IdentityPipe]

Perhaps someone more familiar with the Ogre 2.5.0.0 code base can shed some light on this.  I could be wrong in my interpretation.


Fairuz WAN ISMAIL

unread,
Dec 28, 2014, 4:13:38 AM12/28/14
to clojure-...@googlegroups.com
Anyone with Ogre 2.5.0 knowledge can shed a new light on this matter?

Thanks.
Reply all
Reply to author
Forward
0 new messages