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