我试图将MySQL数据库转换为neo4j,但我不明白如何创建关系(不理解意味着我会得到"错误&# 34)
我已将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),但没有一个给我结果。
有人可以帮助我如何获取这些数据的图表吗?
答案 0 :(得分:0)
[EDITED]
您需要删除CSV文件标题行中逗号周围的空格。
使用这些空格,LOAD CSV
只捕获第一列数据(target_type
)。