@aman.singh , We noticed that some response changes there for the same query. Please find the document for old and new queries with their responses.
Old Query:
"MATCH (nl:Nl{nl_id:2424})-[:NL_REFERS_TO_SOL]->(sl:Sol)<-[:RULE_BOOK_ISSUE_CONSISTS_OF_SOLS]-(rbi:Rule_Book_Issue)<-[:HAS_RULE_BOOK_ISSUE]-(rb:Rule_Book)
CALL {
WITH rb
MATCH path = (rbs:Rule_Book_Struct{rule_book_struct_id:""Rule Root Object""})-[:HAS_RULE_BOOK_STRUCT_CHILD*]->(rbsc:Rule_Book_Struct)<-[:RULE_BOOK_BELONGS_TO_STRUCT]-(prb:Rule_Book)-[:HAS_RULE_BOOK_CHILD*]->(rb)
RETURN path
UNION
WITH rb
MATCH path = (rbs:Rule_Book_Struct{rule_book_struct_id:""Rule Root Object""})-[:HAS_RULE_BOOK_STRUCT_CHILD*]->(rbsc:Rule_Book_Struct)<-[:RULE_BOOK_BELONGS_TO_STRUCT]-(rb)
RETURN path
}
WITH collect(path) AS paths
CALL apoc.convert.toTree(paths) yield value
RETURN value"
Old query Response:
"[
{
""value"": {
""_type"": ""Rule_Book_Struct"",
""_id"": 376,
""rule_book_struct_id"": ""Rule Root Object"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:376"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 405,
""rule_book_struct_id"": ""NAT"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:405"",
""has_rule_book_struct_child.order_rule_book_struct"": 30,
""has_rule_book_struct_child.order"": 30,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21181,
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21181"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 651,
""rule_book_struct_id"": ""DE"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:651"",
""has_rule_book_struct_child.order_rule_book_struct"": 20,
""has_rule_book_struct_child.order"": 20,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21451,
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21451"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 803,
""rule_book_struct_id"": ""DE_V"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:803"",
""has_rule_book_struct_child.order_rule_book_struct"": 20,
""has_rule_book_struct_child.order"": 20,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21587,
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21587"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 872,
""rule_book_struct_id"": ""DE_V_ORG"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:872"",
""has_rule_book_struct_child.order_rule_book_struct"": 20,
""has_rule_book_struct_child.order"": 20,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21656,
""rule_book_belongs_to_struct"": [
{
""rule_book_active"": true,
""_type"": ""Rule_Book"",
""_id"": 5547,
""rule_book_belongs_to_struct.order"": 50,
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:5547"",
""rule_book_belongs_to_struct.order_rule_book_in_struct"": 50,
""rule_book_belongs_to_struct._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:24422"",
""rule_book_id"": ""DE_FSAAKV"",
""rule_book_belongs_to_struct._id"": 24422
}
],
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21656""
}
]
}
]
}
]
}
]
}
}
]"
New Query:
"MATCH (nl:Nl{nl_id:2424})-[:NL_REFERS_TO_SOL]->(sl:Sol)<-[:RULE_BOOK_ISSUE_CONSISTS_OF_SOLS]-(rbi:Rule_Book_Issue)<-[:HAS_RULE_BOOK_ISSUE]-(rb:Rule_Book)
CALL {
WITH rb
MATCH path = (rbs:Rule_Book_Struct{rule_book_struct_id:""Rule Root Object""})-[:HAS_RULE_BOOK_STRUCT_CHILD*]->(rbsc:Rule_Book_Struct)<-[:RULE_BOOK_BELONGS_TO_STRUCT]-(prb:Rule_Book)-[:HAS_RULE_BOOK_CHILD*]->(rb)
RETURN path
UNION
WITH rb
MATCH path = (rbs:Rule_Book_Struct{rule_book_struct_id:""Rule Root Object""})-[:HAS_RULE_BOOK_STRUCT_CHILD*]->(rbsc:Rule_Book_Struct)<-[:RULE_BOOK_BELONGS_TO_STRUCT]-(rb)
RETURN path
}
WITH collect(path) AS paths
CALL apoc.paths.toJsonTree(paths) yield value
RETURN value"
New Query Response
"[
{
""value"": {
""_type"": ""Rule_Book_Struct"",
""_id"": 376,
""rule_book_struct_id"": ""Rule Root Object"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:376"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 405,
""rule_book_struct_id"": ""NAT"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:405"",
""has_rule_book_struct_child.order_rule_book_struct"": 30,
""has_rule_book_struct_child.order"": 30,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21181,
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21181"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 651,
""rule_book_struct_id"": ""DE"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:651"",
""has_rule_book_struct_child.order_rule_book_struct"": 20,
""has_rule_book_struct_child.order"": 20,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21451,
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21451"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 803,
""rule_book_struct_id"": ""DE_V"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:803"",
""has_rule_book_struct_child.order_rule_book_struct"": 20,
""has_rule_book_struct_child.order"": 20,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21587,
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21587"",
""has_rule_book_struct_child"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 872,
""rule_book_struct_id"": ""DE_V_ORG"",
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:872"",
""has_rule_book_struct_child.order_rule_book_struct"": 20,
""has_rule_book_struct_child.order"": 20,
""rule_book_struct_active"": true,
""has_rule_book_struct_child._id"": 21656,
""has_rule_book_struct_child._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:21656""
}
]
}
]
}
]
}
]
}
},
{
""value"": {
""rule_book_active"": true,
""_type"": ""Rule_Book"",
""_id"": 5547,
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:5547"",
""rule_book_id"": ""DE_FSAAKV"",
""rule_book_belongs_to_struct"": [
{
""_type"": ""Rule_Book_Struct"",
""_id"": 872,
""rule_book_struct_id"": ""DE_V_ORG"",
""rule_book_belongs_to_struct.order"": 50,
""_elementId"": ""4:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:872"",
""rule_book_belongs_to_struct.order_rule_book_in_struct"": 50,
""rule_book_belongs_to_struct._elementId"": ""5:b5bcbbcb-1b72-4e27-8ea2-06ab9616303e:24422"",
""rule_book_struct_active"": true,
""rule_book_belongs_to_struct._id"": 24422
}
]
}
}
]"