Neo4j 版本:3.2.2
操作系统:Ubuntu 16.04
我getDegree()
在 mapping.json 文件中使用函数,但返回总是null
; 我正在使用数据集 neo4j 教程电影/演员数据集。
映射.json
{
"defaults": {
"key_property": "uuid",
"nodes_index": "default-index-node",
"relationships_index": "default-index-relationship",
"include_remaining_properties": true
},
"node_mappings": [
{
"condition": "hasLabel('Person')",
"type": "getLabels()",
"properties": {
"getDegree": "getDegree()",
"getDegree(type)": "getDegree('ACTED_IN')",
"getDegree(direction)": "getGegree('OUTGOING')",
"getDegree('type', 'direction')": "getDegree('ACTED_IN', 'OUTGOING')",
"getDegree-degree": "degree"
}
}
],
"relationship_mappings": [
{
"condition": "allRelationships()",
"type": "type",
}
]
}
此外,如果我isOutgoing(), isIncoming(), otherNode
在 relationship_mappings 属性部分使用函数,elasticsearch 将永远不会从 neo4j 加载关系数据。我想我可能only when one of the participating nodes "looking" at the relationship is provided
对这个页面上的这句话有一些误解 https://github.com/graphaware/neo4j-framework/tree/master/common#inclusion-policies
映射.json
{
"defaults": {
"key_property": "uuid",
"nodes_index": "default-index-node",
"relationships_index": "default-index-relationship",
"include_remaining_properties": true
},
"node_mappings": [
{
"condition": "allNodes()",
"type": "getLabels()"
}
],
"relationship_mappings": [
{
"condition": "allRelationships()",
"type": "type",
"properties": {
"isOutgoing": "isOutgoing()",
"isIncomming": "isIncomming()",
"otherNode": "otherNode"
}
}
]
}
顺便说一句,是否有任何页面列出了我们可以在 mapping.json 中使用的所有功能?我认识他们两个
github.com/graphaware/neo4j-framework/tree/master/common#inclusion-policies
github.com/graphaware/neo4j-to-elasticsearch/blob/master/docs/json-mapper.md
但似乎还有更多,因为我可以使用getType()
上述任何页面中未列出的 。
如果我可以提供任何进一步的帮助来解决问题,请告诉我
谢谢!