Closed clenk closed 3 years ago
We talked about this on an editors call and agree. This change has been made.
This IMO, is a significant change, and needs to be discussed further (it makes previously invalid patterns valid). This text that is being changed was added because people did not feel that this was clear enough:
That is, when resolving object paths of each Comparison Expression, the
: MUST start from the same SCO. Different SCO's may ultimately be used in matching, but they MUST be referenced from the same, single SCO.
The problem is that the example given:
(type-a:a=1 OR type-b:b=2) AND (type-a:a=2 OR type-b:b=1)
If it was compared to a observed data object like:
{
"objects": [
{ "type": "type-a", "a": 1 },
{ "type": "type-b", "b": 1 },
]
}
It could be argued that the object matches the above pattern, but the specification requires that this object NOT match the above pattern, and this clarification, IMO, adds confusion, as the pattern is "satisfiable", but does not make it clear that the above MUST NOT match due to the above quoted text.
This also introduces a significant change between STIX 2.0 and 2.1 making the languages incompatible. The TC explicitly chose not to make significant changes to patterning for 2.1, so IMO this change should be reverted. I am fine w/ further clarification of the rules, but this is a material change IMO.
This IMO, is a significant change, and needs to be discussed further (it makes previously invalid patterns valid).
Your concern here is about pattern validity (i.e. spec compliance), whereas:
It could be argued that the object matches the above pattern, but the specification requires that this object NOT match the above pattern
this concern is about how patterns match. You may be conflating the two. My intent was to clarify the criteria for pattern validity. I intended no change to how patterns match observations. In your example, the pattern does not match. As far as I am aware, that has not changed (but I am not as up-to-date regarding the details of the latest standardization activities). It is nevertheless a valid pattern.
Given JMG's analysis and explanation on this being a material change then I would suggest we defer to a future release. It would seem that there are crude work-arounds to this problem within systems that are performing pattern matching where they could combine the result of two patterns themselves outside of the STIX pattern grammar. They have to have this type of capability anyway where multiple patterns may be getting matched to a condition and therefore handling conflicts and multiple hits of patterns has to be done regardless of what is fixed in this specific case. I suggest deferral.
We will talk about this again next week.
After talking about this again, we made one more minor tweak. The new text is:
All operands of AND in an Observation Expression MUST be satisfiable with the same object.
Suggestion from @chisholm:
In section 9.5, change
to
Original comment (https://github.com/oasis-open/cti-python-stix2/pull/456):