title: Gremlin-python: how to write a query which uses the properties of both joined vertices in the where condition?
body: <p>I am new to Gremlin and am trying to convert a SQL query to Gremlin. I have two vertex types, labeled <code>host</code> and <code>repo</code>, and here is the Gremlin script to create the vertices and the edges:</p>
  <pre><code>g.addV('asset').property(id, 'a1').property('ip', '127.4.8.51').property('scanDate', '2020-09-10').property('repoId', 1)
  g.addV('asset').property(id, 'a2').property('ip', '127.4.8.55').property('scanDate', '2020-09-20').property('repoId', 1)
  g.addV('asset').property(id, 'a3').property('ip', '127.4.8.57').property('scanDate', '2020-09-21').property('repoId', 1)
  g.addV('asset').property(id, 'a4').property('ip', '127.4.10.36').property('scanDate', '2020-09-12').property('repoId', 2)
  g.addV('asset').property(id, 'a5').property('ip', '127.4.10.75').property('scanDate', '2020-09-14').property('repoId', 2)
  g.addV('repo').property(id, 'r1').property('repoName', 'repo1').property('assetAge', 10).property('repoId', 1)
  g.addV('repo').property(id, 'r2').property('repoName', 'repo2').property('assetAge', 9).property('repoId', 2)
  g.V('a1').addE('has').to(g.V('r1'))
  g.V('a2').addE('has').to(g.V('r1'))
  g.V('a3').addE('has').to(g.V('r1'))
  g.V('a4').addE('has').to(g.V('r2'))
  g.V('a5').addE('has').to(g.V('r2'))
  </code></pre>
  <p>I would like to write down a query in Gremlin that does the same thing as the bellow SQL query:</p>
  <pre><code>SELCET *
  FROM asset a
  JOIN repo r ON a.repoId = r.repoId
  WHERE a.scanDate &gt;= CURDATE() - INTERVAL (r.assetAge + 1) DAY
  </code></pre>
  <p>I have so far tried the bellow code in <code>python</code>:</p>
  <pre><code>from datetime import datetime, timedelta
  from gremlin_python.process.traversal import gte
  
  d = datetime.today() - timedelta(days=10) # here I have hard coded the days
  traversal = g.V().hasLabel(&quot;asset&quot;).has(&quot;scanDate&quot;, gte(d))
  traversal.valueMap().toList()
  </code></pre>
  <p>But I do not know how I can pass the <code>repo.assetAge</code> from the mapped repo vertices to the <code>days</code> parameter in <code>timedelta()</code>. Any help is really appreciated. Thanks.</p>