You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@s2graph.apache.org by st...@apache.org on 2016/09/13 01:10:48 UTC

incubator-s2graph git commit: [S2GRAPH-112] Additional refinements in README.md

Repository: incubator-s2graph
Updated Branches:
  refs/heads/master 56351af5f -> 26bfd0469


[S2GRAPH-112] Additional refinements in README.md

JIRA:
    [S2GRAPH-112] https://issues.apache.org/jira/browse/S2GRAPH-112

Pull Request:
    Closes #80

Authors
    Jong Wook Kim: jongwook@nyu.edu


Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/26bfd046
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/26bfd046
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/26bfd046

Branch: refs/heads/master
Commit: 26bfd0469e2132151564d93f1ec5984268e2b2a5
Parents: 56351af
Author: DO YUNG YOON <st...@apache.org>
Authored: Tue Sep 13 10:14:33 2016 +0900
Committer: DO YUNG YOON <st...@apache.org>
Committed: Tue Sep 13 10:14:33 2016 +0900

----------------------------------------------------------------------
 CHANGES   |   3 ++
 README.md | 120 +++++++++++++++++++++++++++++++--------------------------
 2 files changed, 68 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/26bfd046/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 96744d0..e8a9a3f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -188,6 +188,9 @@ Release 0.1.0 - unreleased
 
     S2GRAPH-106: Remove warnings while package (Committed by DOYUNG YOON).
 
+    S2GRAPH-112: Additional refinements in README.md
+		(Contributed by Jong Wook Kim<jo...@nyu.edu>, committed by DOYUNG YOON).
+
   TEST
     
     S2GRAPH-21: Change PostProcessBenchmarkSpec not to store and fetch test data from storage. (Committed by DOYUNG YOON).

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/26bfd046/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index aecc65d..eab269e 100644
--- a/README.md
+++ b/README.md
@@ -7,9 +7,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -37,21 +37,28 @@ One can find distribution on `target/apache-s2graph-$version-incubating-bin`.
 
 Quick Start
 ===========
-Once built from source, the following resources are expected under `target/apache-s2graph-$version-incubating-bin`. This should be the same structure as in the binary distribution.
 
-1. `DISCLAIMER`
-2. `LICENSE`
-3. `NOTICE`
-4. `bin`
-5. `conf`
-6. `lib`
-7. `logs`
-8. `var`
+Once extracted the downloaded binary release of S2Graph or built from the source as described above, the following files and directories should be found in the directory.
 
-`sh bin/start-s2graph.sh` will launch the S2Graph server along with a standalone [HBase server](https://hbase.apache.org/) as the data storage and [H2](http://www.h2database.com/html/main.html) as the metastore
+```
+DISCLAIMER
+LICENCE               # the Apache License 2.0
+NOTICE
+bin                   # scripts to manage the lifecycle of S2Graph
+conf                  # configuration files
+lib                   # contains the binary
+logs                  # application logs
+var                   # application data
+```
 
-To see how to connect remote HBase and S2Graph configurations, check out conf/application.conf.
-Currently we have tested with these HBase version(0.98, 1.0, 1.1, 1.2)(https://hub.docker.com/r/harisekhon/hbase/tags/).
+This directory layout contains all binary and scripts required to launch S2Graph. The directories `logs` and `var` may not be present initially, and are created once S2Graph is launched.
+
+The following will launch S2Graph, using [HBase](https://hbase.apache.org/) in the standalone mode for data storage and [H2](http://www.h2database.com/html/main.html) as the metadata storage.
+
+    sh bin/start-s2graph.sh
+
+To connect to a remote HBase cluster or use MySQL as the metastore, refer to the instructions in [`conf/application.conf`](conf/application.conf).
+S2Graph is tested on HBase versions 0.98, 1.0, 1.1, and 1.2 (https://hub.docker.com/r/harisekhon/hbase/tags/).
 
 Project Layout
 ==============
@@ -71,31 +78,30 @@ The first three projects are for OLTP-style workloads, currently the main target
 Your First Graph
 ================
 
-Once S2Graph server is up, let's try out small toy example. `bin/example.sh` can be used to go through following example.
- 
-As a toy problem, let's try to create the backend for a simple timeline of a new social network service. (Think of a simplified version of Facebook's Timeline. :stuck_out_tongue_winking_eye:)
-You will be able to manage "friends" and "posts" of a user with simple S2Graph queries.
+Once the S2Graph server has been set up, you can now start to send HTTP queries to the server to create a graph and pour some data in it. This tutorial goes over a simple toy problem to get a sense of how S2Graph's API looks like. [`bin/example.sh`](bin/example.sh) contains the example code below.
 
+The toy problem is to create a timeline feature for a simple social media, like a simplified version of Facebook's timeline:stuck_out_tongue_winking_eye:. Using simple S2Graph queries it is possible to keep track of each user's friends and their posts.
 
 1. First, we need a name for the new service.
 
-  Why don't we call it Kakao Favorites?
+  The following POST query will create a service named "KakaoFavorites".
+
   ```
   curl -XPOST localhost:9000/graphs/createService -H 'Content-Type: Application/json' -d '
   {"serviceName": "KakaoFavorites", "compressionAlgorithm" : "gz"}
   '
   ```
 
-  Make sure the service is created correctly.
+  To make sure the service is created correctly, check out the following.
+
   ```
   curl -XGET localhost:9000/graphs/getService/KakaoFavorites
   ```
 
 2. Next, we will need some friends.
 
-  In S2Graph, relationships are defined as Labels.
+  In S2Graph, relationships are organized as labels. Create a label called `friends` using the following `createLabel` API call:
 
-  Create a ```friends``` label with the following ```createLabel``` API call:
   ```
   curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type: Application/json' -d '
   {
@@ -113,21 +119,21 @@ You will be able to manage "friends" and "posts" of a user with simple S2Graph q
   }
   '
   ```
-  Check the label:
+
+  Check if the label has been created correctly:+
+
   ```
   curl -XGET localhost:9000/graphs/getLabel/friends
   ```
 
-  Now that the label ```friends``` is ready, we can store friend entries.
+  Now that the label `friends` is ready, we can store the friendship data. Entries of a label are called edges, and you can add edges with `edges/insert` API:
 
-  Entries of a label are called edges, and you can add edges with the ```edges/insert``` API:
   ```
   curl -XPOST localhost:9000/graphs/edges/insert -H 'Content-Type: Application/json' -d '
   [
     {"from":"Elmo","to":"Big Bird","label":"friends","props":{},"timestamp":1444360152477},
     {"from":"Elmo","to":"Ernie","label":"friends","props":{},"timestamp":1444360152478},
     {"from":"Elmo","to":"Bert","label":"friends","props":{},"timestamp":1444360152479},
-
     {"from":"Cookie Monster","to":"Grover","label":"friends","props":{},"timestamp":1444360152480},
     {"from":"Cookie Monster","to":"Kermit","label":"friends","props":{},"timestamp":1444360152481},
     {"from":"Cookie Monster","to":"Oscar","label":"friends","props":{},"timestamp":1444360152482}
@@ -135,26 +141,28 @@ You will be able to manage "friends" and "posts" of a user with simple S2Graph q
   '
   ```
 
-  Query friends of Elmo with ```getEdges``` API:
+  Query friends of Elmo with `getEdges` API:
+
   ```
   curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '
   {
-      "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Elmo"}],
-      "steps": [
-        {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]}
-      ]
+    "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Elmo"}],
+    "steps": [
+      {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]}
+    ]
   }
   '
   ```
 
   Now query friends of Cookie Monster:
+
   ```
   curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '
   {
-      "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Cookie Monster"}],
-      "steps": [
-        {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]}
-      ]
+    "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Cookie Monster"}],
+    "steps": [
+      {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]}
+    ]
   }
   '
   ```
@@ -180,7 +188,9 @@ You will be able to manage "friends" and "posts" of a user with simple S2Graph q
   '
   ```
 
-  Now, insert some posts of our users:
+  Now, insert some posts of the users:
+
+
   ```
   curl -XPOST localhost:9000/graphs/edges/insert -H 'Content-Type: Application/json' -d '
   [
@@ -195,31 +205,30 @@ You will be able to manage "friends" and "posts" of a user with simple S2Graph q
   ```
 
   Query posts of Big Bird:
+
   ```
   curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '
   {
-      "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Big Bird"}],
-      "steps": [
-        {"step": [{"label": "post", "direction": "out", "offset": 0, "limit": 10}]}
-      ]
+    "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Big Bird"}],
+    "steps": [
+      {"step": [{"label": "post", "direction": "out", "offset": 0, "limit": 10}]}
+    ]
   }
   '
   ```
 
-4. So far, we designed a label schema for your user relation data ```friends``` and ```post``` as well as stored some sample edges.
-
-  While doing so, we have also prepared ourselves for our timeline query!
+4. So far, we have designed a label schema for the labels `friends` and `post`, and stored some edges to them.+
 
-  The following two-step query will return URLs for Elmo's timeline, which are posts of Elmo's friends:
+  This should be enough for creating the timeline feature! The following two-step query will return the URLs for Elmo's timeline, which are the posts of Elmo's friends:
 
   ```
   curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '
   {
-      "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Elmo"}],
-      "steps": [
-        {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]},
-        {"step": [{"label": "post", "direction": "out", "offset": 0, "limit": 10}]}
-      ]
+    "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Elmo"}],
+    "steps": [
+      {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]},
+      {"step": [{"label": "post", "direction": "out", "offset": 0, "limit": 10}]}
+    ]
   }
   '
   ```
@@ -228,16 +237,17 @@ You will be able to manage "friends" and "posts" of a user with simple S2Graph q
   ```
   curl -XPOST localhost:9000/graphs/getEdges -H 'Content-Type: Application/json' -d '
   {
-      "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Cookie Monster"}],
-      "steps": [
-        {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]},
-        {"step": [{"label": "post", "direction": "out", "offset": 0, "limit": 10}]}
-      ]
+    "srcVertices": [{"serviceName": "KakaoFavorites", "columnName": "userName", "id":"Cookie Monster"}],
+    "steps": [
+      {"step": [{"label": "friends", "direction": "out", "offset": 0, "limit": 10}]},
+      {"step": [{"label": "post", "direction": "out", "offset": 0, "limit": 10}]}
+    ]
   }
   '
   ```
 
-The above example is by no means a full-blown social network timeline, but it gives you an idea on how to represent, store and query relations with S2Graph.
+The example above is by no means a full blown social network timeline, but it gives you an idea of how to represent, store and query graph data with S2Graph.+
+
 
 #### [The Official Website](https://s2graph.apache.org/)