Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addRelation Translation too complex #343

Open
sandszhouSZ opened this issue Dec 9, 2019 · 2 comments
Open

addRelation Translation too complex #343

sandszhouSZ opened this issue Dec 9, 2019 · 2 comments

Comments

@sandszhouSZ
Copy link

Cypher:
MATCH (a:Person),(b:Person) where a.name = $fromName and b.name = $toName CREATE (a)-[ r:Person {name: $rName, prop: $rName} ]->(b) RETURN r"

Gremlin:
g.V().as('a').hasLabel('Person').V().as('b').hasLabel('Person').where(
__.and(
.choose(.constant('qiaogong_0119-0-0'), __.constant('qiaogong_0119-0-0'), __.constant(' cypher.null')).is(neq(' cypher.null')).as(' GENERATED1').select('a').values('name').where(eq(' GENERATED1')),
.choose(.constant('qiaogong_0119-0-1'), __.constant('qiaogong_0119-0-1'), __.constant(' cypher.null')).is(neq(' cypher.null')).as(' GENERATED2').select('b').values('name').where(eq(' GENERATED2'))))
.addE('Person').from('a').to('b').as('r').
property('name', .choose(.constant('qiaogong_0119-0-0-1'), __.constant('qiaogong_0119-0-0-1'), .constant(' cypher.null'))).
property('prop', .choose(.constant('qiaogong_0119-0-0-1'), .constant('qiaogong_0119-0-0-1'), .constant(' cypher.null'))).
select('r').project('r').by(.choose(neq(' cypher.null'), .project(' cypher.element', ' cypher.inv', ' cypher.outv').by(.valueMap().with('~tinkerpop.valueMap.tokens')).by(.inV().id()).by(
.outV().id())))

the Gremlin's dsl almost impossible to execute, cost too much time

@sandszhouSZ
Copy link
Author

#342 , #334 has the same problem, so i think Instead of letting users not use parameter,the better way may be RemoveUselessNullChecks

@SeaofRoses
Copy link

how can I print gremlin-sql?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants