possible bug

24 views
Skip to first unread message

Javad Karabi

unread,
Feb 6, 2014, 5:02:59 PM2/6/14
to ne...@googlegroups.com

Javad Karabi

unread,
Feb 6, 2014, 5:03:35 PM2/6/14
to ne...@googlegroups.com
anyone come across anything like this?

On Thursday, February 6, 2014 4:02:59 PM UTC-6, Javad Karabi wrote:

Mark Needham

unread,
Feb 6, 2014, 5:37:41 PM2/6/14
to ne...@googlegroups.com
Can you paste the whole query? I know we had some problems in 2.0.0 with that, which version are you using?


--
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 neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Javad Karabi

unread,
Feb 6, 2014, 5:41:57 PM2/6/14
to ne...@googlegroups.com
mark, sure. the query is below.
fwiw, the problem is caused when "other.birth_year as other_birth_year," is included.
when "other.birth_year as other_birth_year," is removed, it executes fine.

MATCH (me:Member {id: 123})-[:preferred_store]->(s)<-[:preferred_store]-(other)-[:ordered]->()<-[:product]-(sv:StyleVariant)
WITH other.birth_year as other_birth_year, sv.id as style_variant,
    count(s) +
      CASE HAS(me.birth_year) AND HAS(other.birth_year)
        WHEN true THEN
          10 - ABS(me.birth_year - other.birth_year)
        ELSE
          0
        END AS score
WITH SUM(score) as score_for_style_variant, style_variant ORDER BY score_for_style_variant DESC LIMIT 50
RETURN collect(style_variant)

Mark Needham

unread,
Feb 6, 2014, 5:51:42 PM2/6/14
to ne...@googlegroups.com
Does this version do the job?

MATCH (me:Member {id: 123})-[:preferred_store]->(s)<-[:preferred_store]-(other)-[:ordered]->()<-[:product]-(sv:StyleVariant)
WITH other.birth_year as other_birth_year, other, sv.id as style_variant, s, me
WITH other_birth_year, style_variant,
    count(s) +
      CASE HAS(me.birth_year) AND HAS(other.birth_year)
        WHEN true THEN
          10 - ABS(me.birth_year - other.birth_year)
        ELSE
          0
        END AS score
WITH SUM(score) as score_for_style_variant, style_variant ORDER BY score_for_style_variant DESC LIMIT 50
RETURN collect(style_variant)

Javad Karabi

unread,
Feb 6, 2014, 6:04:23 PM2/6/14
to ne...@googlegroups.com
hmm, that does seem to work. 
what do you suppose the issue is?



--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/5DxzViJREKY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

Mark Needham

unread,
Feb 6, 2014, 6:40:42 PM2/6/14
to ne...@googlegroups.com
Good question, I'm not sure. Here's some attempts to figure it out:

MATCH (me:Member)
RETURN me.id AS id, COUNT(*) + CASE me.id > me.name WHEN true then 0 ELSE 5 END

Unknown identifier `  UNNAMED彟븥ۚ覴ण`.
Unknown identifier `  UNNAMED̫묖ᩊ⚞䋕`.
Unknown identifier `me`.

Without count:

MATCH (me:Member)
RETURN me.id AS id, CASE me.id > me.name WHEN true then 0 ELSE 5 END

Returned 0 rows in 120 ms
Comparing me.id to me.id:

MATCH (me:Member)
RETURN me.id AS id, COUNT(*) + CASE me.id > me.id WHEN true then 0 ELSE 5 END

Returned 0 rows in 122 ms

COUNT(me) instead of COUNT(*):

MATCH (me:Member)
RETURN me.id AS id, COUNT(me) + CASE me.id > me.name WHEN true then 0 ELSE 5 END

Unknown identifier `  UNNAMED⤂вぐ짃Ǹ`.
Unknown identifier `  UNNAMED᳽퓒讈埂↌`.
Unknown identifier `me`.

Michael, Andres, Wes, Stefan any ideas? 

Mark Needham

unread,
Feb 6, 2014, 7:02:24 PM2/6/14
to ne...@googlegroups.com
If I explicitly specify me.name then it's ok as well:

MATCH (me:Member)
RETURN me.id AS id, me.name, COUNT(*) + CASE me.id > me.name WHEN true then 0 ELSE 5 END

Returned 0 rows in 91 ms
It's something around adding to aggregates - you don't seem to be able to reference any identifiers unless you already have them earlier in your RETURN clause.


Javad Karabi

unread,
Feb 7, 2014, 5:40:04 PM2/7/14
to ne...@googlegroups.com
any idea why the (chinese?) characters are being displayed? i guess its a sort of 'anonymous' relationship, so neo4j decides to name it using chinese symbols lol

Mark Needham

unread,
Feb 7, 2014, 5:42:42 PM2/7/14
to ne...@googlegroups.com
Yeh any unnamed elements (nodes/rels) in a query get given a name like that - it uses a random string generator to come up with the name. 

Michael Hunger

unread,
Feb 7, 2014, 9:23:51 PM2/7/14
to ne...@googlegroups.com
Random.nextString() hopefully resolved soon.

Michael
Reply all
Reply to author
Forward
0 new messages