https://github.com/jexp/neo4j-activity-stream
Server extension implementation for an simple activity stream example
https://github.com/jexp/neo4j-activity-stream
Last synced: over 1 year ago
JSON representation
Server extension implementation for an simple activity stream example
- Host: GitHub
- URL: https://github.com/jexp/neo4j-activity-stream
- Owner: jexp
- Created: 2013-11-29T00:48:10.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-18T12:18:34.000Z (over 12 years ago)
- Last Synced: 2025-03-23T11:33:04.969Z (over 1 year ago)
- Language: Java
- Size: 164 KB
- Stars: 2
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Unmanaged Extension for Activity Aggregation
## Use-Case
A user wants to see all the recent activity on the boards it is following. For instance the last 20 or 50 posts.
A graph model example looks like this:

The use-case can be easily represented as Cypher query like this, but unfortunately this doesn't yet perform well:
````
MATCH (head:ActivityHead)-[:NEXT*]->(activity)-[:IN_FORUM]->
(forum:Forum)<-[:FOLLOWS]-(user:User {name: {name}}),
(activity)<-[:WROTE]-(author:User)
RETURN author.name, activity.message, forum.name
LIMIT 20
````
That's why an unmanaged extension can reach out only to those boards and posts that are relevant without touching anything else in the graph. The code in this repository encapsulates the algorithm as a single Java class and exposes it to the outside world as a Neo4j server extension.
## Setup
The ressource has to be configured in `conf/neo4j-server.properties` as
org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.example.activity=/api
It is then available for the front-end at the URL `http://host:7474/api/activities/{username}`.