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 2018/10/31 09:26:04 UTC

[1/2] incubator-s2graph git commit: [S2GRAPH-235] Update document and fix typo errors in S2GraphQL MD.

Repository: incubator-s2graph
Updated Branches:
  refs/heads/master bfc063f50 -> d8cfea1e3


[S2GRAPH-235] Update document and fix typo errors in S2GraphQL MD.


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

Branch: refs/heads/master
Commit: a2666e43818145536b51499b4f0db0e79afd1dbf
Parents: 07a5af3
Author: Hwansung Yu <ra...@apache.org>
Authored: Mon Aug 6 11:30:19 2018 +0900
Committer: Hwansung Yu <ra...@apache.org>
Committed: Fri Sep 7 11:16:13 2018 +0900

----------------------------------------------------------------------
 s2graphql/README.md | 114 +++++++++++++++++++++++++++++++----------------
 1 file changed, 76 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/a2666e43/s2graphql/README.md
----------------------------------------------------------------------
diff --git a/s2graphql/README.md b/s2graphql/README.md
index 21973d9..0180df7 100644
--- a/s2graphql/README.md
+++ b/s2graphql/README.md
@@ -20,10 +20,10 @@
 --->
 # Suggest to implement GraphQL as standard web interface for S2Graph.
 
-  - To support GraphQL i used [Akka HTTP](https://github.com/akka/akka-http) and [Sangria](https://github.com/sangria-graphql). each is an HTTP Server and GraphQL Scala implementation.
-  - I also used [GraphiQL](https://github.com/graphql/graphiql) as a tool for GraphQL queries.
+  - To support GraphQL through [Akka HTTP](https://github.com/akka/akka-http) and [Sangria](https://github.com/sangria-graphql). Akka HTTP and Sangria each are an HTTP Server and GraphQL Scala implementation.
+  - It is also used [GraphiQL](https://github.com/graphql/graphiql) as a tool for GraphQL queries.
 
-## Wroking example
+## Working example
 
 ![mutation](https://user-images.githubusercontent.com/1182522/35611013-f551f2b6-06a6-11e8-8f48-e39e667a8849.gif)
 
@@ -32,13 +32,13 @@
 
 ## Overview
   
-  The reason I started this work is because the `Label` used by S2Graph has a strong type system, so I think it will work well with the `schema` provided by GraphQL.
+  The reason why started supporting GraphQL is the `Label` used by S2Graph has a strong type system, so it will work well with the `schema` provided by GraphQL.
   
-  To do this, we converted S2Graph Model (Label, Service ...) into GraphLQL schema whenever added (changed).
+  So far, whenever GraphQL schema has been changed, it has been reflected in S2Graph Model (Service, Label... ).
 
 ## Setup
   Assume that hbase is running on localhost.  
-  If the hbase environment is not set up, you can run it with the following command
+  If the hbase environment is not set up, you should type the following commands.
 
 ```bash
 sbt package
@@ -63,7 +63,7 @@ $ls
 graphiql.html
 ```
 
-And let's run http server.
+Then let's run http server.
 
 ```bash
 sbt -DschemaCacheTTL=-1 -Dhttp.port=8000 'project s2graphql' '~re-start'
@@ -83,16 +83,16 @@ When the server is running, connect to `http://localhost:8000`. If it works norm
 ## Your First Grpah (GraphQL version)
 
 [S2Graph tutorial](https://github.com/apache/incubator-s2graph#your-first-graph)
-I have ported the contents of `Your first graph` provided by S2Graph based on GraphQL.
+The following content rewrote `Your first graph` to the GraphQL version.
 
 ### Start by connecting to `http://localhost:8000`.
 
-The environment for this example is Mac OS and Chrome.
+The environment for this examples is Mac OS and Chrome.
 You can get help with schema-based `Autocompletion` using the `ctrl + space` key.
 
 If you add a `label` or `service`, etc. you will need to `refresh` (`cmd + r`) your browser because the schema will change dynamically.
 
-1. First, we need a name for the new service.
+#### 1. First, we need a name for the new service.
 
     The following POST query will create a service named "KakaoFavorites".
 
@@ -128,7 +128,7 @@ Response
 ```
 
 
-1.1 And create a `service column`` which is meta information for storing vertex.
+#### 1.1 And create a `service column`` which is meta information for storing vertex.
 
     The following POST query will create a service column with the age attribute named "user"
 
@@ -191,7 +191,7 @@ Request
 ```graphql
 query {
   Management {
-    Service(name:KakaoFavorites) {    
+    Services(name:KakaoFavorites) {    
       name
       serviceColumns {
         name
@@ -231,7 +231,7 @@ Response
 }
 ```
 
-2. Next, we will need some friends.
+#### 2. Next, we will need some friends.
 
     In S2Graph, relationships are organized as labels. Create a label called friends using the following createLabel API call:
 
@@ -292,7 +292,7 @@ Request
 ```graphql
 query {
   Management {
-    Label(name: friends) {
+    Labels(name: friends) {
       name
       srcColumnName
       tgtColumnName
@@ -376,7 +376,7 @@ query {
   KakaoFavorites {    
     user(id: "Elmo") {
       friends {
-        to {
+        user {
           id
         }
       }
@@ -418,7 +418,7 @@ query {
   KakaoFavorites {    
     user(id: "Elmo") {      
       friends {        
-        to {
+        user {
           id
         }
       }
@@ -459,8 +459,46 @@ Response
 }
 ```
 
+Before next examples, you should add url to serviceColumn.
 
-3. Users of Kakao Favorites will be able to post URLs of their favorite websites.
+Request
+
+```graphql
+mutation {
+  Management {
+    createServiceColumn(
+      serviceName: KakaoFavorites
+      columnName: "url"
+      columnType: string
+    ) {
+      isSuccess
+      object {
+        name
+      }
+    }
+  }
+}
+```
+
+Response
+
+```json
+{
+  "data": {
+    "Management": {
+      "createServiceColumn": {
+        "isSuccess": true,
+        "object": {
+          "name": "url"
+        }
+      }
+    }
+  }
+}
+```
+
+
+#### 3. Users of Kakao Favorites will be able to post URLs of their favorite websites.
 
 Request
 
@@ -474,9 +512,9 @@ mutation {
           columnName: user
         }
       }
-			targetService: {
+      targetService: {
         KakaoFavorites: {
-          columnName: user
+          columnName: url
         }
       }
       consistencyLevel: strong
@@ -561,7 +599,7 @@ Response
 }
 ```
 
-4. So far, we have designed a label schema for the labels friends and post, and stored some edges to them.+
+#### 4. So far, we have designed a label schema for the labels friends and post, and stored some edges to them.+
 
     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:
 
@@ -573,10 +611,10 @@ query {
     user(id: "Elmo") {
       id
       friends {
-        to {
+        user {
           id
           post {
-            to {
+            url {
               id
             }
           }
@@ -597,11 +635,11 @@ Response
           "id": "Elmo",
           "friends": [
             {
-              "to": {
+              "user": {
                 "id": "Ernie",
                 "post": [
                   {
-                    "to": {
+                    "url": {
                       "id": "groups.google.com/forum/#!forum/s2graph"
                     }
                   }
@@ -609,23 +647,23 @@ Response
               }
             },
             {
-              "to": {
+              "user": {
                 "id": "Bert",
                 "post": []
               }
             },
             {
-              "to": {
+              "user": {
                 "id": "Big Bird",
                 "post": [
                   {
-                    "to": {
-                      "id": "www.kakaocorp.com/en/main"
+                    "url": {
+                      "id": "github.com/kakao/s2graph"
                     }
                   },
                   {
-                    "to": {
-                      "id": "github.com/kakao/s2graph"
+                    "url": {
+                      "id": "www.kakaocorp.com/en/main"
                     }
                   }
                 ]
@@ -647,10 +685,10 @@ query {
   KakaoFavorites {
     user(id: "Cookie Monster") {
       friends {      
-        to {
+        user {
           id
           post {
-            to {
+            url {
               id
             }
           }
@@ -670,11 +708,11 @@ Response
         {
           "friends": [
             {
-              "to": {
+              "user": {
                 "id": "Oscar",
                 "post": [
                   {
-                    "to": {
+                    "url": {
                       "id": "www.scala-lang.org"
                     }
                   }
@@ -682,11 +720,11 @@ Response
               }
             },
             {
-              "to": {
+              "user": {
                 "id": "Kermit",
                 "post": [
                   {
-                    "to": {
+                    "url": {
                       "id": "www.playframework.com"
                     }
                   }
@@ -694,11 +732,11 @@ Response
               }
             },
             {
-              "to": {
+              "user": {
                 "id": "Grover",
                 "post": [
                   {
-                    "to": {
+                    "url": {
                       "id": "hbase.apache.org/forum/#!forum/s2graph"
                     }
                   }


[2/2] incubator-s2graph git commit: [S2GRAPH-235] Fix typo errors in S2GraphQL MD

Posted by st...@apache.org.
[S2GRAPH-235] Fix typo errors in S2GraphQL MD

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

Pull Request:
  Closes #183

Author
  Hwansung Yu <ra...@apache.org>


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

Branch: refs/heads/master
Commit: d8cfea1e3f1c30a4444be6e56155f7cf3ba89d0c
Parents: bfc063f a2666e4
Author: DO YUNG YOON <st...@apache.org>
Authored: Tue Oct 30 18:53:09 2018 +0900
Committer: DO YUNG YOON <st...@apache.org>
Committed: Tue Oct 30 18:53:09 2018 +0900

----------------------------------------------------------------------
 .travis.yml         |   2 +-
 CHANGES             |   1 +
 s2graphql/README.md | 114 +++++++++++++++++++++++++++++++----------------
 3 files changed, 78 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/d8cfea1e/.travis.yml
----------------------------------------------------------------------
diff --cc .travis.yml
index 448bc64,448bc64..a50567e
--- a/.travis.yml
+++ b/.travis.yml
@@@ -16,7 -16,7 +16,7 @@@
  language: scala
  
  env:
--  - HBASE_VERSION=1.2.6.1
++  - HBASE_VERSION=1.4.8
  
  cache:
    directories:

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/d8cfea1e/CHANGES
----------------------------------------------------------------------
diff --cc CHANGES
index 018deb4,734f498..58e5033
--- a/CHANGES
+++ b/CHANGES
@@@ -85,7 -85,6 +85,8 @@@ Release Notes - S2Graph - Version 0.2.
      * [S2GRAPH-221] - Unify configurations for bulk and mutate in S2GraphSink.
      * [S2GRAPH-230] - ResourceManager onEvict cause segmentation fault with AnnoyModelFetcher 
      * [S2GRAPH-231] - Change the GraphQL type name to a valid string.
 +    * [S2GRAPH-232] - Elimination of inefficiency due to duplication in GraphQL schema generation.
++    * [S2GRAPH-235] - Fix typo errors in S2GraphQL MD.
  
  ** New Feature
      * [S2GRAPH-123] - Support different index on out/in direction.