使用Amazon Neptune作为GraphDB,我试图更新一些顶点的属性,以包含一个值列表。来自此guide的基本小精灵示例:
// Add a list as a property value
g.V().has('code','AUS').property('places',out().values('code').fold())
在以下方面失败:
{
"requestId": "XXX",
"detailedMessage": "Unsupported property value type: java.util.ArrayList",
"code": "UnsupportedOperationException"
}
我还试图添加list
修饰符
g.V().has('code','AUS').property(list, 'places',out().values('code').fold())
在以下方面失败:
{
"requestId": "XXX",
"detailedMessage": "list cardinality for vertex property is not supported",
"code": "UnsupportedOperationException"
}
如果由于某种原因,python gremlin或Amazon Neptune风格不支持数组或列表作为属性值,我可以选择一个值,将这些值连接成一个字符串。我尝试使用各种选项:
g.V().has('code','AUS').property('places',out().values('code').fold(0) {a,b -> a + b.length()})
或
g.V().has('code','AUS').property('places',out().values('code')map {join(",",it.get().value('code'))})
但都没有起作用
我认为您必须在单独的
property
步骤中插入每个值像这样:
编辑:
我在AWS user guide中看到列表基数不受支持。因此,最接近的解决方案是使用
set
基数示例:https://gremlify.com/9v
相关问题 更多 >
编程相关推荐