Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-01-2022 12:48 AM
I wonder if Bloom allows you to perform bulk operations. For example,
step 1: Select all `Person` nodes
step 2: Filter out the ones from step 1, that I know are 'male'
step 3: apply 'male' label to all.
Can I do such operation with Bloom?
Solved! Go to Solution.
09-02-2022 09:10 AM
Hi @niujinghui !
If your database isn't that big, you can definitely do it, by using Scene Actions and filters, but I'd ask why would you want to do it in Bloom and not through Neo4j Browser, or an ETL flow in your preferred driver option?
09-02-2022 09:10 AM
Hi @niujinghui !
If your database isn't that big, you can definitely do it, by using Scene Actions and filters, but I'd ask why would you want to do it in Bloom and not through Neo4j Browser, or an ETL flow in your preferred driver option?
09-02-2022 08:54 PM
First thank you very much for pointing out the research direction, which is very valuable.
The reason for choosing Bloom is it is most intuitive and allows for direct manipulation on visible selection of a set of nodes.
Do you think Neo4j Broswer will be a better solution? Could you give some of your thoughts here?
09-03-2022 02:33 PM
Of course! So, I think it really depends on how are you planning to use Neo4j, if this kind of update will be done always when new data arrives and the rules for it are well defined and constant, I think it should be done with Cypher when the data is loaded (through the ETL process, Neo4j Browser, etc.); but, if after data is loaded and a visual analysis is done (using business/domain specific knowledge) inside Bloom to determine that some nodes need a new label set on them, then I think Bloom could be the correct choice; even so, in this latter case I think eventually if your use case requires to automate the process of loading data into Neo4j, setting the labels taking into account some specific rules, should also be done in the loading process with Cypher.
I hope this helps! Please let me know if I explained myself and if ti makes sense to you.
09-03-2022 10:40 PM
One point I'd like to ask your opinion here, do you suggest Neo4j broswer has more power than Bloom in use case like bulk updating?
From my short experience it seems you can do most if not all via Bloom. I don't really like the broswer to be honest.
09-04-2022 08:42 PM
Ohh that's a totally valid point! I mean, Neo4j Bloom is mainly used as a visualization tool, not so much as a data update/load tool, but if it fits your needs I think that's great!
If your use case requires updates for greater amounts of nodes/relationships, I think doing it with Cypher is much more quick than selecting nodes/rels in Bloom viz and applying a scene action.
And it's not that Neo4j Browser has more power, but that in Browser you use Cypher to do everything, so the limit of what you can do is what Cypher can do (which is quite a lot!), so I'd recommend for you to get some Cypher courses if you haven't taken them, they're great!
I hope this answer your question!
09-05-2022 04:33 PM
Thanks for the tips!
09-03-2022 01:42 PM
Also if I have the following Saved query:
MATCH (p:Person)
WHERE p in $nodes
SET p:Person:male
RETURN p
It sets the labels but report error.
Using `id(p` solves the problem. But why is this tiny difference?
MATCH (p:Person)
WHERE id(p) in $nodes
SET p:Person:male
RETURN p
09-03-2022 02:45 PM
I think it shouldn't set the labels lol. To reference the nodes and relationships selected in Bloom we use parameters, as this text from the shared link says:
For the scene actions to work we need to use a parameter called $nodes or $relationships (parameters in Bloom are referenced with this symbol $), so that our selection is sent to the Cypher query we want to execute.
In other words it works like a variable that contains the nodes or relationships we select in Bloom. And for this variable to actually work in our Cypher query we need to use the ids of the selected objects, that's why we need to extract the id of the variable p with the function id(), to ask if p has an id that pertains to the list of objects that we selected.
Hope this helps!
All the sessions of the conference are now available online