Greetings dear community,
I would like to ask about how I can get relations of nodes found by means of a full text query, here is how my query looks like:
You could use a ‘case’ statement in the ‘return’ clause to conditionally return one or the other properties based on the labels.
Sorry for my misunderstanding. A simple approach would be to add an ‘option match’ for both relationship regardless of node type. You will get null results for the match that has no result. This would be ok if the optional match results are mutually exclusive, returning only on result for each node type.
another approach is to use one of the APOC library’s conditional procedures, which allow you to conditionally execute cypher queries. In your case the ‘case’ procedure seems appropriate. Your conditions would be the node labels, and the queries would be the match to get the relationships.
You can also use a ‘call’ subquery in a certain way to conditionally execute a block of cypher, but I don’t think this is applicable since you are returning data,