Skip to content

amartinsn/user-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feeding The Graph

Creating a user node

HTTP POST /users
{
    "id": "4", // cadun id
    "name": "Chuck Norris",
    "username": "chuck.norris",
    "email": "[email protected]"
}

Creating a friendship

HTTP POST /friendships/:userId-:otherUserId

Deleting a friendship

HTTP DELETE /friendships/:userId-:otherUserId

Registering user preferences

(WIP)

HTTP POST /users/:id/preferences
{
    "follows": {
        "section": {
            "name": "Politica",
            "url": "http://semantica.globo.com/G1/Politica"
        }
    }
}

Registering user events

(TODO)

HTTP POST /users/:id/events
[
    {
        "eventName": "read",
        "object": {
            "type": "Article",
            "subject": "Politics",
            "url": "http://www.globo.com/politics/2322345"
        }
    },
    {
        "eventName": "watched",
        "object": {
            "type": "Video",
            "subject": "Sports",
            "url": "http://www.globo.com/sports/video/123234"
        }
    },
    {
        "eventName": "commented",
        "object": {
            "type": "Article",
            "subject": "Entertainment",
            "url": "http://www.globo.com/foo/2333"
        }
    },
    {
        "eventName": "rated",
        "object": {
            "type": "CookingRecipe",
            "url": "http://www.globo.com/foo/2333"
        }
    }
]

Querying The Graph

List of users with a given preference

(WIP)

HTTP GET /users/supports/SoccerTeam?name=flamengo

List of friends who follows a given Section

(WIP)

HTTP GET /users/:id/friends/follows/section?name=Politica

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages