Results 1 to 4 of 4

Thread: Neo4j Cypher query start relationship

  1. #1
    Join Date
    Aug 2010
    Posts
    26

    Default Neo4j Cypher query start relationship

    Hi,

    I have a couple of fringe case queries that need speeding up. I am trying to start from the relationship in an attempt to do this.

    I noticed the default neo syntax is START r=rel(0) RETURN r but I am unable to get this to work on the spring data.

    I have tried start n=node:rel(__rel_types__(className="foo.Relationsh ipTypes.CREATED") return n plus many other permutations with no joy.

    Also to aid in my debugging is there any way to list all the index contents by any means? I would like to check my __rel_types__. I have been unable to accomplish this via cypher or the command line so far using index -g

    Thanks,

    Mark
    Last edited by msduk; May 31st, 2012 at 10:28 AM.

  2. #2
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Mark,

    index content is unfortunately not programmatically available, as it is stored inside the index. The easiest chance is with luke the apache lucene low level tool.

    What are the concrete issues you're running into? Exceptions or no data returned?

  3. #3
    Join Date
    Aug 2010
    Posts
    26

    Default

    Michael thanks for the reply,

    The concrete issue is that I am trying to debug my query for starting a cypher query on the relationship. Having inserted my data using batch Inserter I want to be sure I have not made any mistakes. I am familiar with Luke so I will give that a go.

    I saw in an example that the FQN className was being used for the relationship is this correct?

    START r=rel(0) RETURN r

    start n=node:rel(__rel_types__(className="foo.Relationsh ipTypes.CREATED") return n

    Regards,

    Mark
    Last edited by msduk; Jun 1st, 2012 at 05:34 AM.

  4. #4
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    What does your RelationshipEntity look like?

    If you don't have a Relationship-Entity and want to query by rel, I think it would make most sense to not use derived queries but write the query yourself.
    Code:
    interface SomeRepo ... {
       @Query("start bar=rel({0}) match foo-[bar]->baz return foo") Set<Foo> findByBar(Relationship bar);
    }
    Can you share some code so that I can understand what you're trying to achieve?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •