RedisGraph-UNWIND批查询

问题描述

我想使用Python API在RedisGraph中执行一批查询,以加快大知识图的创建。

Neo4J 中,Neo4J Python API可以使用 UNWIND 命令,并允许并行化查询。在此代码段中,您可以看到Python API如何支持 UNWIND -concurrent方法config.toml作为参数。 runner-gitlab-runner是词典列表。每个字典都有values-content-configuration-runnertext= '''CMS Info Systems Pvt. Ltd Ref: CMS/HR/10-11/08/98 30th Aug 2010 Mr. Manohar an P Emp Code Designation DOJ : 46947 : FMS Engineer. : 015' Feb 2008 Chennai Dear Manoharan P,Reg: Acceptance of your Resignation We are in receipt of your resignation letter dated 14h July 2010,tendering your resignation thereof. As requested by you,we have accepted your resignation and you will be relieved of your assignment with us from the close of working hours on 25" Aug 2010''' matches= re.findall('(\d{1,2}[a-z\s\"]*[^0-9a-zA-Z]*((?i)Jan|(?i)Feb|(?i)Mar|(?i)Apr|(?i)May|(?i)Jun|(?i)Jul|(?i)Aug|(?i)Sep|(?i)Oct|(?i)Nov|(?i)Dec|(?i)January|(?i)February|(?i)march|(?i)April|(?i)May|(?i)June|(?i)JULY|(?i)August|(?i)September|(?i)October|(?i)November|(?i)December)[\s]*[^0-9a-zA-Z]*\d{2,4})',text) for match in matches: print(match[0]) run作为键。

batch

RedisGraph 中, UNWIND 也可用(因为它是Cypher命令)。但是,我不知道如何在Python API中传递批处理:

batch

您知道解决方案吗?谢谢。

解决方法

redisgraph-py自述文件显示了example如何通过其query()方法传递参数:

...
params = {'purpose':"pleasure"}
query = """MATCH (p:person)-[v:visited {purpose:$purpose}]->(c:country)
     RETURN p.name,p.age,v.purpose,c.name"""

result = redis_graph.query(query,params)
...

如果您确实需要使用execute_command(),则可以看看how query() is implemented

,

以下是RedisLabs开发团队的回答:

github.com/RedisGraph/RedisGraph/issues/1293

到目前为止,该功能尚不受支持,但将来会推出。