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

ConnectiveP doesn't get evaluated right for list/set cardinality

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.5.4
    • None
    • process
    • None

    Description

      Given:

      g = TinkerGraph.open().traversal()
      g.addV().property(list,"variant","2wd").property(list,"variant","4wd").iterate()
      g.addV().property(list,"variant","2wd").property(list,"variant","6wd").iterate()
      g.addV().property(list,"variant","8wd").property(list,"variant","6wd").iterate()
      
      // 
      
      gremlin> g.V().has("variant",startingWith("2").and(startingWith("4"))).valueMap()
      ==>[variant:[2wd,4wd]]
      gremlin> g.V().or(has("variant",startingWith("2").and(startingWith("4"))),
      ......1>          has("variant",startingWith("2").and(startingWith("6")))).valueMap()
      gremlin> g.V().union(has("variant",startingWith("2").and(startingWith("4"))),
      ......1>             has("variant",startingWith("2").and(startingWith("6")))).valueMap()
      gremlin> g.V().has("variant",startingWith("2").and(startingWith("4"))).aggregate("x").fold().
      ......1>   V().has("variant",startingWith("2").and(startingWith("6"))).aggregate("x").fold().
      ......2>   cap("x").unfold().valueMap()
      ==>[variant:[2wd,4wd]]
      ==>[variant:[2wd,6wd]]
      

      The HasContainer doesn't seem to get applied properly in the case of multi-properties. It sorta just treats properties as single in those cases.

      The consistency issue seems best resolved by following the latter cases and making it so that and() operates against a single property and prefer that multiproperties be resolved over multiple has():

      gremlin> g.V().has("variant", startingWith("2").and(startingWith("4"))).valueMap()
      gremlin> g.V().has("variant", startingWith("2")).has('variant',startingWith("4")).valueMap()
      ==>[variant:[2wd,4wd]]
      gremlin> g.V().has("variant", startingWith("2")).or(has('variant',startingWith("4")),has('variant',startingWith("6"))).valueMap()
      ==>[variant:[2wd,4wd]]
      ==>[variant:[2wd,6wd]]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            spmallette Stephen Mallette
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: