First time Tigergraph user basic question: I have an edge that can take its source vertex as one of two types, specified as follows:
CREATE UNDIRECTED EDGE is_type_of (
FROM square, TO shape | FROM circle, TO shape)
Now square and circle id’s are globally unique. Square’s id’s begin exclusively with ‘S_’ and circle’s begin with ‘C_’. I want to import my simple two column shapefile that contains all these links as follows:
LOAD shapefile TO EDGE is_type_of VALUES ($0 "square", $1)
WHERE gsql_substring($0,0,2)=="S_"
LOAD shapefile to EDGE is_type_of VALUES ($0 "circle", $1)
WHERE gsql_substring($0,0,2)=="C_"
but of course this fails because gsql_substring is an attribute function and not available as a WHERE function. Alternatively I’d like to find some way of expressing
LOAD shapefile TO EDGE is_type_of VALUES
($0 gsql_substring($0,0,2) =="S_" ? "square" : "circle",
$1);
It seems as thought the functionality is almost there but I just can’t close the loop. Or do I need to preprocess the import file?