I need some help from you guys.
i know that we can return json output from cypher queries.but my scenario is quite different
i have nodes in below format
DNA<------EXP<------HAR<-------PI
now problm is that this path can have multiple EXP and Multiple HAR
i want to create json like this
PI{
PI Node Details,
HAR{
HARVEST Node details,
Exp{
Expression node detail,
Dna{
Dna Node details
}
}
}
}
Thanks michael.
It is working for me ..
but now problem is i want to get some particular properties in this path like we have some BARCODE in each node that comes in this path .i want to get these barcodes only in json not all properties.
please help me in this
i want some json that have data from another node as well
please find query below that return all the nodes and info i need to display in json .
MATCH (a:ENTITY)<-[:Having]-(:ENTITY_TYPE{ENTITY_TYPE_NAME:'x'})
MATCH (b:ENTITY)<-[:Having]-(:ENTITY_TYPE{ENTITY_TYPE_NAME:'y'})
match path = (a)-[*]->(c:z{BARCODE:'asdf'})-[*]->(b)
// get all nodes (departments) from path
with nodes(path) as deps
// unwind deps collection to individual departments
unwind deps as dep
// match workers and managers directly connected to dep nodes
Optional match (dep)-[:ASSOCIATED{PREDICATE:'abc'}]->(u:ENTITY)
with collect(dep) as d, collect(u) as u
with collect(d + u) as p
call apoc.convert.toTree(p) yield value return value
in above i have a query with optional match, i want to show u's barcode as json attribute for the path
please help me in this i am getting error in above query
Type mismatch: expected List<Path> but was List<List<Node>>
Hi michael,
Thanks for all your help.
my query regarding data lineage.
my data is in following tree structure.
A <-associated- B <-associated- C <-associated- D <-associated- E
D <-associated- F
D <-associated- G
C <-associated- K
C <-associated- L
I want to show this data in a nested json
i will give only one node info according to that info i want to get json from Top most to lower most node and it should contain all nested data and subgraph
Great thread. I'm working with Neo4j embedded and I'm looking for an example of call the equivalent of "apoc.convert.toJson(path)" from Java directly (not from Cypher). I have include the Maven dependency below but I can't figure out the syntax.
Hi, is it possible to get only tree structure (only id-s, or some certain selected-values from children) ?
apoc.convert.toTree returns with the structure also all properties of the child nodes in the tree.
Thank you for reply. I was hoping there is a method to reduce the ammount of data transmitted to application on database side. As i understand, you suggest to transform responce from database to suitable format on application level - in my case it means transmitting lots of information that is not needed by application.