JRedisGraph
JRedisGraph copied to clipboard
ResultSet parse to Tree Struct
I have some entities in my graph, such as Device which is own of an Organization, Software which is installed on a Device, etc
when I query by "MATCH p = (o:Organization) - [*] - (s) return o as primary, s as target, nodes(p) as nodes, relationships(p) as edges' cypher sql,
finally, I want to get a tree struct like this, maybe like graphQL result.
GraphNode: {
id: "org1",
label: "Organization",
property: {
name: 'apple',
...
},
children: [
GraphNode2,
{
id: "dev01",
label: "Device",
property: {
name: 'dev01',
.....
}
children: [
GraphNode4
]
}
....
]
}
does anyone have same work? or some suggestions? thx
I think you'll be able to restructure your result-set in a JSON fashion once the map
data structure will be supported.