You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@s2graph.apache.org by Weiqing Xu <xu...@gmail.com> on 2016/02/22 16:04:58 UTC

questions about Data Model

Hi All, 

I have some question about the DataModel when I read the GitBook. Since I am new to S2Graph so some question maybe my misunderstandings.

1.  Label can connection serviceColumns from two different services. We store the edge as (service, label, source vertex id, target vertex id). which service is here when label connecting different service ?

2. Since I am Scala is new for me . I am still reading  the code now. But I am really want to know does the S2Graph store all the data of a ServiceColumn to one HBase Table or different  data into different table. For example Vertex data in a table and edge data into anther table. 

Best Regards,
Weiqing Xu

Re: questions about Data Model

Posted by Weiqing Xu <xu...@gmail.com>.
Thank you for your response.

Best Regards,
Weiqing

Best Regards,
Weiqing

On Wed, Feb 24, 2016 at 9:09 AM, Hyunsung Jo <hy...@gmail.com> wrote:

> Hello Weiqing Xu,
>
> Welcome to S2Graph!
> Thank you for your interest in the project.
>
> 1.  Label can connection serviceColumns from two different services. We
> store the edge as (service, label, source vertex id, target vertex id).
> which service is here when label connecting different service ?
> =>
> You can specify preferred service name when creating the label. The default
> is to use target service.
> For details, please refer to
> https://steamshon.gitbooks.io/s2graph-book/content/create_a_label.html
>
>
> 2. Since I am Scala is new for me . I am still reading  the code now. But I
> am really want to know does the S2Graph store all the data of a
> ServiceColumn to one HBase Table or different  data into different table.
> For example Vertex data in a table and edge data into anther table.
> =>
> - Service columns (or vertices) are stored in the table that belongs to its
> service which is given at service creation:
>
> curl -XPOST localhost:9000/graphs/createService -H 'Content-Type:
> Application/json' -d '
> {"serviceName": "KakaoFavorites", "compressionAlgorithm" : "gz",
> "hTableName": "KakaoFavorites-dev"}
> '
>
>
> - Labels are either stored in its service table or a separate table given
> as a parameter "hTableName" at creation:
>
> curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type:
> Application/json' -d '
> {
>  "label": "friends",
>  "srcServiceName": "KakaoFavorites",
>  "srcColumnName": "userName",
>  "srcColumnType": "string",
>  "tgtServiceName": "KakaoFavorites",
>  "tgtColumnName": "userName",
>  "tgtColumnType": "string",
>  "isDirected": "false",
>  "indices": [],
>  "props": [],
>  "hTableName": "someTableName"
> }
> '
>
> Hope this helps.
>
> Regards,
> Jo
>
>
>
>
>
>
> On Tue, Feb 23, 2016 at 12:11 AM Weiqing Xu <xu...@gmail.com>
> wrote:
>
> > Hi All,
> >
> > I have some question about the DataModel when I read the GitBook. Since I
> > am new to S2Graph so some question maybe my misunderstandings.
> >
> > 1.  Label can connection serviceColumns from two different services. We
> > store the edge as (service, label, source vertex id, target vertex id).
> > which service is here when label connecting different service ?
> >
> > 2. Since I am Scala is new for me . I am still reading  the code now. But
> > I am really want to know does the S2Graph store all the data of a
> > ServiceColumn to one HBase Table or different  data into different table.
> > For example Vertex data in a table and edge data into anther table.
> >
> > Best Regards,
> > Weiqing Xu
>

Re: questions about Data Model

Posted by Hyunsung Jo <hy...@gmail.com>.
Hello Weiqing Xu,

Welcome to S2Graph!
Thank you for your interest in the project.

1.  Label can connection serviceColumns from two different services. We
store the edge as (service, label, source vertex id, target vertex id).
which service is here when label connecting different service ?
=>
You can specify preferred service name when creating the label. The default
is to use target service.
For details, please refer to
https://steamshon.gitbooks.io/s2graph-book/content/create_a_label.html


2. Since I am Scala is new for me . I am still reading  the code now. But I
am really want to know does the S2Graph store all the data of a
ServiceColumn to one HBase Table or different  data into different table.
For example Vertex data in a table and edge data into anther table.
=>
- Service columns (or vertices) are stored in the table that belongs to its
service which is given at service creation:

curl -XPOST localhost:9000/graphs/createService -H 'Content-Type:
Application/json' -d '
{"serviceName": "KakaoFavorites", "compressionAlgorithm" : "gz",
"hTableName": "KakaoFavorites-dev"}
'


- Labels are either stored in its service table or a separate table given
as a parameter "hTableName" at creation:

curl -XPOST localhost:9000/graphs/createLabel -H 'Content-Type:
Application/json' -d '
{
 "label": "friends",
 "srcServiceName": "KakaoFavorites",
 "srcColumnName": "userName",
 "srcColumnType": "string",
 "tgtServiceName": "KakaoFavorites",
 "tgtColumnName": "userName",
 "tgtColumnType": "string",
 "isDirected": "false",
 "indices": [],
 "props": [],
 "hTableName": "someTableName"
}
'

Hope this helps.

Regards,
Jo






On Tue, Feb 23, 2016 at 12:11 AM Weiqing Xu <xu...@gmail.com> wrote:

> Hi All,
>
> I have some question about the DataModel when I read the GitBook. Since I
> am new to S2Graph so some question maybe my misunderstandings.
>
> 1.  Label can connection serviceColumns from two different services. We
> store the edge as (service, label, source vertex id, target vertex id).
> which service is here when label connecting different service ?
>
> 2. Since I am Scala is new for me . I am still reading  the code now. But
> I am really want to know does the S2Graph store all the data of a
> ServiceColumn to one HBase Table or different  data into different table.
> For example Vertex data in a table and edge data into anther table.
>
> Best Regards,
> Weiqing Xu