cancel
Showing results for 
Search instead for 
Did you mean: 

bulk operation in Bloom

niujinghui
Node

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?

1 ACCEPTED SOLUTION

luiseduardo
Ninja
Ninja

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?

 

View solution in original post

8 REPLIES 8

luiseduardo
Ninja
Ninja

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?

 

@luiseduardo 

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?

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.

@luiseduardo 

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.

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!

Thanks for the tips!

niujinghui
Node

@luiseduardo 

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

 

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:

luiseduardo_0-1662240996226.png

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!

 

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.