Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/905#discussion_r207705128 --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java --- @@ -212,26 +214,39 @@ private XMLStreamWriter configureWriter(final OutputStream outputStream) throws return writer; } else return utf8Writer; - } + } private void writeTypes(final Map<String, String> identifiedVertexKeyTypes, - final Map<String, String> identifiedEdgeKeyTypes, - final XMLStreamWriter writer) throws XMLStreamException { + final Map<String, String> identifiedEdgeKeyTypes, + final XMLStreamWriter writer) throws XMLStreamException { // <key id="weight" for="edge" attr.name="weight" attr.type="float"/> final Collection<String> vertexKeySet = getVertexKeysAndNormalizeIfRequired(identifiedVertexKeyTypes); + final Collection<String> edgeKeySet = getEdgeKeysAndNormalizeIfRequired(identifiedEdgeKeyTypes); + // in case vertex and edge may have the same attribute name, the key id in graphml have to be different + intersection = CollectionUtils.intersection(vertexKeySet, edgeKeySet); + // speeding-up later checks + if (intersection.isEmpty()) { --- End diff -- i like the suggestion @twilmes had for this here: https://github.com/apache/tinkerpop/pull/891#pullrequestreview-139083855 it sounds like a more fluent way to handle this logic.
---