thinkaurelius / titan

Distributed Graph Database
http://titandb.io
Apache License 2.0
5.24k stars 1.01k forks source link

BatchGraph can't work with SET properties #910

Closed smalyshev closed 9 years ago

smalyshev commented 9 years ago

Not sure if this is the right place or it should go to Tinkerpop, but the issue is as follows:

Tinkerpop's BatchGraph has a wrapper around Vertex/Edge which allows only certain operations to be used when in batch mode. The problem is that addProperty is not one of them, and this is the only way to set values for SET properties. Since SET properties is a Titan's unique feature, I post it here.

The solution might be for Titan to have a wrapper like (or around) BatchGraph that allows addProperty - and maybe other Titan-specific operations - or to make setProperty work on SET properties in certain context - such as accept an array of values for setProperty('setProp', ['a', 'b', 'c']) and make that array become the list of values. Since for BatchGraph common use case is loading vertices/edges from scratch, the only case which needs to be covered is the one where we set initial value of the property - in the case of SET the initial collection of values.

It may be hard to handle this from the Tinkerpop side since its Vertex interface does not have addProperty. But something seems to be necessary here since otherwise it is not possible to use BatchGraph with SET properties at all.

mbroecheler commented 9 years ago

Yes, this is a current limitation that will be addressed by Tinkerpop3.