neo4j 密码 - 麻烦建立关系

neo4j cypher - trouble making relation

我正在尝试将 MySQL 数据库转换为 neo4j,但我不明白如何创建关系(不明白意味着我得到 "an error")

我已经将 MySQL table 数据导出到 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),但是 none 给了我结果。

谁能帮我用这些数据得到图表?

[已编辑]

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

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