Skip to content

Instantly share code, notes, and snippets.

@Hkazanci93
Created October 19, 2021 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hkazanci93/f13db4b8f65f193707410392a109164b to your computer and use it in GitHub Desktop.
Save Hkazanci93/f13db4b8f65f193707410392a109164b to your computer and use it in GitHub Desktop.
Populating RedisGraph from RedisGears
"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