0
votes

I am trying to get the following Cypher query written out in GraphClient:

START agency=node(12345)
MATCH agency
        -[:AGENCY_HAS_PEOPLE]-()
        -[:AGENCY_HAS_PERSON]-person
        ,person-[?:PERSON_IS_CARER]-carer
        ,person-[?:PERSON_IS_CLIENT]-client
WHERE (person.UniqueId! = 18989)   
RETURN person, carer is not null as IsCarer, client is not null as IsClient

The query works fine in the console and returns the results I expect:

person           IsCarer    IsClient
Node(1545421)    True       False

When I try to write that query using Neo4jClient, it throws the following exception.

Expression of type System.Linq.Expressions.LogicalBinaryExpression is not supported.

It is mainly due to the expression in the return statement:

.Start(...)
.Match(...)
.Where(...)
.Return((person, client, carer) => new
{
    Person = person.As<Person>(),
    IsClient = client != null
    IsCarer = carer != null
});

Is anyone already working on a solution for this? Is there a workaround for it? Is there any other way to write this query to get the same result? If I were to implement a solution for this, is there anything related to the internals of Neo4jClient (limitation, pitfalls) that I should know before I begin?

Thanks..

1

1 Answers

1
votes

It's a bug in https://github.com/Readify/Neo4jClient/blob/master/Neo4jClient/Cypher/CypherReturnExpressionBuilder.cs

  1. Fork the project
  2. Clone it locally
  3. Write a failing test that demonstrates the problem, in https://github.com/Readify/Neo4jClient/blob/master/Test/Cypher/CypherFluentQueryReturnTests.cs
  4. Fix the issue
  5. Commit and push your fix
  6. Open a pull request

When I'm happy with the quality of the solution, I'll accept and merge the pull request. The fix will then be published to NuGet within a few minutes.