My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
QuickAPI  
Quick intro to the feedgraph API
Updated Sep 6, 2013 by RyanneDolan

What is FeedGraph?

FeedGraph provides a powerful real-time graph database for storing knowledge graphs, social networks, or arbitrary data. Clients can subscribe to changes in the graph, including when new nodes or relations are added.

What is FeedGraph good for?

Consider using FeedGraph if you are building:

  • social networks
  • group chat apps
  • multiplayer games
  • contextually aware apps

Terminology

Graph

a collection of nodes, edges, and the relations between them.

Node

stores arbitrary JSON data. Each node has a unique URI.

e.g. GET /users/ryanne --> {"Name":"Ryanne", "Age":27}

Relation

a set of edges with a common source node and RelationType.

e.g. GET /users/ryanne?friends --> ["/users/sarah":{"Name":"Sarah", ...}, ... ]

Edge

a directed link between two nodes. Each edge has a RelationType and connects a source node to a sink node.

e.g. PUT /source/node?relation&/sink/node

Mailbox

a message queue. Each node has an implicit mailbox.

e.g. POST /users/ryanne <-- {"testing":123}

e.g. GET /users/ryanne.inbox --> [{"YouGot":"Mail"}, ...]

Collections

Nodes can be organized into hierarchical collections.

e.g. /users/ryanne, /companies/google, /universities/missouri/mu

Nodes representing collections, e.g. /users, are automatically created and linked to their members using the members relation.

Attachments

Nodes can have raw data attached to them. Currently, HTML, CSS, JS, and Markdown are supported attachment types. Request the data attached to a node by appending an extension to the URI:

e.g. GET /p/home.html

Templates

Nodes can have templates attached to them, which are used to render other nodes in HTML:

e.g. GET /people/justin-case.html?t=/t/span/name

Requests

If you know the path to a node, you can request it directly. The API will return the arbitrary JSON object data stored in the node.

e.g. GET /path/to/node --> {"JSON":"data"}

If you wish to find a set of nodes which matches some criterion (a "search"), you must do so via a relation. Notice that this implies that someone linked the nodes with the given relation at a previous point in time.

e.g. GET /fruit?red --> {"/fruit/apple":{"color":"red"}, ...}

It's also possible to combine relations for more powerful searches.

e.g. GET /fruit?red+delicious // red AND delicious

e.g. GET /fruit?red|green // red OR green

GET Requests

request response response format
GET {node} arbitrary object JSON
GET {node}?{relation} edge set ["node1":{...}, ...]
GET {node}.inbox mail [msg1, msg2, ...]
GET {node}.{html|css|js} raw attachment HTML, CSS, or JS
GET {node}.html?t={template} rendered HTML HTML

PUT Requests

request action POSTDATA format
PUT {node} store arbitrary object JSON
PUT {source-node}?{relation}&{sink-node} link source node to sink node none
PUT {node}.{html|css|js|md} store arbitrary attachment raw data

POST Requests

request action POSTDATA format
POST {node} send message to mailbox JSON
POST {source-node}?{relation} broadcast message to all matching mailboxes JSON

JavaScript API

Source the following script in your webpage:

<script src="http://www.feedgraph.com/js/feedgraph.js"></script>
Powered by Google Project Hosting