需要建立一个symmap中医数据集的节点,从csv中读取数据
下面是herb的数据
将该文件放在import中
将xlsx文件转换为csv
LOAD CSV WITH HEADERS FROM "file:///herb.csv" AS line
CREATE (:herb {name:line.Chinese_name,
properties:line.Properties_Chinese,
meridians:line.Meridians_Chinese,
class:line.Class_Chinese,
userpart:line.UsePart,
herbid:line.Herb_id
})
但是节点乱码
转换为utf-8
问题解决
同样的,将其他的节点也导入到数据库中
LOAD CSV WITH HEADERS FROM "file:///disease.csv" as line
CREATE (:disease {name:line.Disease_Name,
definition:line.Disease_definition})
其他节点相同
因为neo4j中用cypher提取内容,是不需要考虑方向的,所以建立一条边即可
LOAD CSV WITH HEADERS FROM "file:///disease2mm.csv" AS line
match (from:disease{diseaseid:line.fromid}),(to:mmsymptom{mmsymptomid:line.toid})
merge (from)-[r:disease2mmsymptom]->(to)