Open JoeyKu opened 6 years ago
you forgot to send the imports and key definition, I'm assume you're using this:
import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
import gremlin.scala._
import scala.collection.JavaConverters._
import org.apache.tinkerpop.gremlin.structure.io.IoCore
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion
import java.io.FileOutputStream
import java.io.FileInputStream
import java.io.InputStream
val KeyString = Key[String]("ip")
When you switch to graphML you see what's wrong:
g.io(IoCore.graphml).writeGraph("./graphml.xml")
leads to: Multiple properties exist for the provided key, use Vertex.properties(ip) at org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.multiplePropertiesExistForProvidedKey(Vertex.java:179)
Looks like there's a problem with multi-properties and graph serialisation in gremlin-core. I've just tried it with gremlin-groovy which has the same problem:
graph = TinkerGraph.open()
g = graph.traversal()
v = g.addV().property('name','marko').property('name','marko a. rodriguez').next()
g.V(v).properties('name').count() //2
graph.io(IoCore.graphml()).writeGraph("multiprop.xml")
// error: Multiple properties exist for the provided key, use Vertex.properties(name)
In other words: it's not a gremlin-scala issue. Please ask on https://groups.google.com/forum/#!forum/gremlin-users about this and/or open an issue in jira: https://issues.apache.org/jira/projects/TINKERPOP/issues
I just stumbled across this as well, and it seems like Tinkerpop won't support graphML export when List/Set cardinality is used.
Here is the source code: