Modify Column.keys in projection query

17 views
Skip to first unread message

Александр Петраки

unread,
Oct 15, 2020, 7:26:36 AM10/15/20
to JanusGraph users

Hello Everyone,
I am having a simple projection query which ends with
project('time','capacity).by(keys).by(values)
Query itself works fine, but I need to make a substring of each key. Is there a way to do this?

HadoopMarc

unread,
Oct 18, 2020, 6:21:02 AM10/18/20
to JanusGraph users
Hi Alexander,
See:

Best wishes,    Marc

Op donderdag 15 oktober 2020 om 13:26:36 UTC+2 schreef Александр Петраки:

Александр Петраки

unread,
Oct 19, 2020, 12:42:41 AM10/19/20
to janusgra...@googlegroups.com
But map() can not be applied to Column.keys structure

вс, 18 окт. 2020 г. в 13:21, HadoopMarc <bi...@xs4all.nl>:
--
You received this message because you are subscribed to a topic in the Google Groups "JanusGraph users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/janusgraph-users/G1WUbfpPyHg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to janusgraph-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/7e06d78d-faca-4e94-b2bf-f1b3cf5bed70n%40googlegroups.com.

HadoopMarc

unread,
Oct 19, 2020, 11:58:16 AM10/19/20
to JanusGraph users
Hi Alexander,

Readers of this list can help you better if you provide the query you tried on one of the example graphs or a sample graph you provide yourself.

The Column.keys and Column.values are not useful for the project() step. If the properties of your vertices are called time and capacity you can do something like (not tested):

project('time','capacity).by(values('time).map{it.get().substring(1,4)}).by(values('capacity).map{it.get().substring(1,4)})

The time and capacity args in the project step are used as keys in the resulting Map.

Best wishes,   Marc

Op maandag 19 oktober 2020 om 06:42:41 UTC+2 schreef Александр Петраки:
Reply all
Reply to author
Forward
0 new messages