First of all I must admit I could not find a suitable title for the problem, thus could not find results in search. Trying to explain it.
I have a situation where i store few translations of a node like following.
Now i have a situation where i need to search the nodes by translation code such that if i search by code: "en" I will get n1 and n2 (from above example) i do like
match (n)-[:HAS_TRANSLATION { code: "en" }]->(tr:Translation)
return tr.text as name
but I also intend to show other nodes as well such that following list is formed
n1 - en - textstring
n2 - en - textstring
n3 - tr - textstring
I understand I can use apoc.case for this but what I am struggling is
If I use match (n)-[:HAS_TRANSLATION]->(tr:Translation) for n3 i will get 2 non "en" nodes, but i want to pick one of them only.... can i write a query for that so that it gives one node for n3 -> either the tr or the esp one... remember i will not know what translation i have for a node befor hand.
Thanks in advance...
Those were examples.... and there is no second requirement... just wanted a help to understand how to achieve the scenario of getting all nodes irrespecitive of language choice... So to clarify more
I have
Thank you once again, but seems like my question is not clear.....
first of all i do not know what are the languages that can come... each node has several translations.... i will pass one translation code in my query... -> here it is "en"... and i want back all nodes with "en" translation PLUS also those nodes who do not have "en" but atleast have one translation in any code...
So if i have a data like
n1 has english, turkish translation,
n2 has english translation
n3 has spanish, german translation
Then i want output like
n1 -> with english translation
n2 -> with english translation
n3 -> with either one of spanish or german translation
Thank u.. this is what I was looking for.. and once again sorry to make it so complicated in my question
Wish I could have written a better title for this topic so that in future people can readily find this solution.