1
我有一个movies.csv文件,每行有一个特征向量(例如 - id |名称| 0 | 1 | 1 | 0 | 0 | 0 | 1有2个名称和特征的功能id,用于流派分类的7个特征)neo4j中循环数据值
我想要类Movies中的节点m与来自类流派的节点g具有关系[:HAS_GENRE]。为此,我需要遍历所有'|'分离的特点,只有真正的关系,如果值是1
从本质上讲,我想有 -
x = a //where a is the index of the first genre feature
while (x < lim) //lim is the last index of the feature vector
{
if line[x] is 1:
(m{id:toInt(line[0]})-[:HAS_GENRE]->(g{id=line[x]})
}
我该怎么办呢?
我知道匹配和创建构造,只是没有关于循环部分的想法。 – goelakash 2015-02-06 14:27:58
你有一个.csv文件,其中有一个管道分隔的列? – 2015-02-07 01:27:07
所有列都由管道分隔 – goelakash 2015-02-07 09:22:19