Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding graphity to the domain examples

  • Loading branch information...
commit 4ffc93e6bef1ae5a66964cbca58664b912259c0e 1 parent 2174b84
@peterneubauer authored
View
9 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[]
+
View
4 cypher/src/docs/dev/ql/cookbook/index.txt
@@ -53,5 +53,9 @@ include::similarity-complex.txt[]
:leveloffset: 1
+include::graphity.txt[]
+
+:leveloffset: 1
+
//include::activity-streams.txt[]
View
14 cypher/src/test/scala/org/neo4j/cypher/docgen/cookbook/GraphityTest.scala
@@ -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 " +
Please sign in to comment.
Something went wrong with that request. Please try again.