GraphServer (aka "OmniStore") is REST based service which supports GET, PUT and DELETE of object and connections in the graph. It supports the concept of scope where objects and connections are accessible with-in scope. (Scope could be “app”, “partner”).
- Graph APIs. (fully working)
- Horizontal partitioned Graph Storage (uses Cassandra)
- Whitelisting of objects and connections. (Currently service configuration)
- Directionality of connections. (Connection could be directed or undirected)
- Multi connection graph for recurring activities/event (For e.g check-ins at location, opened a app on device)
Object is uniquely identified by its type and id. Object have properties (key-value pair, e.g. {“name” : “Ajay Kumar Sarda”, “gender” : “male”})
Object under the scope is uniquely identified by its type, id and scope.
Connection is unique identified by source-object-id, source-object-type, connection-type, destination-object-id, destination-object-type, properties. Connections have properties.
Connection is uniquely identified by source-object-id, source-object-type, scope, connection-type, destination-object-id, destination-object-type.
Connection is unique identified by source-object-id, source-object-type, connection-type, destination-object-id, destination-object-type, created, properties.
Currently, connections and objects are whitelisted in the service. In future, we can open up this for apps to define their custom objects and connections.(something like open graph stories)
./gradlew clean shadowJar
java -jar build/libs/graph-service-1.0.0-fat.jar -conf conf.json -instances 2
Options:
- run standalone
- run ccm
- point at your internal cluster
Execute the scheme file in db/scheme.cql on your setup.
Look at conf.json for configuration.
PUT localhost:9301/user/4444 with body
{
"properties" : {
"name" : “Ajay Sarda“
}
}
``` creates new user object.
GET localhost:9301/user/4444 fetches the object
DELETE localhost:9301/user/4444 deletes the object.
### Object Scope APIs
PUT localhost/app/myapp/user/4444 with body
```json
{
"properties" : {
"name" : "Ajay Sarda"
}
}
``` creates new user object.
GET localhost:9301/app/myapp/user/4444 fetches the object
DELETE localhost:9301/app/myapp/user/4444 deletes the object.
### Connection APIs
PUT localhost:9301/user/4444 with body
```json
{
"properties" : {
"name" : "Ajay Sarda"
}
}
PUT localhost:9301/user/5555 with body
{
"properties" : {
"name" : "Ankur Singla"
}
}
PUT localhost:9301/user/4444/friend/user/5555 with body
{
"properties" : {
"group" : "cyanogen"
}
}
``` creates new friend connection.
GET localhost:9301/user/4444/friend gets all friends for user with id=4444.
GET localhost:9301/user/5555/friend gets all friends for user with id=5555.
GET localhost:9301/user/4444/friend/user/5555 gets the properties associated with that particular connection,
DELETE localhost:9301/user/4444/friend/user/5555 deletes the connection.
### Connection Scope APIs
PUT localhost:9301/app/boxer/user/4444 with body
```json
{
"properties" : {
"name" : "Ajay Sarda"
}
}
PUT localhost:9301/app/boxer/user/5555 with body
{
"properties" : {
"name" : "Ankur Singla"
}
}
PUT localhost:9301/app/boxer/user/4444/friend/user/5555 with body
{
"properties" : {
"group" : "friends"
}
}
``` creates new friend connection.
GET localhost:9301/app/myapp/user/4444/friend gets all friends for user with id=4444.
GET localhost:9301/app/myapp/user/5555/friend gets all friends for user with id=5555.
GET localhost:9301/app/myapp/user/4444/friend/user/5555 gets the properties associated with that particular connection,
DELETE localhost:9301/user/4444/friend/user/5555 deletes the connection.