Titan和Cassandra在持久化图时截断长字符串

Titan和Cassandra在持久化图时截断长字符串,cassandra,titan,gremlin,Cassandra,Titan,Gremlin,创建图形时,例如: TitanGraph graph = TitanFactory.open("conf/titan-cassandra-es.properties"); Vertex v = graph.addVertex() v.property("Value", "very very very very very very very very vey long string"); graph.tx().commit(); 我发现titan在提交时将字符串截断为仅20个字符。我使用的是定

创建图形时,例如:

TitanGraph graph =  TitanFactory.open("conf/titan-cassandra-es.properties");
Vertex v = graph.addVertex()
v.property("Value", "very very very very very very very very vey long string");
graph.tx().commit();

我发现titan在提交时将字符串截断为仅20个字符。我使用的是定义的标准配置。是否缺少一些其他配置?

您看到的是,您得到的是
VertexProperty.toString()
的结果,而不是
VertexProperty.value()的值。下面是一个Gremlin控制台会话来演示其区别:

gremlin> graph = TitanFactory.build().set('storage.backend','cassandra').set('storage.cassandra.keyspace','fido').open()
==>standardtitangraph[cassandra:[127.0.0.1]]
gremlin> v = graph.addVertex() // create a vertex
==>v[4256]
gremlin> v.property('value', 'very very very very very very very very vey long string') // set a property
==>vp[value->very very very very ]
gremlin> v.property('value').getClass() // check the class on the property
==>class com.thinkaurelius.titan.graphdb.relations.StandardVertexProperty
gremlin> v.property('value').toString() // vertex property object as a string
==>vp[value->very very very very ]
gremlin> v.property('value').value().getClass() // check the class of the value of the vertex property
==>class java.lang.String
gremlin> v.property('value').value() // get the value of the vertex property (explicit syntax)
==>very very very very very very very very vey long string
gremlin> v.values('value').next().getClass() // check the class of the value of the vertex property
==>class java.lang.String
gremlin> v.values('value').next() // get the value of the vertex property (simpler syntax)
==>very very very very very very very very vey long string

TinkerPop3文档中有一些值得一读的讨论。

仅供参考,Titan 1.0中的提交语法是
graph.tx().commit()