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

ASF GitHub Bot commented on TINKERPOP-1036:
-------------------------------------------

Github user laxatives commented on the pull request:

    
https://github.com/apache/incubator-tinkerpop/pull/175#issuecomment-164090219
  
    Yes, this failed for both GraphSON and Gryo (but NOT GraphML) in master:
    
    ```Tests run: 796, Failures: 2, Errors: 0, Skipped: 214, Time elapsed: 
8.361 sec <<< FAILURE! - in 
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraphStructureStandardTest
    
shouldReadWriteSelfLoopingEdges(org.apache.tinkerpop.gremlin.structure.io.IoTest$GraphSONTest)
  Time elapsed: 0.01 sec  <<< FAILURE!
    java.lang.AssertionError: expected:<2> but was:<1>
            at org.junit.Assert.fail(Assert.java:88)
            at org.junit.Assert.failNotEquals(Assert.java:834)
            at org.junit.Assert.assertEquals(Assert.java:645)
            at org.junit.Assert.assertEquals(Assert.java:631)
            at 
org.apache.tinkerpop.gremlin.structure.io.IoTest$GraphSONTest.shouldReadWriteSelfLoopingEdges(IoTest.java:457)
    
    
shouldReadWriteSelfLoopingEdges(org.apache.tinkerpop.gremlin.structure.io.IoTest$GryoTest)
  Time elapsed: 0.005 sec  <<< FAILURE!
    java.lang.AssertionError: expected:<2> but was:<1>
            at org.junit.Assert.fail(Assert.java:88)
            at org.junit.Assert.failNotEquals(Assert.java:834)
            at org.junit.Assert.assertEquals(Assert.java:645)
            at org.junit.Assert.assertEquals(Assert.java:631)
            at 
org.apache.tinkerpop.gremlin.structure.io.IoTest$GryoTest.shouldReadWriteSelfLoopingEdges(IoTest.java:308)
    ```
    
    If GraphSONReader assumes that for every edge E, 
E.outV().edges().contains(E), it seems reasonable that that assumption could 
have propagated to other places. Maybe its better to include self edges in both 
edges(OUT) and edges(IN)? This would also ensure that every graph G has 
G.V().edgesOut().count() + G.V().edgesIn().count() == 2 * G.edges().count(), 
which is clearly not the case now.


> Support self-looping edges in IO
> --------------------------------
>
>                 Key: TINKERPOP-1036
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1036
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: io
>    Affects Versions: 3.1.0-incubating
>            Reporter: stephen mallette
>            Assignee: stephen mallette
>             Fix For: 3.1.1-incubating
>
>
> Seems like GraphSON is having trouble with self-loops.  Not sure about other 
> IO at this time.
> {code}
> gremlin> a = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> v1 = a.addVertex()
> ==>v[0]
> gremlin> v2 = a.addVertex()
> ==>v[1]
> gremlin> control = v1.addEdge("CONTROL", v2)
> ==>e[2][0-CONTROL->1]
> gremlin> selfLoop = v1.addEdge("SELF-LOOP", v1)
> ==>e[3][0-SELF-LOOP->0]
> gremlin> a.io(IoCore.graphson()).writeGraph("test.gson")
> ==>null
> gremlin> b = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> b.io(IoCore.graphson()).readGraph("test.gson")
> ==>null
> gremlin> b.traversal().E()
> ==>e[2][0-CONTROL->1]
> {code}
> with graphson of:
> {code}
> {"id":0,"label":"vertex","inE":{"SELF-LOOP":[{"id":3,"outV":0}]},"outE":{"CONTROL":[{"id":2,"inV":1}]}}
> {"id":1,"label":"vertex","inE":{"CONTROL":[{"id":2,"outV":0}]}}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to