<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi,<div><br></div><div>you are right that it does need some clarification, although as you note most implementations make the intended interpretation that the LAST filter is applied last, which is the crucial point, as without that neither “logical AND” nor “intersection or sets” alone will produce the intended interpretation.</div><div><br></div><div>Paul.<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 26 Jun 2024, at 23:04, Joshua Fraustro via grid <grid@ivoa.net> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">For services that implement the UWS pattern, the job list returned at the root /{jobs} path may be filtered using three parameters:<o:p></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><ul type="disc" style="margin-bottom: 0in; margin-top: 0in;"><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">PHASE: return only jobs with the supplied ExecutionPhase<o:p></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">AFTER: return jobs with a creationTime after the supplied datetime<o:p></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">LAST: return the last N jobs, ordered by creationTime, descending<o:p></o:p></li></ul><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">As described by the UWS document, under<span class="Apple-converted-space"> </span><a href="https://urldefense.com/v3/__https://www.ivoa.net/documents/UWS/20161024/REC-UWS-1.1-20161024.html*jobList__;Iw!!PDiH4ENfjr2_Jw!E1iP25arWzG2_X0Da9_n1-y8s8hZHgUt-UKH3YbG33aySrH4LqMD1fe1lOhMl0EstrJ1tinTyjxbG_odNPCm$" style="color: rgb(5, 99, 193); text-decoration: underline;">2.2.2.1 Job List [ivoa.net]</a>, “If multiple filters are specified by the client, then the server should return a jobs list which is the result of a logical AND of the various filter conditions”.<o:p></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Consider the following basic job list of only execution phase. Assume it has been appropriately presorted by creationTime.<o:p></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">job5: phase=PENDING # newest<o:p></o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">job4: phase=COMPLETED<o:p></o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">job3: phase=PENDING<o:p></o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">job2: phase=COMPLETED<o:p></o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">job1: phase=COMPLETED # oldest<o:p></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">A client provides the following filters in his query:<span class="Apple-converted-space"> </span><o:p></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 0.5in;"><o:p> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 0.5in;">/{jobs}?PHASE=COMPLETED&LAST=2<o:p></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><br>If the service performs these iteratively, which I think a programmer’s gut reaction would be, the orders could be:<o:p></o:p></div><ol start="1" type="1" style="margin-bottom: 0in; margin-top: 0in;"><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Filter by PHASE, then by LAST, the result would be<span class="Apple-converted-space"> </span><b>[job4, job2]</b>.<span class="Apple-converted-space"> </span><o:p></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">If the service evaluates by LAST, then by PHASE, the result would be<span class="Apple-converted-space"> </span><b>[job4]</b>.<o:p></o:p></li></ol><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><br>I know at MAST we use order 1, and doing some quick checking it appears that Vizier and GAVO do as well.<br><br>What I assume is meant by “logical AND” however, is closer to, “the intersection of the sets whose members are the results of the various filter conditions.” In which case the answer becomes:<br><br><o:p></o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">?PHASE=COMPLETED<br>[job4, job2, job1]<o:p></o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">AND<o:p></o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;">?LAST=2<br>[job5, job4]<br><br>==<br><br>[job4]<br><br><o:p></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Is this the intended meaning? If it is, we should probably clarify the language as such, as that would be the ‘<i>most correct</i>’ interpretation of “logical AND”. If not, we would need to decide what the prescribed evaluation order is.</div></div></div></blockquote></div><br></div></body></html>