Created
October 19, 2021 11:40
-
-
Save Hkazanci93/f13db4b8f65f193707410392a109164b to your computer and use it in GitHub Desktop.
Populating RedisGraph from RedisGears
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"GRAPH.QUERY", "cord19medical","""MERGE (source: entity { id: '%s', label :'entity', name: '%s'}) | |
ON CREATE SET source.rank=1 | |
ON MATCH SET source.rank=(source.rank+1) | |
MERGE (destination: entity { id: '%s', label: 'entity', name: '%s' }) | |
ON CREATE SET destination.rank=1 | |
ON MATCH SET destination.rank=(destination.rank+1) | |
MERGE (source)-[r:related]->(destination) | |
ON CREATE SET r.rank=1, r.year=%s | |
ON MATCH SET r.rank=(r.rank+1) | |
ON CREATE SET r.rank=1 | |
ON MATCH SET r.rank=(r.rank+1)""" % (source_id ,source_name,destination_id,destination_name,year)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment