You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by Mike Personick <mi...@systap.com> on 2015/10/28 00:48:30 UTC

Blazegraph / TP3

Marko,

>>  v.property(single,"name","marko")

But with multi-properties, would this not just mean add another single
value for name="marko"?  We just established earlier in the conversation
that you can have multiple single-valued properties, and that these
multi-properties can even be the same value.

Thanks,
Mike


Hi,

If you are replacing a property its:

v.property("name").remove()
v.property("name","marko")

Or, check this (and this is the general answer to your question):

v.property(single,"name","marko")

There is Cardinality.single, Cardinality.set, and Cardinality.list.

Check out Features.getCardinality(String) too.

Get it?,
Marko.

http://markorodriguez.com

Re: Blazegraph / TP3

Posted by Marko Rodriguez <ok...@gmail.com>.
Yes. That is allowed.

Again, see Features.

You can do Features.supportsList(); (I forget the exact method).

Take care,
Marko.

http://markorodriguez.com

On Oct 27, 2015, at 9:16 PM, Mike Personick <mi...@systap.com> wrote:

> Ok thanks Marko.  But just to be clear - you could have a key with list
> cardinality with multi-properties - that is to say, multiple lists, right?
> Like for example, if the <V> in Vertex.property was a List?  I assume this
> would be quite an unusual case and I'm not sure why anyone would want to do
> it, but it still needs to be supported?
> 
> Vertex v = ...
> v.property(Cardinality.list, "prop", Arrays.asList("a", "b", "c"));
> v.property(Cardinality.list, "prop", Arrays.asList("d", "e", "f"));
> 
> 
> 
> On Tue, Oct 27, 2015 at 6:20 PM, Marko Rodriguez <ok...@gmail.com>
> wrote:
> 
>> Hi Mike,
>> 
>> One more thing to add --- multi-properties are NOT lists. They are
>> multiple properties of the same key. If you want a key->list[1,2,3] that is
>> a value of list. That is also a Feature. I suspect you don't want that as
>> that is typically not what is desired. You want:
>> 
>> name->marko
>> name->marko2
>> name->marko3
>> 
>> That is a "list" of multiple properties not a single property with value
>> list :D
>> 
>> Get it?,
>> Marko.
>> 
>> http://markorodriguez.com
>> 
>> On Oct 27, 2015, at 6:11 PM, Marko Rodriguez <ok...@gmail.com> wrote:
>> 
>>> Hi,
>>> 
>>>>>> v.property(single,"name","marko")
>>>> 
>>>> But with multi-properties, would this not just mean add another single
>>>> value for name="marko"?  We just established earlier in the conversation
>>>> that you can have multiple single-valued properties, and that these
>>>> multi-properties can even be the same value.
>>> 
>>> If you want to replace "name", its single.
>>> If you want to add a new "name," its list.
>>> If you want to add a new "name" (repeats not allowed), its set.
>>> 
>>> Play with TinkerGraph and see:
>>> 
>>> gremlin> graph = TinkerGraph.open()
>>> ==>tinkergraph[vertices:0 edges:0]
>>> gremlin> v = graph.addVertex()
>>> ==>v[0]
>>> gremlin> v.property(single,'name','marko')
>>> ==>vp[name->marko]
>>> gremlin> v.properties()
>>> ==>vp[name->marko]
>>> gremlin> v.property(single,'name','marko2')
>>> ==>vp[name->marko2]
>>> gremlin> v.properties()
>>> ==>vp[name->marko2]
>>> gremlin> v.property(list,'name','marko')
>>> ==>vp[name->marko]
>>> gremlin> v.properties()
>>> ==>vp[name->marko2]
>>> ==>vp[name->marko]
>>> gremlin> v.property(list,'name','marko3')
>>> ==>vp[name->marko3]
>>> gremlin> v.properties()
>>> ==>vp[name->marko2]
>>> ==>vp[name->marko]
>>> ==>vp[name->marko3]
>>> gremlin> v.property(single,'name','marko4')
>>> ==>vp[name->marko4]
>>> gremlin> v.properties()
>>> ==>vp[name->marko4]
>>> gremlin> v.property(set,'name','marko5')
>>> ==>vp[name->marko5]
>>> gremlin> v.properties()
>>> ==>vp[name->marko4]
>>> ==>vp[name->marko5]
>>> gremlin> v.property(set,'name','marko5')
>>> ==>vp[name->marko5]
>>> gremlin> v.properties()
>>> ==>vp[name->marko4]
>>> ==>vp[name->marko5]
>>> gremlin>
>>> 
>>> HTH,
>>> Marko.
>>> 
>>> http://markorodriguez.com
>> 
>> 


Re: Blazegraph / TP3

Posted by Mike Personick <mi...@systap.com>.
Ok thanks Marko.  But just to be clear - you could have a key with list
cardinality with multi-properties - that is to say, multiple lists, right?
Like for example, if the <V> in Vertex.property was a List?  I assume this
would be quite an unusual case and I'm not sure why anyone would want to do
it, but it still needs to be supported?

Vertex v = ...
v.property(Cardinality.list, "prop", Arrays.asList("a", "b", "c"));
v.property(Cardinality.list, "prop", Arrays.asList("d", "e", "f"));



On Tue, Oct 27, 2015 at 6:20 PM, Marko Rodriguez <ok...@gmail.com>
wrote:

> Hi Mike,
>
> One more thing to add --- multi-properties are NOT lists. They are
> multiple properties of the same key. If you want a key->list[1,2,3] that is
> a value of list. That is also a Feature. I suspect you don't want that as
> that is typically not what is desired. You want:
>
> name->marko
> name->marko2
> name->marko3
>
> That is a "list" of multiple properties not a single property with value
> list :D
>
> Get it?,
> Marko.
>
> http://markorodriguez.com
>
> On Oct 27, 2015, at 6:11 PM, Marko Rodriguez <ok...@gmail.com> wrote:
>
> > Hi,
> >
> >>>> v.property(single,"name","marko")
> >>
> >> But with multi-properties, would this not just mean add another single
> >> value for name="marko"?  We just established earlier in the conversation
> >> that you can have multiple single-valued properties, and that these
> >> multi-properties can even be the same value.
> >
> > If you want to replace "name", its single.
> > If you want to add a new "name," its list.
> > If you want to add a new "name" (repeats not allowed), its set.
> >
> > Play with TinkerGraph and see:
> >
> > gremlin> graph = TinkerGraph.open()
> > ==>tinkergraph[vertices:0 edges:0]
> > gremlin> v = graph.addVertex()
> > ==>v[0]
> > gremlin> v.property(single,'name','marko')
> > ==>vp[name->marko]
> > gremlin> v.properties()
> > ==>vp[name->marko]
> > gremlin> v.property(single,'name','marko2')
> > ==>vp[name->marko2]
> > gremlin> v.properties()
> > ==>vp[name->marko2]
> > gremlin> v.property(list,'name','marko')
> > ==>vp[name->marko]
> > gremlin> v.properties()
> > ==>vp[name->marko2]
> > ==>vp[name->marko]
> > gremlin> v.property(list,'name','marko3')
> > ==>vp[name->marko3]
> > gremlin> v.properties()
> > ==>vp[name->marko2]
> > ==>vp[name->marko]
> > ==>vp[name->marko3]
> > gremlin> v.property(single,'name','marko4')
> > ==>vp[name->marko4]
> > gremlin> v.properties()
> > ==>vp[name->marko4]
> > gremlin> v.property(set,'name','marko5')
> > ==>vp[name->marko5]
> > gremlin> v.properties()
> > ==>vp[name->marko4]
> > ==>vp[name->marko5]
> > gremlin> v.property(set,'name','marko5')
> > ==>vp[name->marko5]
> > gremlin> v.properties()
> > ==>vp[name->marko4]
> > ==>vp[name->marko5]
> > gremlin>
> >
> > HTH,
> > Marko.
> >
> > http://markorodriguez.com
>
>

Re: Blazegraph / TP3

Posted by Marko Rodriguez <ok...@gmail.com>.
Hi Mike,

One more thing to add --- multi-properties are NOT lists. They are multiple properties of the same key. If you want a key->list[1,2,3] that is a value of list. That is also a Feature. I suspect you don't want that as that is typically not what is desired. You want:

name->marko
name->marko2
name->marko3

That is a "list" of multiple properties not a single property with value list :D

Get it?,
Marko.

http://markorodriguez.com

On Oct 27, 2015, at 6:11 PM, Marko Rodriguez <ok...@gmail.com> wrote:

> Hi,
> 
>>>> v.property(single,"name","marko")
>> 
>> But with multi-properties, would this not just mean add another single
>> value for name="marko"?  We just established earlier in the conversation
>> that you can have multiple single-valued properties, and that these
>> multi-properties can even be the same value.
> 
> If you want to replace "name", its single.
> If you want to add a new "name," its list.
> If you want to add a new "name" (repeats not allowed), its set.
> 
> Play with TinkerGraph and see:
> 
> gremlin> graph = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> v = graph.addVertex()
> ==>v[0]
> gremlin> v.property(single,'name','marko')
> ==>vp[name->marko]
> gremlin> v.properties()
> ==>vp[name->marko]
> gremlin> v.property(single,'name','marko2')
> ==>vp[name->marko2]
> gremlin> v.properties()
> ==>vp[name->marko2]
> gremlin> v.property(list,'name','marko')
> ==>vp[name->marko]
> gremlin> v.properties()
> ==>vp[name->marko2]
> ==>vp[name->marko]
> gremlin> v.property(list,'name','marko3')
> ==>vp[name->marko3]
> gremlin> v.properties()
> ==>vp[name->marko2]
> ==>vp[name->marko]
> ==>vp[name->marko3]
> gremlin> v.property(single,'name','marko4')
> ==>vp[name->marko4]
> gremlin> v.properties()
> ==>vp[name->marko4]
> gremlin> v.property(set,'name','marko5')
> ==>vp[name->marko5]
> gremlin> v.properties()
> ==>vp[name->marko4]
> ==>vp[name->marko5]
> gremlin> v.property(set,'name','marko5')
> ==>vp[name->marko5]
> gremlin> v.properties()
> ==>vp[name->marko4]
> ==>vp[name->marko5]
> gremlin>
> 
> HTH,
> Marko.
> 
> http://markorodriguez.com


Re: Blazegraph / TP3

Posted by Marko Rodriguez <ok...@gmail.com>.
Hi,

>>> v.property(single,"name","marko")
> 
> But with multi-properties, would this not just mean add another single
> value for name="marko"?  We just established earlier in the conversation
> that you can have multiple single-valued properties, and that these
> multi-properties can even be the same value.

If you want to replace "name", its single.
If you want to add a new "name," its list.
If you want to add a new "name" (repeats not allowed), its set.

Play with TinkerGraph and see:

gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> v = graph.addVertex()
==>v[0]
gremlin> v.property(single,'name','marko')
==>vp[name->marko]
gremlin> v.properties()
==>vp[name->marko]
gremlin> v.property(single,'name','marko2')
==>vp[name->marko2]
gremlin> v.properties()
==>vp[name->marko2]
gremlin> v.property(list,'name','marko')
==>vp[name->marko]
gremlin> v.properties()
==>vp[name->marko2]
==>vp[name->marko]
gremlin> v.property(list,'name','marko3')
==>vp[name->marko3]
gremlin> v.properties()
==>vp[name->marko2]
==>vp[name->marko]
==>vp[name->marko3]
gremlin> v.property(single,'name','marko4')
==>vp[name->marko4]
gremlin> v.properties()
==>vp[name->marko4]
gremlin> v.property(set,'name','marko5')
==>vp[name->marko5]
gremlin> v.properties()
==>vp[name->marko4]
==>vp[name->marko5]
gremlin> v.property(set,'name','marko5')
==>vp[name->marko5]
gremlin> v.properties()
==>vp[name->marko4]
==>vp[name->marko5]
gremlin>

HTH,
Marko.

http://markorodriguez.com