Re: NEW PREFERENCE - return=query-result

James M Snell <jasnell@gmail.com> Fri, 11 September 2015 17:14 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E09891A6FFE for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 11 Sep 2015 10:14:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.012
X-Spam-Level:
X-Spam-Status: No, score=-7.012 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T3YIZAFpaD5f for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 11 Sep 2015 10:14:39 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8FE6F1B386B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 11 Sep 2015 10:14:39 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1ZaRrW-0005py-En for ietf-http-wg-dist@listhub.w3.org; Fri, 11 Sep 2015 17:11:46 +0000
Resent-Date: Fri, 11 Sep 2015 17:11:46 +0000
Resent-Message-Id: <E1ZaRrW-0005py-En@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <jasnell@gmail.com>) id 1ZaRrQ-0005pD-TC for ietf-http-wg@listhub.w3.org; Fri, 11 Sep 2015 17:11:40 +0000
Received: from mail-io0-f172.google.com ([209.85.223.172]) by lisa.w3.org with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from <jasnell@gmail.com>) id 1ZaRrP-0002da-3O for ietf-http-wg@w3.org; Fri, 11 Sep 2015 17:11:40 +0000
Received: by ioii196 with SMTP id i196so105334485ioi.3 for <ietf-http-wg@w3.org>; Fri, 11 Sep 2015 10:11:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Xn2y+F7vQ3+9cHVyrs2yMsEfWAJm5Z8UkmgtEM6y/JU=; b=fDr9J9Mlcj52e4fztEUvv6z41W1XUrs7qXd9QRXyXxGjWVvQfeOIppYIp29cDyBT3U 879E8HFGxxiMnBuoYiSZR9KgvGrWIxrzjly/Jhu4lQT919gH262foVv0+0fabVfmJvju AZ3bonY/U8+ZNOOEfGgwASIfG7DzE3mEC/XgV85aADCtv7otWGUY9XlpBnvDOyhVe4NA ZUf2vFYPJiXmJ3Dckk4/KGKG/OOongbDuTTD4ntAkREOV2MsZ7Q7KTedjjbD8RvufxoP P5URw82gPvzAH4I8KfyXa3KCNf9FmO9bR5i9SFw+DipUfK2V5vW1IAdDn8y6FSQbfNZA AU5Q==
X-Received: by 10.107.164.91 with SMTP id n88mr5868970ioe.88.1441991472949; Fri, 11 Sep 2015 10:11:12 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.36.1.65 with HTTP; Fri, 11 Sep 2015 10:10:53 -0700 (PDT)
In-Reply-To: <44321676-D9B4-484C-A490-F5FFCE071D26@oracle.com>
References: <55F1FAB3.2050808@oracle.com> <44321676-D9B4-484C-A490-F5FFCE071D26@oracle.com>
From: James M Snell <jasnell@gmail.com>
Date: Fri, 11 Sep 2015 10:10:53 -0700
Message-ID: <CABP7RbcMTDEM6VOT7ydBTvbH0B6eTYWqVbeV6qcj-KSh7ertLw@mail.gmail.com>
To: Phil Hunt <phil.hunt@oracle.com>
Cc: Ning Dong <ning.dong@oracle.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.223.172; envelope-from=jasnell@gmail.com; helo=mail-io0-f172.google.com
X-W3C-Hub-Spam-Status: No, score=-7.9
X-W3C-Hub-Spam-Report: AWL=1.779, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1ZaRrP-0002da-3O d98034a1675408a3175a2df47c2b15a1
X-Original-To: ietf-http-wg@w3.org
Subject: Re: NEW PREFERENCE - return=query-result
Archived-At: <http://www.w3.org/mid/CABP7RbcMTDEM6VOT7ydBTvbH0B6eTYWqVbeV6qcj-KSh7ertLw@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/30197
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

To be honest, I'm entirely  -1 on a preference for query-result. If
you want something like this, use PUT or POST to create the stored
query, then create a new resource that you can either use GET or
SEARCH (http://tools.ietf.org/html/draft-snell-search-method-00) on.
In my opinion, `query-result` would entirely be an abuse of the
preference mechanism.

On Fri, Sep 11, 2015 at 8:56 AM, Phil Hunt <phil.hunt@oracle.com> wrote:
> This is difficult. Two conventions are in collision.  The definition of post to create a resource and the expectation that a query returns a result.
>
> I would maybe tip the scales in favor of what most Oracle apis would need as a default.
>
> Would it be true that clients want to create stored searches by default?
>
> Phil
>
>> On Sep 10, 2015, at 14:49, Ning Dong <ning.dong@oracle.com> wrote:
>>
>> Hi,
>>    Could you please review the request of adding a new value for return prefer header?
>>
>>    The new value is "query-result", which is used when creating a query definition resource with POST or PUT request.
>>    The client would like the server to create the query definition resource, but also execute the query and return the query result.
>>    For example,
>>    POST /employees/searches HTTP/1.1
>>    Host: example.org
>>    Content-Type: application/json
>>    Prefer: return=query-result
>>
>>    {
>>        "q": "name eq foo",
>>        "fields": ["name","age","startdate"],
>>        "orderBy": ["name","age:desc"]
>>    }
>>
>>    This above resource defines a query (equivalent to select name, age, startdate from employees where employees.name='foo' order by name, age desc).
>>    Without the Prefer: return=query-result header, the server would just create a new resource and return a 201 response.
>>    If server honors the prefer header, then the server will not only create a new resource, but also execute the query based on the query definition.
>>    The response body will contain the result of the query execution, such as:
>>    201 Created
>>    Preference-Applied: return=query-result
>>    Location: http://example.com/employees/searches/q1
>>    Content-Location: http://example.com/employees/searches/q1/result
>>
>>    {
>>      "items": [
>>        {"name": "foo",
>>         "age": 35,
>>         "startdate": "2008-02-15"}
>>      ]
>>    }
>>
>> o  Preference: return
>>
>>  o  Value: query-result
>>
>>  o  Optional Parameters: n/a
>>
>>  o  Description: It is used to indicate that result of the query execution is preferred in the response.
>>
>>  o  Reference: Oracle will add a new sub type (type=query-def) in application/vnd.oracle.resource+json media type. This new sub type uses return=query-result prefer header.
>>     The application/vnd.oracle.resource+json media type is defined at:
>>     http://www.oracle.com/webfolder/technetwork/tutorials/appdevinfo/New%20REST%20Media%20Type.pdf
>>
>>  o  Notes: It is related to another request to add "transient" prefer header.
>>
>>
>>    Thanks and appreciate your review.
>>
>>
>> Ning
>>
>>
>>
>>
>