You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@s2graph.apache.org by 정희원 <hw...@nemustech.com> on 2018/10/15 00:48:41 UTC

s2graphql's groupBy(aggregation and scoring)

Hi.
​
I am currently reviewing the usability of s2graph and testing its configuration.
So I have asked some questions ahead.
​
There seems to be a difference with the Rest API during GraphQL review.
So I will contact you further.
​

How do I use groupBy in GraphQL? (aggregation and scoring)
For reference, I tried to implement the following post recommendation query in Rest API.
{
   "srcVertices": [{"serviceName": "blog","columnName": "user_key","id": "user-a"
   }],
   "groupBy": ["to"],
   "scoreThreshold": 3,
   "steps": [{
       "step": [{ "label": "post_like", "direction": "out", "offset": 0, "limit": 20}]
   }, {
       "nextStepThreshold": 2,
       "step": [{ "label": "post_like", "direction": "in", "offset": 0, "limit": 50, "where": "(to!='user-a')", "duplicate": "sum"}]
   }, {
       "step": [{
           "label": "post_like","direction": "out","offset": 0,"limit": 20,"duplicate": "sum"}]
   }],
   "filterOut": {
       "srcVertices": [{"serviceName": "blog","columnName": "user_key","id": "user-a"}],
       "steps": [{
           "step": [{"label": "post_like", "direction": "out","offset": 0,"limit": 100}]
       }]
   }
}
​

If the above query does not work in GraphQL, I would use the Rest API.
You said that you are focusing on GraphQL, and will not you develop the Rest API anymore?
​

Is there any performance difference between GraphQL and Rest API?


​
Regards.
Heewon Jung
​
------------------------------------------------------------
​
현재 s2graph의 사용성을 검토 및 구성을 테스트해보고 있습니다. 
​
그래서 앞서 몇가지 문의 드린 적이 있습니다.
​
GraphQL 검토 중에 Rest API와 차이가 있는 것 같습니다.
​
그래서 추가로 문의 드립니다.
​

GraphQL 에서 groupBy는 어떻게 사용하나요? (aggregation and scoring)
​
참고로 Rest API 에서 아래와 같은 post 추천 query를 구현 해보려고 했습니다.
{
   "srcVertices": [{"serviceName": "blog","columnName": "user_key","id": "user-a"
   }],
   "groupBy": ["to"],
   "scoreThreshold": 3,
   "steps": [{
       "step": [{ "label": "post_like", "direction": "out", "offset": 0, "limit": 20}]
   }, {
       "nextStepThreshold": 2,
       "step": [{ "label": "post_like", "direction": "in", "offset": 0, "limit": 50, "where": "(to!='user-a')", "duplicate": "sum"}]
   }, {
       "step": [{
           "label": "post_like","direction": "out","offset": 0,"limit": 20,"duplicate": "sum"}]
   }],
   "filterOut": {
       "srcVertices": [{"serviceName": "blog","columnName": "user_key","id": "user-a"}],
       "steps": [{
           "step": [{"label": "like", "direction": "out","offset": 0,"limit": 100}]
       }]
   }
}
​

위와 같은 query가 GraphQL에서 동작하지 않는다면 Rest API를 사용할까 합니다.
GraphQL에 초첨을 맞추고 있다고 하셨는데 Rest API는 더 이상 발전 시키지 않으실 예정인가요?
​

GraphQL와 Rest API의 성능 차이가 있나요?


​
감사합니다.
​
​
이 메일은 나눔글꼴로 작성되었습니다. 설치하기

정희원 JUNG HeeWon
H3

06212 서울시 강남구 선릉로85길 8, 2층 (역삼동, 유화빌딩)
Mobile 010-8518-0657
Email hwjung@nemustech.com


Re: s2graphql's groupBy(aggregation and scoring)

Posted by Hwansung Yu <ra...@apache.org>.
I send you a reply to correct typo of daewon's answer.

1. *GroupBy* is not yet implemented in the implemented GraphQL function. I
will link the message and create an JIRA issue.


Thank you for your interest.

On Mon, Oct 15, 2018 at 12:26 PM daewon <da...@apache.org> wrote:

> Thank you for your question.
>
> 1. GraphBy is not yet implemented in the implemented GraphQL function. I
> will link the message and create an JIRA issue.
>
> 2. GraphQL does not yet replace the existing Rest API 100%. That's why
> existing Rest API will be maintained.
>
> 3. The GraphQL server and the existing API both use the S2Core system
> internally. Performance differences will vary depending on the HTTP
> interface.
>
> Rest API: Play! Framework or Raw Netty
> GrapHQL: Akka HTTP
>
>
>
> 2018년 10월 15일 (월) 오전 9:48, 정희원 <hw...@nemustech.com>님이 작성:
>
>> Hi.
>> ​
>> I am currently reviewing the usability of s2graph and testing its
>> configuration.
>> So I have asked some questions ahead.
>> ​
>> There seems to be a difference with the Rest API during GraphQL review.
>> So I will contact you further.
>> ​
>>
>>    1. How do I use groupBy in GraphQL? (aggregation and scoring)
>>    For reference, I tried to implement the following post recommendation
>>    query in Rest API.
>>    {
>>       "srcVertices": [{"serviceName": "blog","columnName":
>>    "user_key","id": "user-a"
>>       }],
>>       "groupBy": ["to"],
>>       "scoreThreshold": 3,
>>       "steps": [{
>>           "step": [{ "label": "post_like", "direction": "out", "offset":
>>    0, "limit": 20}]
>>       }, {
>>           "nextStepThreshold": 2,
>>           "step": [{ "label": "post_like", "direction": "in", "offset":
>>    0, "limit": 50, "where": "(to!='user-a')", "duplicate": "sum"}]
>>       }, {
>>           "step": [{
>>               "label": "post_like","direction": "out","offset":
>>    0,"limit": 20,"duplicate": "sum"}]
>>       }],
>>       "filterOut": {
>>           "srcVertices": [{"serviceName": "blog","columnName":
>>    "user_key","id": "user-a"}],
>>           "steps": [{
>>               "step": [{"label": "post_like", "direction":
>>    "out","offset": 0,"limit": 100}]
>>           }]
>>       }
>>    }
>>    ​
>>    2. If the above query does not work in GraphQL, I would use the Rest
>>    API.
>>    You said that you are focusing on GraphQL, and will not you develop
>>    the Rest API anymore?
>>    ​
>>    3. Is there any performance difference between GraphQL and Rest API?
>>
>> ​
>> Regards.
>> Heewon Jung
>> ​
>> ------------------------------------------------------------
>> ​
>> 현재 s2graph의 사용성을 검토 및 구성을 테스트해보고 있습니다.
>> ​
>> 그래서 앞서 몇가지 문의 드린 적이 있습니다.
>> ​
>> GraphQL 검토 중에 Rest API와 차이가 있는 것 같습니다.
>> ​
>> 그래서 추가로 문의 드립니다.
>> ​
>>
>>    1. GraphQL 에서 groupBy는 어떻게 사용하나요? (aggregation and scoring)
>>    ​
>>    참고로 Rest API 에서 아래와 같은 post 추천 query를 구현 해보려고 했습니다.
>>    {
>>       "srcVertices": [{"serviceName": "blog","columnName":
>>    "user_key","id": "user-a"
>>       }],
>>       "groupBy": ["to"],
>>       "scoreThreshold": 3,
>>       "steps": [{
>>           "step": [{ "label": "post_like", "direction": "out", "offset":
>>    0, "limit": 20}]
>>       }, {
>>           "nextStepThreshold": 2,
>>           "step": [{ "label": "post_like", "direction": "in", "offset":
>>    0, "limit": 50, "where": "(to!='user-a')", "duplicate": "sum"}]
>>       }, {
>>           "step": [{
>>               "label": "post_like","direction": "out","offset":
>>    0,"limit": 20,"duplicate": "sum"}]
>>       }],
>>       "filterOut": {
>>           "srcVertices": [{"serviceName": "blog","columnName":
>>    "user_key","id": "user-a"}],
>>           "steps": [{
>>               "step": [{"label": "like", "direction": "out","offset":
>>    0,"limit": 100}]
>>           }]
>>       }
>>    }
>>    ​
>>    2. 위와 같은 query가 GraphQL에서 동작하지 않는다면 Rest API를 사용할까 합니다.
>>    GraphQL에 초첨을 맞추고 있다고 하셨는데 Rest API는 더 이상 발전 시키지 않으실 예정인가요?
>>    ​
>>    3. GraphQL와 Rest API의 성능 차이가 있나요?
>>
>> ​
>> 감사합니다.
>> ​
>> ​
>> 이 메일은 나눔글꼴로 작성되었습니다. 설치하기 <http://hangeul.naver.com>
>>
>> *정희원* JUNG HeeWon
>> H3
>>
>> 06212 서울시 강남구 선릉로85길 8, 2층 (역삼동, 유화빌딩)
>> *Mobile *010-8518-0657
>> *Email *hwjung@nemustech.com
>>
>> <#m_4698374228686032930_m_6002446094283080110_>
>>
>

Re: s2graphql's groupBy(aggregation and scoring)

Posted by daewon <da...@apache.org>.
Thank you for your question.

1. GraphBy is not yet implemented in the implemented GraphQL function. I
will link the message and create an JIRA issue.

2. GraphQL does not yet replace the existing Rest API 100%. That's why
existing Rest API will be maintained.

3. The GraphQL server and the existing API both use the S2Core system
internally. Performance differences will vary depending on the HTTP
interface.

Rest API: Play! Framework or Raw Netty
GrapHQL: Akka HTTP



2018년 10월 15일 (월) 오전 9:48, 정희원 <hw...@nemustech.com>님이 작성:

> Hi.
> ​
> I am currently reviewing the usability of s2graph and testing its
> configuration.
> So I have asked some questions ahead.
> ​
> There seems to be a difference with the Rest API during GraphQL review.
> So I will contact you further.
> ​
>
>    1. How do I use groupBy in GraphQL? (aggregation and scoring)
>    For reference, I tried to implement the following post recommendation
>    query in Rest API.
>    {
>       "srcVertices": [{"serviceName": "blog","columnName":
>    "user_key","id": "user-a"
>       }],
>       "groupBy": ["to"],
>       "scoreThreshold": 3,
>       "steps": [{
>           "step": [{ "label": "post_like", "direction": "out", "offset":
>    0, "limit": 20}]
>       }, {
>           "nextStepThreshold": 2,
>           "step": [{ "label": "post_like", "direction": "in", "offset":
>    0, "limit": 50, "where": "(to!='user-a')", "duplicate": "sum"}]
>       }, {
>           "step": [{
>               "label": "post_like","direction": "out","offset":
>    0,"limit": 20,"duplicate": "sum"}]
>       }],
>       "filterOut": {
>           "srcVertices": [{"serviceName": "blog","columnName":
>    "user_key","id": "user-a"}],
>           "steps": [{
>               "step": [{"label": "post_like", "direction":
>    "out","offset": 0,"limit": 100}]
>           }]
>       }
>    }
>    ​
>    2. If the above query does not work in GraphQL, I would use the Rest
>    API.
>    You said that you are focusing on GraphQL, and will not you develop
>    the Rest API anymore?
>    ​
>    3. Is there any performance difference between GraphQL and Rest API?
>
> ​
> Regards.
> Heewon Jung
> ​
> ------------------------------------------------------------
> ​
> 현재 s2graph의 사용성을 검토 및 구성을 테스트해보고 있습니다.
> ​
> 그래서 앞서 몇가지 문의 드린 적이 있습니다.
> ​
> GraphQL 검토 중에 Rest API와 차이가 있는 것 같습니다.
> ​
> 그래서 추가로 문의 드립니다.
> ​
>
>    1. GraphQL 에서 groupBy는 어떻게 사용하나요? (aggregation and scoring)
>    ​
>    참고로 Rest API 에서 아래와 같은 post 추천 query를 구현 해보려고 했습니다.
>    {
>       "srcVertices": [{"serviceName": "blog","columnName":
>    "user_key","id": "user-a"
>       }],
>       "groupBy": ["to"],
>       "scoreThreshold": 3,
>       "steps": [{
>           "step": [{ "label": "post_like", "direction": "out", "offset":
>    0, "limit": 20}]
>       }, {
>           "nextStepThreshold": 2,
>           "step": [{ "label": "post_like", "direction": "in", "offset":
>    0, "limit": 50, "where": "(to!='user-a')", "duplicate": "sum"}]
>       }, {
>           "step": [{
>               "label": "post_like","direction": "out","offset":
>    0,"limit": 20,"duplicate": "sum"}]
>       }],
>       "filterOut": {
>           "srcVertices": [{"serviceName": "blog","columnName":
>    "user_key","id": "user-a"}],
>           "steps": [{
>               "step": [{"label": "like", "direction": "out","offset":
>    0,"limit": 100}]
>           }]
>       }
>    }
>    ​
>    2. 위와 같은 query가 GraphQL에서 동작하지 않는다면 Rest API를 사용할까 합니다.
>    GraphQL에 초첨을 맞추고 있다고 하셨는데 Rest API는 더 이상 발전 시키지 않으실 예정인가요?
>    ​
>    3. GraphQL와 Rest API의 성능 차이가 있나요?
>
> ​
> 감사합니다.
> ​
> ​
> 이 메일은 나눔글꼴로 작성되었습니다. 설치하기 <http://hangeul.naver.com>
>
> *정희원* JUNG HeeWon
> H3
>
> 06212 서울시 강남구 선릉로85길 8, 2층 (역삼동, 유화빌딩)
> *Mobile *010-8518-0657
> *Email *hwjung@nemustech.com
>
> <#m_6002446094283080110_>
>