adlnet / xAPI-Spec

The xAPI Specification describes communication about learner activity and experiences between technologies.
https://adlnet.gov/projects/xapi/
898 stars 404 forks source link

Question: Do time/sequence filters missing a target reference still return the source when it matches? #1044

Open ryasmi opened 7 years ago

ryasmi commented 7 years ago

Hey guys, just wanted to check my assumptions around retrieving statement references.

Spec Commit Hash 7a801f0

Question Is A returned when the following is true?

Relevant part of the spec

For filter parameters which are not time or sequence based (that is, other than "since", "until", or "limit"), Statements which target another Statement (by using a StatementRef as the Object of the Statement) will meet the filter condition if the targeted Statement meets the filter condition.

The time and sequence based parameters MUST still be applied to the Statement making the StatementRef in this manner. This rule applies recursively, so that "Statement a" is a match when a targets b which targets c and the filter conditions described above match for "Statement c".

ryasmi commented 7 years ago

I really couldn't think of a better title for this issue, sorry.

garemoko commented 7 years ago

"This rule" is a little ambiguous, but earlier versions of the spec did not have that paragraph break and I'm confident that it refers to the targeting process, not the time and sequencing exception. The way I understand this is that, first the targeting rules are applied recursively and then the time and sequence filter is applied.

So my answer is yes, statement A should be returned.

ryasmi commented 7 years ago

Brilliant, thanks @garemoko, this is exactly how I understood it. Perhaps it should be re-ordered slightly like this:

For filter parameters which are not time or sequence based (that is, other than "since", "until", or "limit"), Statements which target another Statement (by using a StatementRef as the Object of the Statement) will meet the filter condition if the targeted Statement meets the filter condition.

This rule applies recursively, so that "Statement a" is a match when a targets b which targets c and the filter conditions described above match for "Statement c".

The time and sequence based parameters MUST still be applied to the Statement making the StatementRef.

garemoko commented 7 years ago

@ryansmith94 yes, something like that sounds sensible. Please can i get you to re-open the issue as a reminder for somebody to make that change?

ryasmi commented 7 years ago

Okay, yeah no worries.