Hi,

Peter brings up a good point. Its hard for us to parse complex queries and see 
where Exceptions are happening. If you can isolate the problem via a simpler 
traversal, that would be best for us -- and our little baby brains.

Also, note the following syntax optimizations for your traversal:
        1. outE[[label:'HOSTS']].inV ---> out('HOSTS')
        2. Similarly, inE[[label:'X']].outV -> in('X')

Using out() and in() is much more efficient (faster) and more concise. Unless 
you plan to reason on the properties of an edge, then there is no reason to use 
outE.inV style syntax as out will do the full vertex-to-vertex jump for you.

HTH,
Marko.

http://markorodriguez.com

On Dec 7, 2011, at 1:00 AM, Peter Neubauer wrote:

> Mmh,
> I was thinking on how to return the contents of the output stream, I
> am not quite sure how to return that. What woudl be a good format for
> you?
> 
> Also could you reduce this into a small testcase that I can work on?
> 
> Cheers,
> 
> /peter neubauer
> 
> GTalk:      neubauer.peter
> Skype       peter.neubauer
> Phone       +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter      http://twitter.com/peterneubauer
> 
> brew install neo4j && neo4j start
> heroku addons:add neo4j
> 
> 
> 
> On Wed, Dec 7, 2011 at 8:10 AM, Romiko Derbynew
> <romiko.derby...@readify.net> wrote:
>> Hi,
>> 
>> I have this statement.
>> g.v('0').outE[[label:'HOSTS']].inV.filter{ 
>> it['Key'].equalsIgnoreCase('romikoagency') 
>> }.inE[[label:'USER_BELONGS_TO']].outV.filter{ 
>> it['Username'].equalsIgnoreCase('romiko.derbynew') 
>> }.ifThenElse{it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.hasNext()}{it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.Name}{println
>>  ${it} "Unknown"}.as('Centre')
>> 
>> I then take this query and do a table projection, however I get the 
>> following error.
>> println java.lang.String cannot be cast to 
>> com.tinkerpop.blueprints.pgm.Vertex
>> 
>> Is there a better way to do this then? I want to reduce our calls to the DB 
>> for performance and finding it a bit tough wrapping everything into one  
>> query. Currently the above query is split into two different queries.
>> 
>> Much appreciated.
>> _______________________________________________
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to