Logical operators in graph database (neo4j) -
edit: possible duplicate of: neo4j logic gate simulation, how to?
i have neo4j database contains options, optionvalues, configurations, products , logicalnodes. in concrete, configuration collection of selected optionvalues, 1 each option. logicalnodes on other hand try link combinations of optionvalues point 1 (or multiple) specific products.
you can see in graph there 3 options, 2 2 optionvalues , 1 1 optionvalue. every optionvalue linked product through 1 or more logicalnodes. logicalnodes can linked 1 , there 3 types of logicalnodes (and, or, not (not shown)).
now question, know how products related given configuration, not taking logicalnodes account, using cypher: match p = (:configuration {id:"conf1id"})-[r1*]->(pi:productinstance) return pi
however, fail come query uses logicalnodes filter out invalid paths. invalid (sub)path when:
- a logicalnode type equals "and" has more incoming :has_logic relations there in path.
- a logicalnode type equals "not" has incoming :has_logic relations exist in path.
has ever tried model graph containing logical information in graph , stumbled accross solution?
Comments
Post a Comment