Hi,
I'm trying to switch from the deprecated method 'apoc.convert.toTree' to the new one 'apoc.paths.toJsonTree' but I don't really understand the result
Here is my request :
MATCH path=(:ADEO_ConceptScheme {code:"http://opus-adeo/CONCEPT_SCHEME/generated_code_0"})<-[:TOP_CONCEPT_OF]-(:ADEO_Concept)<-[:BROADER*1..10]-(:ADEO_Concept)
WITH COLLECT(path) as paths
CALL apoc.paths.toJsonTree(paths)
YIELD value
RETURN value
Before the result was a beautiful tree :
{
_type: "Node:ADEO_ConceptScheme",
FR_title: "Features",
_id: 50,
top_concept_of: [
{
broader: [
{
broader: [
{
broader._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:6919785225501278260",
code: "http://opus-adeo/concept/generated_code_0",
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 53,
FR_prefLabel: "With 1 sliding door",
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:53",
broader._id: 6919785225501278260
}
],
broader._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:1152925902653358132",
code: "http://opus-adeo/concept/generated_code_3",
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 52,
FR_prefLabel: "With 1 door",
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:52",
broader._id: 1152925902653358132
}
],
code: "http://opus-adeo/concept/generated_code_2",
properties: "{}",
top_concept_of._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:1152927002164985907",
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 51,
FR_prefLabel: "With doors",
top_concept_of._id: 1152927002164985907,
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:51"
},
{
broader: [
{
broader: [
{
broader._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:6919785225501278263",
FR_altLabels: [],
code: "http://opus-adeo/concept/generated_code_6",
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 56,
FR_prefLabel: "Water resistant",
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:56",
broader._id: 6919785225501278263
}
],
broader._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:1152925902653358135",
code: "http://opus-adeo/concept/generated_code_5",
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 55,
FR_prefLabel: "Waterproof",
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:55",
broader._id: 1152925902653358135
}
],
code: "http://opus-adeo/concept/generated_code_4",
properties: "{}",
top_concept_of._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:1152927002164985910",
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 54,
FR_prefLabel: "Water",
top_concept_of._id: 1152927002164985910,
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:54"
}
],
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:50",
code: "http://opus-adeo/CONCEPT_SCHEME/generated_code_0"
}
With the new method I have something like that :
[{
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 51,
FR_prefLabel: "With doors",
top_concept_of: [
{
_type: "Node:ADEO_ConceptScheme",
FR_title: "Features",
_id: 50,
top_concept_of._id: 1152927002164985907,
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:50",
code: "http://opus-adeo/CONCEPT_SCHEME/generated_code_0",
top_concept_of._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:1152927002164985907"
}
],
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:51",
code: "http://opus-adeo/concept/generated_code_2",
},
{
_type: "Node:ADEO_Concept:ADEO_Feature",
FR_hiddenLabels: [],
broader: [
{
FR_hiddenLabels: [],
broader._elementId: "5:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:1152925902653358132",
FR_altLabels: [],
code: "http://opus-adeo/concept/generated_code_2",
properties: "{}",
_type: "Node:ADEO_Concept:ADEO_Feature",
_id: 51,
ontologyClass: "ADEO:Feature",
ES_hiddenLabels: [],
FR_prefLabel: "With doors",
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:51",
ES_altLabels: [],
broader._id: 1152925902653358132
}
],
_id: 52,
ontologyClass: "ADEO:Feature",
ES_hiddenLabels: [],
FR_prefLabel: "With 1 door",
FR_altLabels: [],
_elementId: "4:3a59f5e1-d597-45c2-97f2-e4e2d2fc9236:52",
code: "http://opus-adeo/concept/generated_code_3",
properties: "{}",
ES_altLabels: []
},
{...}
]
So my question is, am I supposed to recreate the tree myself with this new method ?