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/24 18:15:55 UTC

Blazegraph / TP3 integration

I'm working our Blazegraph / TP3 integration and I have a few questions
about how to deal with multi-properties / multi-valued properties.
Blazegraph is an RDF database at its core, so everything gets converted
into triples.  Blazegraph also supports the RDR specification, which allows
triples to be used inside of other triples.

In our TP2 implementation, I simplified things by only supporting unordered
sets for multi-valued properties.  This is because triples are distinct and
kept in natural index order, not a user-specified order.  So when someone
sets a property like so:

element.prop = ["c", "a", "b", "a"]

They get the following RDF data:

<element> <prop> "a" .
<element> <prop> "b" .
<element> <prop> "c" .

And then when they retrieve the element they get:

element.prop = ["a", "b", "c"]

I was planning on supporting ordered lists in TP3 by using RDR:

element.prop = ["c", "a", "b", "a"]

=>

<element> <prop> "a" .
<element> <prop> "b" .
<element> <prop> "c" .
<< <element> <prop> "a" >> <order> 1 .
<< <element> <prop> "a" >> <order> 3 .
<< <element> <prop> "b" >> <order> 2 .
<< <element> <prop> "c" >> <order> 0 .

All fine and good.  My question is how to deal with so-called
"multi-properties".

1. Can you have multi-valued multi-properties?

element.prop = ["a", "b", "c"],  element.prop = ["b", "c", "d"]

2. Can you have single-valued multi-properties with the same value?

element.prop = "a", element.prop = "a"

2a. If so, can you attach different property-properties (provenance) to
each instance?

3. Can you have multi-properties with different cardinalities - e.g. one
single-valued, one list, and one set?

element.prop = set["a", "b", "c"],  element.prop = list["b", "c", "d",
"b"], element.prop = "a"

Thanks,
Mike

Re: Blazegraph / TP3 integration

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

> I'm working our Blazegraph / TP3 integration and I have a few questions
> about how to deal with multi-properties / multi-valued properties.
> Blazegraph is an RDF database at its core, so everything gets converted
> into triples.  Blazegraph also supports the RDR specification, which allows
> triples to be used inside of other triples.

K. Just read your post on RDR.
	https://wiki.blazegraph.com/wiki/index.php/Reification_Done_Right

First thing. Note that you do NOT have to support multi-properties nor meta-properties if you don't want to. However, its strongly recommended.
	http://tinkerpop.incubator.apache.org/docs/3.0.1-incubating/#_features

Okay, now moving on…

> 1. Can you have multi-valued multi-properties?
> 
> element.prop = ["a", "b", "c"],  element.prop = ["b", "c", "d"]

This depends on your Features. See VertexPropertes.Features.UniformListValues and VertexProperties.Features.MixedListValues.

Thus, whatever you do support, be sure to make it explicit in your Features.

> 2. Can you have single-valued multi-properties with the same value?
> 
> element.prop = "a", element.prop = "a"

Yes. However, I just realized (and talking with Stephen) that TinkerGraph doesn't support it and its not an explicit Feature -- thus, we don't test for it.

gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> v = graph.addVertex()
==>v[0]
gremlin> v.property("name","marko")
==>vp[name->marko]
gremlin> v.property("name","marko")
==>vp[name->marko]
gremlin> v.properties("name")
==>vp[name->marko]

I just added this ticket:
	https://issues.apache.org/jira/browse/TINKERPOP3-919

If you can support it, support it.

> 2a. If so, can you attach different property-properties (provenance) to
> each instance?

Yes.

> 3. Can you have multi-properties with different cardinalities - e.g. one
> single-valued, one list, and one set?
> 
> element.prop = set["a", "b", "c"],  element.prop = list["b", "c", "d",
> "b"], element.prop = "a"

No. The cardinality is determined by the Feature.getCardinatlity(String key). Thus, its per key.

I'm not sure we have a test suite case for this either. I just made this ticket:
	https://issues.apache.org/jira/browse/TINKERPOP3-920

Those are really good questions with two potential holes in our test suite identified.

Thank you for your comments and good luck with BlazeGraph/TP3,
Marko.

http://markorodriguez.com