使用 Amazon Neptune 作为 GraphDB,我正在尝试更新某些顶点的属性以包含值列表。本指南中的基本 gremlin 示例:
// 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'))})
但没有一个在工作。
www说
相关分类