I have two classes and one edge:
- Class:
Product - Class:
Parameter - Edge:
ProductHasParameterwith a propertyvalue
Question: How to find all Product that have 2 edges ProductHasParameter:
- with the
value=<SOME_VALUE_1> toParameterwith @rid=1 AND - with the
value=<SOME_VALUE_2> toParameterwith @rid=2
?
Example:
Question: Which Products have Color=red AND price=1000$?
In other words: Which vertexes of class Product have 2 edges ProductHasParameter:
- with a property
value=red toParameterwith @rid=8 AND - with a property
value=1000$ toParameterswith @rid=12
?
Note: There is a Product with @rid=2 that doesn't have any edges at all.
I expect to get only Product with @rid=1.
In Cypher, i can write the query like this:
MATCH (prd:Product)-[hasParameterColor:ProductHasParameter]->(paramColor:Parameter {@rid:"8"})
MATCH (prd:Product)-[hasParameterPrice:ProductHasParameter]->(paramPrice:Parameter {@rid:"12"})
WHERE hasParameterColor.value="red" AND hasParameterPrice.value="1000$"
RETURN pr

Try the below:
MATCH {class: ProductHasParameter, where:(value=1000)} selects all ProductHasParameter edges with value 1000 (filters out any other value other than 1000)
.outV() selects all the out vertices of the edges (cars) which implies card whose value is 1000 (can be of any color)
.outE('ProductHasParameter'){where:(value='red')} selects all the out ProductHasParameter edges from the vertices (cars) that has value red, the out vertices of these edges will have value as 1000 and color as red
.outV(){as: cars} selects the vertices back (cars)
I have not tested the query so cannot say if it works but the above thought process should filter out the cars you requires.