Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GIE] 'ElementMap' operator support #2778

Closed
lidongze0629 opened this issue May 30, 2023 · 1 comment · Fixed by #2942
Closed

[GIE] 'ElementMap' operator support #2778

lidongze0629 opened this issue May 30, 2023 · 1 comment · Fixed by #2942
Assignees
Labels

Comments

@lidongze0629
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
From the issue: #2742, The result of valueMap operator doesn't include the properties info, which is necessary for graph visualization. The elementMap operator will be helpful for this.

https://tinkerpop.apache.org/docs/current/reference/#elementmap-step

@longbinlai longbinlai added the good first issue Good for newcomers label Jun 6, 2023
@lidongze0629 lidongze0629 self-assigned this Jun 6, 2023
sighingnow pushed a commit that referenced this issue Jun 28, 2023
## What do these changes do?

```gremlin
gremlin> g.V(1,2,4).elementMap()
==>{label=person, id=1, name=marko, id=1, age=29}
==>{label=person, id=2, name=vadas, id=2, age=27}
==>{label=person, id=4, name=josh, id=4, age=32}

gremlin> g.V(1,2,4).elementMap("name", "age")
==>{age=27, label=person, id=2, name=vadas}
==>{age=32, label=person, id=4, name=josh}
==>{age=29, label=person, id=1, name=marko}

gremlin> g.V().elementMap()
==>{label=person, id=2, name=vadas, id=2, age=27}
==>{label=software, id=72057594037927941, name=ripple, id=5, lang=java}
==>{label=person, id=1, name=marko, id=1, age=29}
==>{label=software, id=72057594037927939, name=lop, id=3, lang=java}
==>{label=person, id=4, name=josh, id=4, age=32}
==>{label=person, id=6, name=peter, id=6, age=35}
```

Compare to the official result, now **g.E().elementMap()** lack the
information of in(out)'s vertices

```
# our result
gremlin> g.E().elementMap()
==>{label=knows, id=0, start_id=0.5, end_id=0.5, weight=0.5}

# official result
gremlin> g.E().elementMap()
==>{label=knows, id=0, start_id=0.5, end_id=0.5, weight=0.5, IN=[label=person, id=0], OUT=[label=person, id=1]}

```

<!-- Please give a short brief about these changes. -->

## Related issue number

<!-- Are there any issues opened that will be resolved by merging this
change? -->

Fixes #2778

---------

Co-authored-by: shirly121 <yihe.zxl@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants