문제

How can I disable automatic type creation in Titan?

I modified the GraphOfTheGodsFactory example to this effect, by inserting the line

config.setProperty(GraphDatabaseConfiguration.AUTO_TYPE_KEY, "none");

but this does not seem to have the desired effect, as per the rexster console below:

rexster[groovy]> saturn = g.V("name", "saturn").next()
==>v[4]
rexster[groovy]> saturn.setProperty("someNewProp", "xyz")
==>null
rexster[groovy]> saturn.map
==>{someNewProp=xyz, name=saturn, age=10000, type=titan}
rexster[groovy]> saturn.addEdge("someNewLabel", g.V("name", "cerberus").next())
==>e[1G51-4-7I][4-someNewLabel->44]
rexster[groovy]> g.config.defaultTypeMaker
==>com.thinkaurelius.titan.graphdb.blueprints.BlueprintsDefaultTypeMaker@5b97e4fa

I am using titan-server-0.4.2.

도움이 되었습니까?

해결책

I'm not clear on how you are creating your graph instance with the GraphOfTheGodsFactory and how you are connecting the graph in Rexster, but assuming you ran your modified GraphOfTheGodsFactory, created the graph and then connected it to Rexster to that graph, you would also need to set auto-type to none in rexster.xml for that setting to be respected by Rexster.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top