以下来自GDS文档的查询显示了如何通过Cypher创建GDS投影:
MATCH (source) OPTIONAL MATCH (source)-[r:READ]->(target)
WHERE r.numberOfPages IS NOT NULL
WITH gds.graph.project('existingNumberOfPages', source, target, { relationshipProperties: r { .numberOfPages } }) AS g
RETURN
g.graphName AS graph, g.nodeCount AS nodes, g.relationshipCount AS rels
这是我的代码,我想创建一个自定义的投影:
MATCH (n)-[r]-(m)
WHERE type(r) IN [
'Environment_related_eQTL',
'GO term\'s relationshipbiological_process',
'GO term\'s relationshipcellular_component',
'GO term\'s relationshipmolecular_function',
'Gene and GO\'s biological_process term relationship',
'Gene and GO\'s cellular_component term relationship',
'Gene and GO\'s molecular_function term relationship',
'Genes_regulated_by_methylation',
'Phenotypes_affected_by_snp',
'SNP_belongTo_Gene',
'TF_regulates',
'TranseQTL_belongTo_Gene',
'TranseQTL_to_gene',
'ciseQTL_belongTo_Gene',
'ciseQTL_influence_Gene',
'environmenteqtl_id_on',
'gene_to_TFfamily',
'subaloaction',
'Gene_Phenotypes_affected_by_Gene_from_twas_araPhenotype'
]
WITH COLLECT(DISTINCT id(n)) + COLLECT(DISTINCT id(m)) AS allNodeIDs
MATCH (source)-[r]->(target) WHERE id(source) IN allNodeIDs AND id(target) IN allNodeIDs AND type(r) IN [
'Environment_related_eQTL',
'GO term\'s relationshipbiological_process',
'GO term\'s relationshipcellular_component',
'GO term\'s relationshipmolecular_function',
'Gene and GO\'s biological_process term relationship',
'Gene and GO\'s cellular_component term relationship',
'Gene and GO\'s molecular_function term relationship',
'Genes_regulated_by_methylation',
'Phenotypes_affected_by_snp',
'SNP_belongTo_Gene',
'TF_regulates',
'TranseQTL_belongTo_Gene',
'TranseQTL_to_gene',
'ciseQTL_belongTo_Gene',
'ciseQTL_influence_Gene',
'environmenteqtl_id_on',
'gene_to_TFfamily',
'subaloaction',
'Gene_Phenotypes_affected_by_Gene_from_twas_araPhenotype',
'PPI',
'TF_regulates'
]
WITH gds.graph.project(
'graphdealj',
source,
target,
{
sourceNodeLabels: labels(source),
targetNodeLabels: labels(target),
relationshipType: type(r)
}
) AS g
RETURN g.graphName AS graph, g.nodeCount AS nodes, g.relationshipCount AS rels
但我得到了这个错误:
Unknown function 'gds.graph.project' (line 47, column 6 (offset: 1700))
" 'TF_regulates'"
^
我绝对确定我已经安装了GDS,因为我能够成功地执行其他投影方法和各种算法。此外,在最后一个GDS部分之前的查询部分执行时没有任何问题:
我试着在with
之后添加一个call
,但没有效果,但我可以保证在最后一个with
之前的代码正常执行。你可以看到图片有输出
1条答案
按热度按时间uwopmtnx1#
你能检查安装的GDS版本吗?(RETURN gds.version())当前的文档指向2.4,但我怀疑你安装了一个旧版本。