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

Can't yield source and dest vertex property with LOOKUP #1849

Closed
back-to-eat opened this issue Mar 2, 2020 · 6 comments
Closed

Can't yield source and dest vertex property with LOOKUP #1849

back-to-eat opened this issue Mar 2, 2020 · 6 comments
Assignees

Comments

@back-to-eat
Copy link

image
I want to return the certain edge's source and dest vertex as well as the edge property. But nebula keeps throw me an error. Am I using the wrong syntax? Or nebula doesn't support such function? Any idea?

@bright-starry-sky
Copy link
Contributor

Nebula graph dose not support edge's source | dest vertex property when lookup edge .

@bright-starry-sky
Copy link
Contributor

Could you provide a business scenario or requirement description? Let me evaluate the implementation.

@whitewum
Copy link
Contributor

whitewum commented Mar 3, 2020

E.g.,

MATCH (a)-[r:transfer_to]->(b)
WHERE  r > 100
RETURN a.name, b.name

Check the transfer_to money amount larger than 100, the related people's name or age. They need to be double-checked.

@Amber1990Zhang
Copy link
Contributor

Thanks for your issue. @back-to-eat
Interesting. I use Gremlin to perform what you want with this doc:

Find an edge labeled battled and the time is 2

# only return edge
gremlin> g.E().has('battled', 'time', 2)
==>e[23][6-battled->10]

# return the source and dest vertices properties
gremlin> g.E().has('battled', 'time', 2).bothV().valueMap()
==>[name:[hercules],type:[demigod],age:[30]]
==>[name:[hydra],type:[monster],age:[0]]

Or you can traverse from vertex, the following query have the same result:

# only return edge
gremlin> g.V().outE('battled').has('time', 2)
==>e[23][6-battled->10]

# return the source and dest vertices properties
gremlin> g.V().outE('battled').has('time', 2).bothV().valueMap()
==>[name:[hercules],type:[demigod],age:[30]]
==>[name:[hydra],type:[monster],age:[0]]

I don't know about business scenarios but maybe my example is what @back-to-eat want. Hope this can help you. @bright-starry-sky

@jude-zhu
Copy link
Contributor

relates to vesoft-inc/nebula-graph#632

@CPWstatic
Copy link
Contributor

We had support it by Match. And we also plan to improve it in Lookup, please track it with #2594

yixinglu added a commit to yixinglu/nebula that referenced this issue Jan 31, 2023
* enhancement/pattern-expression

* Resolve the conflicts

Co-authored-by: kyle.cao <kyle.cao@vesoft.com>
Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants