解决方法(如您提到的 github 错误中所述)是使用 Cypher。
使用 Batch 和 Cypher 的示例:
[
{"method":"POST","to":"/index/node/concept?uniqueness=get_or_create","id":0,"body":{"key":"nom", "value":"organisation", "properties": {"nom":"organisation"}}},
{"method":"POST","to":"/index/node/concept?uniqueness=get_or_create","id":1,"body":{"key":"nom", "value":"établissement", "properties": {"nom":"établissement"}}},
{
"method": "POST",
"to": "/cypher",
"id": 1,
"body": {
"query" : "START a=node:concept(nom={aVal}), b=node:concept(nom={bVal}) CREATE b-[r:est]->a RETURN a, b, r",
"params" : {
"aVal" : "établissement",
"bVal" : "organisation"
}
}
}
]
输出:
[{
"id": 0,
"location": "http://localhost:7474/db/data/index/node/concept/nom/organisation/18688",
"body": {
"extensions": {},
"paged_traverse": "http://localhost:7474/db/data/node/18688/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships": "http://localhost:7474/db/data/node/18688/relationships/out",
"all_typed_relationships": "http://localhost:7474/db/data/node/18688/relationships/all/{-list|&|types}",
"traverse": "http://localhost:7474/db/data/node/18688/traverse/{returnType}",
"property": "http://localhost:7474/db/data/node/18688/properties/{key}",
"all_relationships": "http://localhost:7474/db/data/node/18688/relationships/all",
"self": "http://localhost:7474/db/data/node/18688",
"outgoing_typed_relationships": "http://localhost:7474/db/data/node/18688/relationships/out/{-list|&|types}",
"properties": "http://localhost:7474/db/data/node/18688/properties",
"incoming_relationships": "http://localhost:7474/db/data/node/18688/relationships/in",
"incoming_typed_relationships": "http://localhost:7474/db/data/node/18688/relationships/in/{-list|&|types}",
"create_relationship": "http://localhost:7474/db/data/node/18688/relationships",
"data": {
"nom": "organisation"
},
"indexed": "http://localhost:7474/db/data/index/node/concept/nom/organisation/18688"
},
"from": "/index/node/concept?uniqueness=get_or_create"
}, {
"id": 1,
"location": "http://localhost:7474/db/data/index/node/concept/nom/%EF%BF%BDtablissement/18689",
"body": {
"extensions": {},
"paged_traverse": "http://localhost:7474/db/data/node/18689/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships": "http://localhost:7474/db/data/node/18689/relationships/out",
"all_typed_relationships": "http://localhost:7474/db/data/node/18689/relationships/all/{-list|&|types}",
"traverse": "http://localhost:7474/db/data/node/18689/traverse/{returnType}",
"property": "http://localhost:7474/db/data/node/18689/properties/{key}",
"all_relationships": "http://localhost:7474/db/data/node/18689/relationships/all",
"self": "http://localhost:7474/db/data/node/18689",
"outgoing_typed_relationships": "http://localhost:7474/db/data/node/18689/relationships/out/{-list|&|types}",
"properties": "http://localhost:7474/db/data/node/18689/properties",
"incoming_relationships": "http://localhost:7474/db/data/node/18689/relationships/in",
"incoming_typed_relationships": "http://localhost:7474/db/data/node/18689/relationships/in/{-list|&|types}",
"create_relationship": "http://localhost:7474/db/data/node/18689/relationships",
"data": {
"nom": "�tablissement"
},
"indexed": "http://localhost:7474/db/data/index/node/concept/nom/%EF%BF%BDtablissement/18689"
},
"from": "/index/node/concept?uniqueness=get_or_create"
}, {
"id": 1,
"body": {
"columns": ["a", "b", "r"],
"data": [
[{
"paged_traverse": "http://localhost:7474/db/data/node/18689/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships": "http://localhost:7474/db/data/node/18689/relationships/out",
"data": {
"nom": "�tablissement"
},
"traverse": "http://localhost:7474/db/data/node/18689/traverse/{returnType}",
"all_typed_relationships": "http://localhost:7474/db/data/node/18689/relationships/all/{-list|&|types}",
"self": "http://localhost:7474/db/data/node/18689",
"all_relationships": "http://localhost:7474/db/data/node/18689/relationships/all",
"property": "http://localhost:7474/db/data/node/18689/properties/{key}",
"properties": "http://localhost:7474/db/data/node/18689/properties",
"outgoing_typed_relationships": "http://localhost:7474/db/data/node/18689/relationships/out/{-list|&|types}",
"incoming_relationships": "http://localhost:7474/db/data/node/18689/relationships/in",
"incoming_typed_relationships": "http://localhost:7474/db/data/node/18689/relationships/in/{-list|&|types}",
"extensions": {},
"create_relationship": "http://localhost:7474/db/data/node/18689/relationships"
}, {
"paged_traverse": "http://localhost:7474/db/data/node/18688/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships": "http://localhost:7474/db/data/node/18688/relationships/out",
"data": {
"nom": "organisation"
},
"traverse": "http://localhost:7474/db/data/node/18688/traverse/{returnType}",
"all_typed_relationships": "http://localhost:7474/db/data/node/18688/relationships/all/{-list|&|types}",
"self": "http://localhost:7474/db/data/node/18688",
"all_relationships": "http://localhost:7474/db/data/node/18688/relationships/all",
"property": "http://localhost:7474/db/data/node/18688/properties/{key}",
"properties": "http://localhost:7474/db/data/node/18688/properties",
"outgoing_typed_relationships": "http://localhost:7474/db/data/node/18688/relationships/out/{-list|&|types}",
"incoming_relationships": "http://localhost:7474/db/data/node/18688/relationships/in",
"incoming_typed_relationships": "http://localhost:7474/db/data/node/18688/relationships/in/{-list|&|types}",
"extensions": {},
"create_relationship": "http://localhost:7474/db/data/node/18688/relationships"
}, {
"start": "http://localhost:7474/db/data/node/18688",
"data": {},
"self": "http://localhost:7474/db/data/relationship/44187",
"property": "http://localhost:7474/db/data/relationship/44187/properties/{key}",
"properties": "http://localhost:7474/db/data/relationship/44187/properties",
"type": "est",
"extensions": {},
"end": "http://localhost:7474/db/data/node/18689"
}]
]
},
"from": "/cypher"
}]