JRedisGraph icon indicating copy to clipboard operation
JRedisGraph copied to clipboard

ResultSet parse to Tree Struct

Open dwgeneral opened this issue 4 years ago • 1 comments

I have some entities in my graph, such as Device which is own of an Organization, Software which is installed on a Device, etc

Screen Shot 2021-01-13 at 3 14 17 PM Screen Shot 2021-01-13 at 2 56 35 PM

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

dwgeneral avatar Jan 13 '21 07:01 dwgeneral

I think you'll be able to restructure your result-set in a JSON fashion once the map data structure will be supported.

swilly22 avatar Jan 13 '21 07:01 swilly22