Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-919

Features needs to specify whether 2 vertex properties with same key/value is allowed.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.0.2-incubating
    • Fix Version/s: 3.2.4
    • Labels:
      None

      Description

      TinkerGraph does not support two vertex properties with the same key/value.

      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 noted we don't have this as a Feature and we should (w/ respective test cases).

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/tinkerpop/pull/463

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/463
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on the issue:

          https://github.com/apache/tinkerpop/pull/463

          VOTE: +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on the issue: https://github.com/apache/tinkerpop/pull/463 VOTE: +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on the issue:

          https://github.com/apache/tinkerpop/pull/463

          VOTE +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on the issue: https://github.com/apache/tinkerpop/pull/463 VOTE +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/463

          ok - renamed to use "duplicate" and rebased on tp32

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/463 ok - renamed to use "duplicate" and rebased on tp32
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/463

          i played with a lot of different words. "duplicate" was one. i don't mind changing it if you like that better.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/463 i played with a lot of different words. "duplicate" was one. i don't mind changing it if you like that better.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on the issue:

          https://github.com/apache/tinkerpop/pull/463

          I was a confused for a bit on the method name. Seems (and this is just me) that a better name would be:

          ```
          Features.supportsDuplicateMultiPropertyValues()
          ```

          To me this means same key, duplicate values. The problem with "identical" is that there is no such thing as identical as properties can have meta-properties and be different. Thus, its a key/value identity, not a key/value/properties/id identity.

          Dunno...whateves.

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on the issue: https://github.com/apache/tinkerpop/pull/463 I was a confused for a bit on the method name. Seems (and this is just me) that a better name would be: ``` Features.supportsDuplicateMultiPropertyValues() ``` To me this means same key, duplicate values. The problem with "identical" is that there is no such thing as identical as properties can have meta-properties and be different. Thus, its a key/value identity, not a key/value/properties/id identity. Dunno...whateves.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user spmallette opened a pull request:

          https://github.com/apache/tinkerpop/pull/463

          TINKERPOP-919 Added supportsIdenticalMultiProperties()

          https://issues.apache.org/jira/browse/TINKERPOP-919

          That feature allows a graph to specify whether or not it supports multi-properties that allow the same value to be supplied on the same key. Not sure why this wasn't implemented long ago. It was relatively straightforward to put in place. I did take a look at the test suite for existing tests that might have needed this feature included, but I didn't see any.

          `mvn clean install -DincludeNeo4j` is all good

          VOTE +1

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/apache/tinkerpop TINKERPOP-919

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/tinkerpop/pull/463.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #463


          commit ead13106981bc019be25b66e0e432741c3646a2f
          Author: Stephen Mallette <spmva@genoprime.com>
          Date: 2016-10-25T17:50:48Z

          TINKERPOP-919 Added supportsIdenticalMultiProperties()

          That feature allows a graph to specify whether or not it supports multi-properties that allow the same value to be supplied on the same key.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/463 TINKERPOP-919 Added supportsIdenticalMultiProperties() https://issues.apache.org/jira/browse/TINKERPOP-919 That feature allows a graph to specify whether or not it supports multi-properties that allow the same value to be supplied on the same key. Not sure why this wasn't implemented long ago. It was relatively straightforward to put in place. I did take a look at the test suite for existing tests that might have needed this feature included, but I didn't see any. `mvn clean install -DincludeNeo4j` is all good VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-919 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/463.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #463 commit ead13106981bc019be25b66e0e432741c3646a2f Author: Stephen Mallette <spmva@genoprime.com> Date: 2016-10-25T17:50:48Z TINKERPOP-919 Added supportsIdenticalMultiProperties() That feature allows a graph to specify whether or not it supports multi-properties that allow the same value to be supplied on the same key.
          Hide
          spmallette stephen mallette added a comment -

          We might want to save this for 3.3.x now that we're so deep into 3.2.x as new tests could break stuff. It's worth noting that TinkerGraph does support same key/value properties...you just have to configure it to work with multi-properties by default:

          gremlin> graph = TinkerGraph.open()
          ==>tinkergraph[vertices:0 edges:0]
          gremlin> conf = new BaseConfiguration()
          ==>org.apache.commons.configuration.BaseConfiguration@47d93e0d
          gremlin> conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality","list")
          gremlin> graph = TinkerGraph.open(conf)
          ==>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]
          ==>vp[name->marko]
          

          or set the cardinality explicitly:

          gremlin> v.property(list, "name","marko")
          ==>vp[name->marko]
          gremlin> v.property(list, "name","marko")
          ==>vp[name->marko]
          gremlin> v.properties('name')
          ==>vp[name->marko]
          ==>vp[name->marko]
          
          Show
          spmallette stephen mallette added a comment - We might want to save this for 3.3.x now that we're so deep into 3.2.x as new tests could break stuff. It's worth noting that TinkerGraph does support same key/value properties...you just have to configure it to work with multi-properties by default: gremlin> graph = TinkerGraph.open() ==>tinkergraph[vertices:0 edges:0] gremlin> conf = new BaseConfiguration() ==>org.apache.commons.configuration.BaseConfiguration@47d93e0d gremlin> conf.setProperty( "gremlin.tinkergraph.defaultVertexPropertyCardinality" , "list" ) gremlin> graph = TinkerGraph.open(conf) ==>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] ==>vp[name->marko] or set the cardinality explicitly: gremlin> v.property(list, "name" , "marko" ) ==>vp[name->marko] gremlin> v.property(list, "name" , "marko" ) ==>vp[name->marko] gremlin> v.properties('name') ==>vp[name->marko] ==>vp[name->marko]
          Hide
          okram Marko A. Rodriguez added a comment -

          This was from the BlazeGraph guys so we can circle back with them when its done.

          Show
          okram Marko A. Rodriguez added a comment - This was from the BlazeGraph guys so we can circle back with them when its done.

            People

            • Assignee:
              spmallette stephen mallette
              Reporter:
              okram Marko A. Rodriguez
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development