neo4j cypher-麻烦的建立关系

onlyme88

我正在尝试将MySQL数据库转换为neo4j,但我不了解如何创建关系(不了解意味着我遇到了“错误”)

我已经将MySQL表数据导出到csv文件

target_type, target_desc, parent_type
"ADMET","Target is not applicable for an ADMET assay (e.g., physchem property)","UNDEFINED"
"CELL-LINE","Target is a specific cell-line","NON-MOLECULAR"
"CHIMERIC PROTEIN","Target is a fusion of two different proteins, either a synthetic construct or naturally occurring fusion protein","PROTEIN"
"LIPID","Target is a lipid","MOLECULAR"
"MACROMOLECULE","Target is a biological macromolecule (e.g., glycoproteins, hemozoin, hydroxyapatite)","MOLECULAR"
"METAL","Target is a metal e.g., iron","MOLECULAR"
"MOLECULAR","Target has been identified as a defined molecular entity (e.g., protein or nucleic acid)",NULL
"NO TARGET","Target is not applicable for a screening assay (e.g., negative control/counterscreen)","UNDEFINED"
"NON-MOLECULAR","Target has not been defined at a molecular level, only the non-molecular entity which is affected (e.g., organism, cell line etc)",NULL
"NUCLEIC-ACID","Target is DNA, RNA or PNA","MOLECULAR"
"OLIGOSACCHARIDE","Target is an oligosaccharide (e.g., heparin, starch)","MOLECULAR"
"ORGANISM","Target is a complete organism","NON-MOLECULAR"
"PHENOTYPE","Target is a biological phenotype or process","NON-MOLECULAR"
"PROTEIN","Target is a protein or group of proteins","MOLECULAR"
"PROTEIN COMPLEX","Target is a defined protein complex, consisting of multiple subunits","PROTEIN"
"PROTEIN COMPLEX GROUP","Target is a poorly defined protein complex, where subunit composition is unclear (e.g., GABA-A receptor)","PROTEIN"
"PROTEIN FAMILY","Target is a group of closely related proteins","PROTEIN"
"PROTEIN NUCLEIC-ACID COMPLEX","Target is a complex consisting of both protein and nucleic-acid components (e.g., ribosome)","MOLECULAR"
"PROTEIN-PROTEIN INTERACTION","Target is the disruption of a protein-protein interaction","PROTEIN"
"SELECTIVITY GROUP","Target is a pair of proteins for which the selectivity has been assessed","PROTEIN"
"SINGLE PROTEIN","Target is a single protein chain","PROTEIN"
"SMALL MOLECULE","Target is a small molecule such as an amino acid, sugar or metabolite)","MOLECULAR"
"SUBCELLULAR","Target is a subcellular fraction","NON-MOLECULAR"
"TISSUE","Target is a healthy or diseased tissue","NON-MOLECULAR"
"UNCHECKED","Target has not yet been assigned","UNDEFINED"
"UNDEFINED","No target has been defined",NULL
"UNKNOWN","Molecular identity of target is unknown (e.g., pharmacologically defined target)","UNDEFINED"

之后,我用代码创建了节点

LOAD CSV WITH HEADERS FROM 'file:///target_type.csv' AS line
CREATE (targetType:TargetType {id: line.target_type })
SET targetType.description = line.target_desc
RETURN targetType

问题是当我尝试在类型节点之间创建关系时。以下代码给出了消息“(无行)”:

LOAD CSV WITH HEADERS FROM 'file:///target_type.csv' AS line
MATCH (targetType:TargetType {id: line.target_type})
MATCH (parentType:TargetType {id: line.parent_type})
CREATE (targetType)-[:CHILD_OF]->(parentType)
RETURN targetType, parentType;

我试图重写csv文件中的NULL值,以在节点中设置不同的标签(名称代替ID),但是没有一个给我结果。

有人可以帮助我如何获取这些数据的图形吗?

赛博

[编辑]

您需要删除CSV文件标题行中逗号周围的空格。

有了这些空格,LOAD CSV就只能捕获数据的第一列(target_type)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

neo4j Cypher使用专有权建立关系

Neo4j - Cypher 节点和关系

Neo4j Cypher,仅返回指定的关系

Neo4J Cypher查询-空关系

neo4j Cypher:关系未按预期工作

neo4j CYPHER - 关系查询未完成

Neo4j Cypher 查询多对多关系

Neo4j Cypher:在 Neo4j Explorer Web App (yFiles) 中显示关系/边的属性

neo4j cypher 基于两种关系过滤多路径

Cypher(Neo4j)创建与所有其他节点的关系(自身除外)

Neo4j 在 cypher 单节点关系中合并节点

Neo4j / Cypher:如果满足某些条件,则创建关系

如何使用Neo4J的Cypher查询返回关系类型?

使用Cypher以关系权重的升序遍历Neo4j图

是否可以找到关系连接的节点-Cypher Neo4J

什么Cypher查询可检索Neo4J中某些节点之间的关系?

如何在Cypher Neo4j中对关系进行分组和计数

Neo4j 更高效的 Cypher 查询,用于查找具有关系的连接节点

使用 neo4j cypher 检索子节点之间的关系

使用可变长度路径时Neo4J Cypher抓取关系的类型

查找没有特定关系的节点(Cypher / neo4j)

通过Neo4j Cypher中的ID删除关系的简单方法?

如何在Neo4j的Cypher中删除关系类型

如何检索多个深度关系的节点Neo4j Database Cypher?

Neo4j Cypher遍历-通过多种关系类型查找路径

Neo4j Cypher获取节点,直到达到与给定属性的关系为止

使用可变的MATCH标签动态创建Neo4j / Cypher关系

Neo4j Cypher-匹配关系条件或为null

如何使用CSV LOAD从Neo4J / Cypher中的csv获取关系