Where I've wanted self referencing nodes is when mapping a sequence of
user actions:

user clicks button A -> [then clicks] -> button B -> [then clicks] ->
button B (again) -> [then clicks] -> button C -> [then ...

Run this over a few 10's of thousands of users (incrementing counts), and
a few dozen buttons, and you can start to find things like:

"This sequence of button presses is the most common path for users through
our prouduct."

"If a user is on button B, it is pretty likely they'll click it again."

"The group of users who are based in California tend to click buttons on
the left side of the screen, while the ones in Massachusetts tend to click
buttons on the right side of the screen."

There may have been other ways to do this modeling, but the way I
implemented it really needed self referencing relationships to count all
the [then clicks] relationships, not just the ones that move to new
buttons.



> Hi Shaunak,
>
> As you've noticed, self-referencing nodes have been considered before, and
> I remember being perplexed by the lack when I first became a Neo4j user.
> Changing the support is simple enough, but there was obviously a conscious
> design decision. Why?
>
> Anecdotally (and wiser, longer memoried minds should correct me),
> self-referencing nodes lead to more trouble than they're worth. So they're
> considered an error because there is more value in being alerted that you
> just related a node to itself, then there is value in the few cases where
> you absolutely must have them. Being a database, the decision has been to
> err on the side of avoiding problems, even at the cost of some
> convenience.
>
> An approach that could allow for intentional self-referencing, while still
> protecting against accidental self-references, would be implement an
> explicit Node.relateToSelfAs(RelationshipType type).
>
> What does you model look like, that you expect to require
> self-referencing?
>
> Best,
> Andreas
>
> On Apr 26, 2011, at 11:15 AM, Shaunak Kashyap wrote:
>
>> I know this topic has been discussed before[1] and that a trac issue was
>> also created[2]. I see that a patch was submitted as part of the issue
>> but from browsing the source code[3] it appears that self-referencing
>> relationships are still a no-go in Neo4J.
>>
>> Are there any plans to apply the patch submitted by tobias OR, in
>> general, to provide for self-referencing relationships in Neo4J?
>>
>> We are evaluating Neo4J against OrientDB for an internal tool at Yahoo.
>> While Neo4J looks like a far more mature product overall, the lack of
>> self-referencing relationships might become a sticking point (yes, I
>> understand they can be worked around with a middle node but that
>> requires the application to handle special cases which we would like to
>> avoid).
>>
>> References:
>> [1] http://www.mail-archive.com/user@lists.neo4j.org/msg03996.html
>> [2] https://trac.neo4j.org/ticket/239
>> [3]
>> https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/impl/core/RelationshipImpl.java#L45
>>
>> Thank you,
>>
>> shaunak
>> kashyap
>> technical yahoo
>>
>> shau...@yahoo-inc.com
>> direct 408-349-4024    mobile 408-203-2450
>>
>> 701 first avenue, sunnyvale, ca, 94089-0703, us
>> phone (408) 349 3300    fax (408) 349 3301
>>
>> _______________________________________________
>> 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
>


-- 
Rick Otten
rot...@windfish.net
O=='=+


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

Reply via email to