Announcement Announcement Module
Collapse
No announcement yet.
Neo4j Cypher query start relationship Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 10:28 AM.

  • #2
    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?

    Comment


    • #3
      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, 05:34 AM.

      Comment


      • #4
        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?

        Comment

        Working...
        X