Ok, I figured the difference between the two queries and why the second one
returns so many results.
But, I still need to know if it is possible to store the same relation
multiple times between two same nodes with different attributes for the
relation?
Regards,
On Wednesday, January 22, 2014 10:44:55 PM UTC+5:30, Harshal Vora wrote:
>
> Hi Peter,
>
> What is the difference between
> start a = node(26) match p=a-[r:COORD_DEFINED_BY]-() return r ;
>
> AND
>
> start a = node(26) match p=a-[r:COORD_DEFINED_BY]-()--() return r
>
>
> Why does the first query return only one row while the second query
> returns 13 rows? All same.
>
> Also, I have stored birthTime and deathTime with each node and each
> relation.
> When I try to store two different relations between two same nodes with
> different birthtime/deathtime it does not seem to persist. Is this even
> possible i.e. to store same relation with different attribute values
> multiple times between two same nodes?
>
>
>
>
> Below are the results
> start a = node(26) match p=a-[r:COORD_DEFINED_BY]-() return r ;
>
> +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> |
> r
>
>
>
> |
>
> +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
>
> +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
>
>
>
> start a = node(26) match p=a-[r:COORD_DEFINED_BY]-()--() return r ;
>
> +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> |
> r
>
>
>
> |
>
> +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
> | :COORD_DEFINED_BY[37]
> {__type__:"GeometryContainer",birthTimeMillis:1356998400000,geometry:"POLYGON
> ((0 3.35, 8.61 3.35, 8.61 6.7, 0 6.7, 0
> 3.35))",deathTime:"1420070400000",birthTime:"1356998400000",uniqueId:"ba2e816b-4697-427e-aa2a-f32fe8407ce9",deathTimeMillis:1420070400000}
>
> |
>
> +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> 13 rows
> 3 ms
>
>
> Regards,
>
> On Wednesday, May 16, 2012 12:46:01 AM UTC+5:30, Peter Neubauer wrote:
>>
>> Bikash,
>> you can do a Cypher query which will give you unique relationships, e.g.
>>
>> http://tinyurl.com/cmk9bby where there are multiple relationships
>> between node 1 and 2 (see the setup)
>>
>> start a = node(1) match p=a-[r:related]->()-->() return p, r
>>
>> for java, see
>> http://docs.neo4j.org/chunked/snapshot/tutorials-cypher-java.html
>> for executing it from Java.
>>
>> Does that do what you want?
>>
>> Cheers,
>>
>> /peter neubauer
>>
>> G: neubauer.peter
>> S: peter.neubauer
>> P: +46 704 106975
>> L: http://www.linkedin.com/in/neubauer
>> T: @peterneubauer
>>
>> If you can write, you can code - @coderdojomalmo
>> If you can sketch, you can use a graph database - @neo4j
>>
>>
>> On Tue, May 15, 2012 at 8:05 PM, Bikash Jain <[email protected]> wrote:
>> > Hi,
>> >
>> > I am working on a small POC project to benchmark neo4j graph DB
>> > against our current mysql implementation of the same feature.
>> >
>> >
>> > We have our database model in such a way, where we will have to create
>> > multiple relationship of same type (but different properties) between
>> > two node.
>> >
>> > However during node traversal, we want to retrive all the relationship
>> > between those 2 nodes (currently I see the traversal framework return
>> > only one relationship and not all. I might be wrong. ) But couldn't
>> > find how to do that using either GraphAlgoFactory or Traversal
>> > frameWork.
>> >
>> >
>> > I am using, neo4j in JAVA and is embedded in our tomcat server.
>> > (adding neo4j jar in tomcat).
>> >
>> > We also want to do that upto a depth of 4 and between two consecutive
>> > node, we need all the relationships.
>> >
>> > Let me know if I am not clear on this.
>> >
>> > Thanks,
>> > Bikash
>> >
>>
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.