-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find shortest Path between two nodes and return the paths. #427
Comments
I'm not sure what you're trying - the Cypher you say works, vs the .NET code you've written are dramatically different. The Does the Cypher translation of your .NET code work? public async Task<SkillRating> GetSkillRatingForSkillAndDegree(Guid skillId, Guid degreeId)
{
try
{
var query = _client.Cypher
.Match("(iSkill:ISkill)-[r]-(iSkillRating:ISkillRating)")
.OptionalMatch("(iSkillRating:ISkillRating)-[r]-(iDegree:IDegree)")
.Where((ISkill iSkill) => iSkill.Id == skillId)
.AndWhere((IDegree iDegree) => iDegree.Id == degreeId)
.Return(iSkillRating => iSkillRating.As<SkillRating>());
//This line here!
Console.WriteLine($"Query: {query.Query.DebugQueryText}");
var result = await query.ResultsAsync;
return result.FirstOrDefault();
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
} |
Hey there @cskardon , The return of SkillRating is the desired outcome, but because this Method didn't work for me i tried the path solution. Skill =HasRating => SkillRating =For=> Degree The input values are the ID of Skill and Degree. |
So, I guess, do you have a working Cypher statement which does return the SkillRating using the My assumption would be that Skill and Degree have to be there, so I wouldn't be using an I would probably be writing something like: var query = _client.Cypher
.Match("(iSkill:ISkill)-[:HasRating]->(iSkillRating:ISkillRating)-[:For]->(iDegree:IDegree)")
/*The rest*/ |
Thank you very much @cskardon . |
Hey there,
I am new to cypher and neo4j and looking for a sulution to find the shortest path between two nodes.
This code worked on planc cypher for me, but i need it for the client:
I tried a different approach with this Method to match the Relations to ISkillRating but i only got return count = 0
Does anybody know the command or function, which has to be called?
The text was updated successfully, but these errors were encountered: