【发布时间】:2018-09-12 18:35:19
【问题描述】:
我有一个场景,我必须检查具有不同标签的多个顶点并在父顶点下匹配它们的属性。如果一切正常,则返回父顶点。
我尝试使用“and”子句和“where”子句编写查询,但没有一个有效:
这是我的试验:
g.V().hasLabel('schedule').inE().outV().hasLabel('url').as('a').outE().inV().aggregate('x').hasLabel('schedule').has('name', '3').as('b').select('x').hasLabel('states').has('name', 'federal').as('c').select('a')
g.V().hasLabel('schedule').inE().outV().hasLabel('url').as('a').outE().where(inV().hasLabel('schedule').has('name', '3')).where(inV().hasLabel('states').has('name', 'federal')).select('a')
g.V().hasLabel('schedule').inE().outV().hasLabel('url').as('a').outE().and(inV().hasLabel('schedule').has('name', '3'),inV().hasLabel('states').has('name', 'federal')).select('a')
g.V().hasLabel('schedule').inE().outV().hasLabel('url').as('a').outE().inV().aggregate('x').hasLabel('schedule').has('name', '3').as('b').select('x').unfold().hasLabel('states').has('name', 'federal').as('c').select('a')
请引导我走正确的道路
【问题讨论】:
标签: graph azure-cosmosdb gremlin tinkerpop3