在打印边时,起点和终点都是自动生成的id,如何同时打印自定义起点和终点号呢? #3187
-
执行g.V().has('trmnl','trmnl_black_flag',1).outE('register').dedup().limit(2).to_list()的结果为: oid_type: STRING 为了解决这个问题,在graph = session.g(oid_type="string")中,加上了generate_eid=False,但上述执行语句报错,无法执行,所以没有解决上述问题。 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
GIE doesn't work
Try |
Beta Was this translation helpful? Give feedback.
-
您好,
加上.valueMap().后是,print(g.V().has('trmnl','trmnl_black_flag',1).outE('register').dedup().limit(10).valueMap().to_list())
执行结果如下:
[{'eid': [1152921504606847060]}, {'eid': [576460752303423561]}, {'eid': [1729382256910270544]}, {'eid': [7493989779944505386]}, {'eid': [5188146770730811456]}, {'eid': [6917529027641081896]}, {'eid': [64]}, {'eid': [1729382256910270558]}, {'eid': [1152921504606847011]}, {'eid': [2305843009213693997]}]
还是没有打印终端号,结果都是自动生成的id。请问有其他办法吗?
…------------------ 原始邮件 ------------------
发件人: "alibaba/GraphScope" ***@***.***>;
发送时间: 2023年9月6日(星期三) 下午3:23
***@***.***>;
***@***.******@***.***>;
主题: Re: [alibaba/GraphScope] 在打印边时,起点和终点都是自动生成的id,如何同时打印自定义起点和终点号呢? (Discussion #3187)
GIE doesn't work generate_eid=False.
如何同时显示起点的终端号,终点的注册号呢?
Try .valueMap().
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
感谢,那如果想打印3-4跳的中间路径,如何既显示起终点,又显示中间的业务号呢?我尝试了
interactive.execute("g.V().has('trmnl','trmnl_black_flag',1).as('start').both('3..4', 'register').with('PATH_OPT', 'ARBITRARY') \
.with('RESULT_OPT', 'ALL_V').as('allV').select('start','allV'))").one()
结果为:
[{'start': v[2305843009213693975], 'allV': [v[2305843009213693975], v[2886807361144487959], v[2305843009213693975], v[2886807361144487959]]}, {'start': v[1152921504606846998], 'allV': [v[1152921504606846998], v[4503599627370521], v[1152921504606846998], v[4503599627370521]]}]不显示业务号,是 自动生成的id ,加上 .by(valueMap())后:
interactive.execute("g.V().has('trmnl','trmnl_black_flag',1).as('start').both('3..4', 'register').with('PATH_OPT', 'ARBITRARY') .with('RESULT_OPT', 'ALL_V').as('allV').select('start','allV').by(valueMap())").one()
结果 'allV' 只有一个业务号,二跳和三跳的业务号消失了,只显示末端终点的业务号。如何把路径上 起始点、二跳点、三跳点、终点的完整路径以“业务号“显示出来呢?
…------------------ 原始邮件 ------------------
发件人: "alibaba/GraphScope" ***@***.***>;
发送时间: 2023年9月6日(星期三) 晚上6:15
***@***.***>;
***@***.******@***.***>;
主题: Re: [alibaba/GraphScope] 在打印边时,起点和终点都是自动生成的id,如何同时打印自定义起点和终点号呢? (Discussion #3187)
Hi, for the query:
g.V().has('trmnl','trmnl_black_flag',1).both('1..2', 'register')
You'll get the end vertex of the path by default. That's why you only get properties of the end vertex when you further query with valueMap().
If you want to get properties of start vertex and end vertex of the path, you can try the following query:
g.V().has('trmnl','trmnl_black_flag',1).as('start').both('1..2', 'register').dedup().endV().as('end').select('start','end').by(valueMap()).limit(10)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
那在建图的时候,点trmnl的id是否能不用自动生成的id,而是用终端号来当作点的id呢?终端号本身就是唯一的,没必要再自动生成id了。这样打印路径的时候,显示的id,就是终端号了。
我尝试过 令
graph = session.g(oid_type="string",generate_eid=False) # 加上generate_eid=False
node = Loader("./abc.csv",delimiter='\t', header_row=True,key='meid'),加上key='meid'
也没有用处。
…------------------ 原始邮件 ------------------
发件人: "alibaba/GraphScope" ***@***.***>;
发送时间: 2023年9月7日(星期四) 中午12:17
***@***.***>;
***@***.******@***.***>;
主题: Re: [alibaba/GraphScope] 在打印边时,起点和终点都是自动生成的id,如何同时打印自定义起点和终点号呢? (Discussion #3187)
Hi, we have not supported a step that can project the properties of every vertex on the path yet.
However, you can try to obtain the properties in another query, i.e., find the path first, and then for each vertex with gid (the automatically generate vertex id), you can query g.V(gid).valueMap() flexibly.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hi, for the query:
You'll get the end vertex of the path by default. That's why you only get properties of the end vertex when you further query with
valueMap()
.If you want to get properties of start vertex and end vertex of the path, you can try the following query: