[
https://issues.apache.org/jira/browse/TINKERPOP-1689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044347#comment-16044347
]
Daniel Kuppitz commented on TINKERPOP-1689:
-------------------------------------------
I suggest to add a new interface that will then be implemented by {{Vertex}},
{{Edge}}, {{VertexProperty}} and {{Property}}:
{noformat}
public interface TokenHolder {
Object id(); // Property throws exception; Vertex, Edge and
VertexProperty return their id
String label(); // VerteProperty and Property throw exception; Vertex and
Edge return their label
String key(); // Vertex and Edge throw exception; VertexProperty and
Property return their key
Object value(); // Vertex and Edge throw exception; VertexProperty and
Property return their value
}
{noformat}
Then the type signature for {{TokenTraversal}} should become {{TokenTraversal<S
extends TokenHolder, E>}} and likewise {{T}} would become {{T implements
Function<TokenHolder, Object>}}.
Thoughts?
> Make TokenTraversal work with properties
> ----------------------------------------
>
> Key: TINKERPOP-1689
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1689
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.2.4
> Reporter: Daniel Kuppitz
> Assignee: Marko A. Rodriguez
>
> {noformat}
> gremlin>
> g.V().outE().properties("weight").path().by("name").by().by(__.value())
> ==>[marko,e[9][1-created->3],0.4]
> ==>[marko,e[7][1-knows->2],0.5]
> ==>[marko,e[8][1-knows->4],1.0]
> ==>[josh,e[10][4-created->5],1.0]
> ==>[josh,e[11][4-created->3],0.4]
> ==>[peter,e[12][6-created->3],0.2]
> gremlin> g.V().outE().properties("weight").path().by("name").by().by(value)
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerProperty cannot be
> cast to org.apache.tinkerpop.gremlin.structure.Element
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> {noformat}
> Related ticket: https://issues.apache.org/jira/browse/TINKERPOP-1682
> [~okram] you can reassign the ticket to me, but we should discuss how we
> gonna solve this problem.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)