Closed hoechp closed 7 years ago
What I got wrong (here's an example): node with attribute 'type': 'Car' and edge to negative node with attributes 'type': 'Wheel' and 'color': 'blue' means "a car that has no blue wheel".
A negative node is not supposed to match with anything. Effectively, you look for a match of the rest of the Pattern - not minding the negative node. Whenever a match is then found, you try to find this negative node in context of the current match. If you don't find it - it's all fine. If you do find it, this match doesn't work out and the search continues with the next valid configuration of matchable nodes for the main pattern. Something like that. Gotta figure that out and write some tests!
Previously, we decided to get rid of those sub-graphs inside of
PatternGraph
, which already made things a lot easier.But it's not exactly clear to me, what negative pattern elements mean - at least not in every case.
PatternNode
s,PatternEdges
s andPatternAttribute
s have theaction
attribute, which usually should be "match", "create" or "remove". Additionally they all have thenegative
attribute, which only makes sense for those withaction
== "match". So probably, we could get rid of thisnegative
attribute, too - and replace it with another value for theaction
attribute. It could just have "==", "!=", "+" and "-" as values, for example.So to get to the point - my interpretation is:
PatternNode
matches exactly thoseNode
s, the positivePatternNode
would not match (concerning only its attributes).PatternEdge
from onePatternNode
to another means, that they can only matchNode
s, that don't have this edge between themPatternAttribute
means the attribute is not allowed to fulfill the condition