Hi, I am Kausik. I am new to dgraph. I have a question/suggestion on how to implement Decision using dgraph. The decision output is user category (rich, vrich or avg)
Assume this scenario. There are few nodes of type user,cars and status and two types of Edge or relation(Rule and Decision)
The Rule or Edge connects user with cars nodes and cars nodes are connected to status nodes by Decision edge.
The Rule type edge contains brand as (Facets) {var:“brand”,val:“audi”}
The Decision type edge contains number of car owned. {var:“number”,val:2}
the last nodes type decides user category (rich, vrich or avg)
typically the query would be something like below to find user category.(incomplete)
{
"query": "query test($a: {}) {
me(func: type(user)) {
name
rule @facet(type(rule){
}
}
}
}",
"variables": {"brand":"Audi","number":2,duration:2}
}
visualisation untitled — ImgBB
This kind of functionality is available in Neo4j where you can pass JSON as param and iterate over all matching relationship and check it with json to get final decision.
Example of such neo4j cypher query : with {“brand”:“Audi”,“number”:2} as param MATCH p = (:user)-[*]->(endNode:decision) WHERE ALL (r in relationships§ WHERE r.val=param[r.var] ) return endNode
Please let me know for any clarification if required.