Hi Sukaant, As Craig pointed out, the data is missing in the console. So it's hard to understand the context of node 0 and node 4. If you want nodes not at all related to 4 then again as Craig suggested, a NOT (m)-[:something]-(n) is perhaps what you're looking for.
Could you add data or describe the query better? Thanks Luanne On Mon, Mar 10, 2014 at 7:35 PM, Sukaant Chaudhary < [email protected]> wrote: > Hi Craig, > I'm trying the following query with *node "0" and node "4"* > > START m=node(4) OPTIONAL MATCH > (m)-[r:FOLLOWED_BY|CREATED_BY|FOLLOW_PENDING]->(n)-[l:LOCATION]->(t) WITH > r, n, l, t WHERE has(n.timeBoardName) AND n.timeBoardName =~ "(?i).*" AND > has(l.locationType) AND l.locationType = 'PERMANENT' RETURN r, n, t; > > > *In case of "0" it will give 3 results.* > *In case of "4" it will give 1 result.* > > But I want all the *4 results* in both the cases. > > -Sukaant Chaudhary > > [image: > linkedinbutton]<http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479/> > > > On Mon, Mar 10, 2014 at 7:32 PM, Craig Taverner <[email protected]> wrote: > >> That link has the query without a database to query, so it returns error. >> >> I note that you have a WITH between your OPTIONAL MATCH and your WHERE >> clause. Perhaps that is your mistake? Of course it depends on what you are >> actually trying to achieve, which is not very clear. Certainly your >> description of the question does not match the query you have written. >> >> For example, you say you want "*all the values which are not having >> these relations with node 4", *but the query is clearly looking for >> matches that DO have relations. What about using NOT? >> >> >> On Mon, Mar 10, 2014 at 2:57 PM, Sukaant Chaudhary < >> [email protected]> wrote: >> >>> Hi Luanne, >>> Please try the following URL: >>> http://console.neo4j.org/?id=sg95kp >>> >>> -Sukaant Chaudhary >>> >>> [image: >>> linkedinbutton]<http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479/> >>> >>> >>> On Mon, Mar 10, 2014 at 6:58 PM, Luanne Coutinho < >>> [email protected]> wrote: >>> >>>> Sukaant, can we please have a GraphGist >>>> <http://gist.neo4j.org/?5956246>or data at >>>> http://console.neo4j.orgindicating what kind of result you're expecting. >>>> Also please go through >>>> http://docs.neo4j.org/chunked/stable/query-optional-match.html to >>>> figure out whether optional match is suited for your query. >>>> >>>> -Luanne >>>> >>>> >>>> On Mon, Mar 10, 2014 at 6:47 PM, Sukaant Chaudhary < >>>> [email protected]> wrote: >>>> >>>>> Hi, >>>>> Here in Optional Match I'm getting only those values which are having >>>>> following relations with node 4 but I want all the values which are not >>>>> having these relations with node 4. >>>>> Please help me. >>>>> >>>>> START m=node(4) >>>>> OPTIONAL MATCH >>>>> (m)-[r:FOLLOWED_BY|CREATED_BY|FOLLOW_PENDING]->(n)-[l:LOCATION]->(t) >>>>> WITH r, n, l, t >>>>> WHERE has(n.timeBoardName) >>>>> AND n.timeBoardName =~ "(?i).*" >>>>> RETURN r, n, t; >>>>> >>>>> -Sukaant Chaudhary >>>>> >>>>> [image: >>>>> linkedinbutton]<http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479/> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Neo4j" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Neo4j" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Neo4j" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Neo4j" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
<<inline: image002.jpg>>
