Hi, I'm currently importing data from the Google Places API, which I then need to add to a graph. This data includes place id's, and place types (as a list), which may include cafe's restaurants, bars, among others. After importing, my Cypher looks like the following:
// import data from Google Places
MERGE (gp:Place {placeId: place_id})
CALL apoc.do.when('cafe' in types, 'SET gp:Cafe', '', {gp:gp}) YIELD value AS ignore1
CALL apoc.do.when('restaurant' in types, 'SET gp:Restaurant', '', {gp:gp}) YIELD value AS ignore2
CALL apoc.do.when('bar' in types, 'SET gp:Bar', '', {gp:gp}) YIELD value AS ignore3
RETURN count(*)
Many of the nodes I'm creating should return with labels of two or even three of the types, but I only ever end up with one 'type' label per node. Furthermore, if all of the passed Google place data include a type of 'cafe', and the cafe condition is tested first (as in the example above), then none of the successive procedures seem to be evaluated.
Any thoughts on why this is happening and possible ways it could be addressed?