You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "stephen mallette (JIRA)" <ji...@apache.org> on 2018/11/03 10:04:00 UTC
[jira] [Closed] (TINKERPOP-2087) It is not possible to add more
then one edge property at the same time
[ https://issues.apache.org/jira/browse/TINKERPOP-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stephen mallette closed TINKERPOP-2087.
---------------------------------------
Resolution: Not A Bug
I wouldn't consider this bug as what you describe as a "workaround" is the API - i.e. the proper Gremlin syntax for adding multiple properties to an edge. The request for an improvement in the error message is already captured in TINKERPOP-800.
> It is not possible to add more then one edge property at the same time
> ----------------------------------------------------------------------
>
> Key: TINKERPOP-2087
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2087
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.3.4
> Environment: Java with maven
> Reporter: Fabian Gärtner
> Priority: Minor
>
> In java doing a property step on a edge with more then one key-value pair creates an error
> Minimal error example:
> {code:java}
> public static void main( String[] args ) throws Exception {
> TinkerGraph g = TinkerGraph.open();
> g.traversal().addV("v").as("a")
> .addV("v").addE("e").to("a")
> .property("key","val", "key2","val2")
> .iterate();
> }
> {code}
> The resulting error is
> {code:java}
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast to org.apache.tinkerpop.gremlin.structure.Vertex
> {code}
>
> In org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddPropertyStep in line 122 and 124 the element where the property should be added is casted in a Vertex.
> It looks like that the reason for this ist that the functionality to add more than one property in one step is given in the interface org.apache.tinkerpop.gremlin.structure.Vertex. It would be more consistent if this functionality is given in the interface org.apache.tinkerpop.gremlin.structure.Element.
>
> A simple workaround is to do two property steps:
> {code:java}
> public static void main( String[] args ) throws Exception {
> TinkerGraph g = TinkerGraph.open();
> g.traversal().addV("v").as("a")
> .addV("v").addE("e").to("a")
> .property("key","val")
> .property("key2","val2")
> .iterate();
> }{code}
> However, at least a more meaningful error message is needed to prevent confusion.
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)