PedroR
PedroR
ATApache TinkerPop
Created by PedroR on 1/21/2023 in #questions
Grouping and projections help
Hey everyone, I'm trying to execute this query:
g.V('0x77696bb39917c91a0c3908d577d5e322095425ca')
.outE()
.or(
__.hasLabel('from'),
__.hasLabel('to')
).inV()
.has('blockNumber', inside(0, 10000000000))
.project('label', 'transactionHash', 'value', 'dollarValue', 'blockNumber', 'from', 'to', 'tokenAddress')
.by(label)
.by(id)
.by(values('value'))
.by(values('dollarValue'))
.by(values('blockNumber'))
.by(coalesce(inE('from').outV().values('id'), constant('')))
.by(coalesce(inE('to').outV().values('id'), constant('')))
.by(coalesce(values('tokenAddress'), constant('')))
g.V('0x77696bb39917c91a0c3908d577d5e322095425ca')
.outE()
.or(
__.hasLabel('from'),
__.hasLabel('to')
).inV()
.has('blockNumber', inside(0, 10000000000))
.project('label', 'transactionHash', 'value', 'dollarValue', 'blockNumber', 'from', 'to', 'tokenAddress')
.by(label)
.by(id)
.by(values('value'))
.by(values('dollarValue'))
.by(values('blockNumber'))
.by(coalesce(inE('from').outV().values('id'), constant('')))
.by(coalesce(inE('to').outV().values('id'), constant('')))
.by(coalesce(values('tokenAddress'), constant('')))
5 replies
ATApache TinkerPop
Created by PedroR on 1/19/2023 in #questions
Weird Error using inE()
Hey everyone,
g.V()
.hasLabel("TokenTransfer")
.has("tokenAddress", "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0")
.has("blockNumber", inside(0, 1000000000000))
.has("value", gt(500))
.project("label", "transactionHash", "value", "blockNumber", "from", "to")
.by('label')
.by('id')
.by(values('value'))
.by(values('blockNumber'))
.by(inE('from').outV().values('id'))
.by(inE('to').outV().values('id')).fold()
g.V()
.hasLabel("TokenTransfer")
.has("tokenAddress", "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0")
.has("blockNumber", inside(0, 1000000000000))
.has("value", gt(500))
.project("label", "transactionHash", "value", "blockNumber", "from", "to")
.by('label')
.by('id')
.by(values('value'))
.by(values('blockNumber'))
.by(inE('from').outV().values('id'))
.by(inE('to').outV().values('id')).fold()
I'm trying to execute this query, but when I do it, I get this error: Gremlin Query Execution Error: Project By: Next: The provided traverser of key "from" maps to nothing. I don't really get what's happening: my dataset does have 'from' and 'to' stuff going out, and a similar query works in a different context.
6 replies