RedisGraph/redisgraph-bulk-loader

Multiple labels (Question)

YaphetKG opened this issue · 6 comments

is there a way for the bulk loader to add multiple labels on a node?

I believe you can use the following:

redisgraph-bulk-insert <graph_name> -N <Label_0>:<Label_1>:<Label_i> nodes.csv

To load specify multiple labels to each entity in a CSV file.
@AviAvni can you please make sure we update redisgraph-bulk-loader documentation such that this is clear and easy to find, consider also adding an example.

Thanks!

Thanks for the suggestion @swilly22 ,
I played around with this a little bit , we have node types like

biolink:SmallMolecule
biolink:MolecularEntity
biolink:ChemicalEntity
biolink:NamedThing
biolink:Entity
biolink:PhysicalEssence ...

This becomes a problem with how labels would be split by : character....
I am wondering if there is a way to seperate them in another way ....

Hi @swilly22 is there any work around to support labels that have : in them ?

to be able to do queries as

MATCH (c:`biolink:SmallMolecule`:`biolink:ChemicalEntity`) return c 

If we create the node with cypher create call i believe it would work , but we are not able to create the nodes with multiple labels using the bulk loader. Maybe having an option to override the separator would make sense (?)

Hi @YaphetKG,

I've looked into the Bulk-Loder source and I'm reluctant to make any change in the command line arguments at the moment,
Let me suggest the following:

Use a placeholder label during bulk loading, once the data is loaded issue a query to update this place holder,
See following example on how to update node label, note this will require the latest version of RedisGraph 2.10

127.0.0.1:6379> GRAPH.QUERY g "MATCH (a:A) SET a:`C:D`"
1) 1) "Labels added: 1"
   2) "Cached execution: 0"
   3) "Query internal execution time: 6.551250 milliseconds"

127.0.0.1:6379> GRAPH.QUERY g "MATCH (a) REMOVE a:A RETURN a"
1) 1) "a"
2) 1) 1) 1) 1) "id"
            2) (integer) 0
         2) 1) "labels"
            2) 1) "C:D"
         3) 1) "properties"
            2) (empty array)
3) 1) "Labels removed: 1"
   2) "Cached execution: 0"
   3) "Query internal execution time: 6.202083 milliseconds"