通过 arangoimp 读取 CSV 文件中嵌入的 JSON-Object

Read embedded JSON-Object in a CSV-file via arangoimp

具有如下 CSV 文件(根据 IRIS 数据集建模):

Species,values
setosa,"{""Sepal.Length"":5.1,""Sepal.Width"":3.5,""Petal.Length"":1.4,""Petal.Width"":0.2}"
setosa,"{""Sepal.Length"":4.9,""Sepal.Width"":3,""Petal.Length"":1.4,""Petal.Width"":0.2}"
setosa,"{""Sepal.Length"":4.7,""Sepal.Width"":3.2,""Petal.Length"":1.3,""Petal.Width"":0.2}"
setosa,"{""Sepal.Length"":4.6,""Sepal.Width"":3.1,""Petal.Length"":1.5,""Petal.Width"":0.2}"
setosa,"{""Sepal.Length"":5,""Sepal.Width"":3.6,""Petal.Length"":1.4,""Petal.Width"":0.2}"
setosa,"{""Sepal.Length"":5.4,""Sepal.Width"":3.9,""Petal.Length"":1.7,""Petal.Width"":0.4}"

如何将 values 列读取为对象而不是字符串?

使用

arangoimp --file /Desktop/iris.csv --type csv --collection iris --create-collection true

这给了我每行两个字符串....

在 GUI 中我得到:

而这是我努力实现的目标:

arangoimp 只允许导入 csv 或 json 但不能混合它们。

最简单的方法是将您的 csv 文件转换为 json 格式,然后将其导入(参见 docs)。