Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #711 from peterneubauer/graphity
adding graphity to the domain examples
  • Loading branch information
jakewins committed Sep 7, 2012
2 parents 8a0dd3e + 4ffc93e commit 34df975
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
9 changes: 9 additions & 0 deletions cypher/src/docs/dev/ql/cookbook/graphity.txt
@@ -0,0 +1,9 @@
[[cypher-cookbook-graphity]]
== The Graphity activity stream model ==

:leveloffset: 2

include::find-activity-streams-in-a-network-without-scaling-penalty.txt[]

include::cypher-graphity-graph.txt[]

4 changes: 4 additions & 0 deletions cypher/src/docs/dev/ql/cookbook/index.txt
Expand Up @@ -53,5 +53,9 @@ include::similarity-complex.txt[]

:leveloffset: 1

include::graphity.txt[]

:leveloffset: 1

//include::activity-streams.txt[]

Expand Up @@ -41,12 +41,18 @@ class GraphityTest extends DocumentingTestBase {

def section = "cookbook"

@Test def peopleSimilarityTags() {
@Test def findActivityStreams() {
testQuery(
title = "Find Activity Streams in a network without scaling penalty",
text = """This is an approach put forward by Rene Pickard as http://www.rene-pickhardt.de/graphity-an-efficient-graph-model-for-retrieving-the-top-k-news-feeds-for-users-in-social-networks/[Graphity].
In short, a linked list is created for every persons friends in the order that the last activities of these friends have occured.
To find the activity stream for a person, the friend just follow the linked list of the friend list, and retrieve the needed amount of activities form the respective activity list of the friends.""",
text = """This is an approach for scaling the retrieval of activity streams in a friend graph put forward by Rene Pickard as http://www.rene-pickhardt.de/graphity-an-efficient-graph-model-for-retrieving-the-top-k-news-feeds-for-users-in-social-networks/[Graphity].
In short, a linked list is created for every persons friends in the order that the last activities of these friends have occured. When new activities occur for a friend, all the ordered friend lists that this friend is part of are reordered,
transfering computing load to the time of new event updates instead of activity stream reads.
[TIP]
This approach of course makes excessive use of relationship types. Right now now the maximum amount of relationship types in Neo4j is 65.000 which needs
to be taken into consideration when designing a production system with this approach.
To find the activity stream for a person, just follow the linked list of the friend list, and retrieve the needed amount of activities form the respective activity list of the friends.""",
queryText = "START me=node:node_auto_index(name = \"Jane\") " +
"MATCH p=me-[:jane_knows*]->friend, " +
"friend-[:has]->status " +
Expand Down

0 comments on commit 34df975

Please sign in to comment.