[ 
https://issues.apache.org/jira/browse/TINKERPOP-2713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498739#comment-17498739
 ] 

Saikiran Boga commented on TINKERPOP-2713:
------------------------------------------

Like the idea in general. Couple of general questions:
 # Does it work similar to EdgeOtherVertex step - look for last element in the 
path and return it?
 # If yes to 1, what does it return if we do not find an element in the path 
(probably falls under external service calls) - do we search the property and 
return the element? This could be the semantics in general even when we have an 
element in the path I think. This could be relying on property id for finding 
the corresponding element it is attached to?

> Create an element() step that maps a Property to its Element.
> -------------------------------------------------------------
>
>                 Key: TINKERPOP-2713
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2713
>             Project: TinkerPop
>          Issue Type: New Feature
>          Components: language
>    Affects Versions: 3.6.0
>            Reporter: Mike Personick
>            Priority: Minor
>
> There is currently no way to traverse from a Property to its Element in 
> Gremlin. Add an element() operator (and ElementStep) that will accomplish 
> this.
>  
> {code:java}
> // Vertex -> VertexProperty -> Vertex
> g.V(1).properties().limit(1).element() => v[1]
> // Edge -> Property -> Edge
> g.E(2).properties().limit(1).element() => e[2]
> // Vertex -> VertexProperty -> Property -> VertexProperty -> Vertex
> g.V(1).properties().properties().limit(1).element().element() => v[1] {code}
>  
>  
> Example use case for this would be service calls that return properties (e.g. 
> full-text search), which could then be traversed to their owning element.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to