Re: [apps-discuss] WebFinger payload as array or object
James M Snell <jasnell@gmail.com> Thu, 29 November 2012 22:01 UTC
Return-Path: <jasnell@gmail.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 361E821F85C3 for <apps-discuss@ietfa.amsl.com>; Thu, 29 Nov 2012 14:01:18 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.298
X-Spam-Level:
X-Spam-Status: No, score=-3.298 tagged_above=-999 required=5 tests=[AWL=-0.300, BAYES_00=-2.599, HTML_MESSAGE=0.001, J_CHICKENPOX_38=0.6, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1RzEJQUIsRgA for <apps-discuss@ietfa.amsl.com>; Thu, 29 Nov 2012 14:01:16 -0800 (PST)
Received: from mail-oa0-f44.google.com (mail-oa0-f44.google.com [209.85.219.44]) by ietfa.amsl.com (Postfix) with ESMTP id 1E8F321F8508 for <apps-discuss@ietf.org>; Thu, 29 Nov 2012 14:01:16 -0800 (PST)
Received: by mail-oa0-f44.google.com with SMTP id n5so16534659oag.31 for <apps-discuss@ietf.org>; Thu, 29 Nov 2012 14:01:15 -0800 (PST)
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=sCRXYfAaEQOBOm5djRIQXjVd//DBlMi1fVh367DwTwE=; b=MvCQMp+lzEajxJNx7TKXqXtYpBtJoUvd9//NoKLER76EpQ4qhSubbA5XK6uof0kXad tW2qsWGplUiWyZNofgA9mgdkv8Fxw1kQRCgm7E1TeBzVUFJnidrWXqrhuyGgDFD+ptUg aKP9jp4K+VKbSna5mICdl5akhZna22ylxdAmngFXfr8/xu8VfvS9ckJNF6+bZmtaDGjL opX2HzS5vE3r48H9kO+OLf+W1rB7e8YMp/iB4XscqjRcsdxzCuHHhZ3vvu4/H01okFS/ tMu2HqLnZBw2Ydm1UeVng1jXkHm8f8GF1MV+JdVDOEzfMHV/l8CArZUt6dd6Fo0klGF3 X84g==
Received: by 10.60.32.210 with SMTP id l18mr2934892oei.99.1354226475570; Thu, 29 Nov 2012 14:01:15 -0800 (PST)
MIME-Version: 1.0
Received: by 10.76.68.37 with HTTP; Thu, 29 Nov 2012 14:00:55 -0800 (PST)
In-Reply-To: <3C24A51B-2D83-4142-896F-8C587BC045D2@josephholsten.com>
References: <CAHBU6itq44z7c8F=+-bqQqpv5Eoki-Lqi+jJoLT8tL71jY8VTg@mail.gmail.com> <CABP7RbcZU5CSL5G4b6dPyiOiSWTQV+Vmu09KQ1CSda3inYgwjw@mail.gmail.com> <CAKaEYh+edYgtYEpmUFCD6h=vgon=c1tgdhhfv+FuQ_AoM6KoKQ@mail.gmail.com> <CAPW_8m6brQ-5wX8-659XuxE+LaPOftYVsb767Z9_SLHr8du4QA@mail.gmail.com> <CANqiZJZK66tT_N1JfCj1WqMxVeO0Jtd9au_xnuGtqE-8VzvPcg@mail.gmail.com> <014701cdce69$c51ef240$4f5cd6c0$@packetizer.com> <CANqiZJb3xGZ6MvabLKCfFx-Ps0i1jFkY47jehw8v-s+2Nk_JJw@mail.gmail.com> <3C24A51B-2D83-4142-896F-8C587BC045D2@josephholsten.com>
From: James M Snell <jasnell@gmail.com>
Date: Thu, 29 Nov 2012 14:00:55 -0800
Message-ID: <CABP7RbeBdx59eyCOyMqEh4d-MpdkUi3kBG7hLHmmnp16NRd-hw@mail.gmail.com>
To: Joseph Holsten <joseph@josephholsten.com>
Content-Type: multipart/alternative; boundary="e89a8f83a90905946d04cfa96c8b"
Cc: "webfinger@googlegroups.com" <webfinger@googlegroups.com>, IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] WebFinger payload as array or object
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Nov 2012 22:01:18 -0000
Better approach where order doesn't matter... { ... "links": [ {"rel": "icon", "href": "/tiny.png"}, {"rel": "icon", "href": "/big-n-shiny.png", "media": "only screen and (min-device-pixel-ratio : 2)"} ] } On Thu, Nov 29, 2012 at 1:55 PM, Joseph Holsten <joseph@josephholsten.com>wrote: > "I want a pretty icon to represent this account," says the web app. "I > know, I'll see what their webfinger says!" > > { ... > "links": [ > {"rel": "apple-touch-icon-precomposed", "href": > "/big-n-shiny.png"}, > {"rel": "icon", "href": "/tiny.png"} > ] > } > > > -- > http://josephholsten.com > > On Nov 29, 2012, at 13:22, Mike Kelly <mikekelly321@gmail.com> wrote: > > > That makes sense, I was wondering what kind of application behaviour > > would need a way to indicate preference between links of different > > rel? I can't envisage that use-case. > > > > On Thu, Nov 29, 2012 at 7:43 PM, Paul E. Jones <paulej@packetizer.com> > wrote: > >> Several times, people have asked "how do I know which of n things is the > >> most preferred". Ordering is a good way to indicate preference. > >> > >> Paul > >> > >>> -----Original Message----- > >>> From: apps-discuss-bounces@ietf.org [mailto:apps-discuss- > >>> bounces@ietf.org] On Behalf Of Mike Kelly > >>> Sent: Thursday, November 29, 2012 11:56 AM > >>> To: mike amundsen > >>> Cc: Joe Gregorio; IETF Apps Discuss; webfinger@googlegroups.com > >>> Subject: Re: [apps-discuss] WebFinger payload as array or object > >>> > >>> Hey Mike, > >>> > >>> I'm not sure I understand the use-case for selecting a link on the > basis > >>> of the order in which it appears in the representation.. not over and > >>> above selecting by rel anyway. I think it might help me to see an > >>> example where a client would need to select a link this way. > >>> > >>> Are you bringing this up as a small point of difference or a > fundamental > >>> advantage? > >>> > >>> Cheers, > >>> M > >>> > >>> On Thu, Nov 29, 2012 at 4:41 PM, mike amundsen <mamund@yahoo.com> > wrote: > >>>> jumping in here... > >>>> > >>>> keep in mind that JSON/Javascript does not retain ordering for hash > >>>> dictionaries, but *does* retain ordering for arrays. > >>>> > >>>> for this reason, i have adopted a style similar to your "Plan A" when > >>>> sending link collections in the JSON format; esp. when that collection > >>>> might vary over time (or via context details of the request). > >>>> > >>>> Cheers. > >>>> > >>>> mamund > >>>> +1.859.757.1449 > >>>> skype: mca.amundsen > >>>> http://amundsen.com/blog/ > >>>> http://twitter.com/mamund > >>>> https://github.com/mamund > >>>> http://www.linkedin.com/in/mikeamundsen > >>>> > >>>> > >>>> > >>>> On Thu, Nov 29, 2012 at 11:37 AM, Melvin Carvalho > >>>> <melvincarvalho@gmail.com> > >>>> wrote: > >>>>> > >>>>> > >>>>> > >>>>> On 29 November 2012 17:29, James M Snell <jasnell@gmail.com> wrote: > >>>>>> > >>>>>> > >>>>>> On Thu, Nov 29, 2012 at 8:19 AM, Tim Bray <tbray@textuality.com> > >>> wrote: > >>>>>>> > >>>>>>> This thread has bifurcated, so I'm going to formalize that with a > >>>>>>> subject change. > >>>>>>> > >>>>>>> On this thread, please argue about turning the WebFinger payload > >>>>>>> inside > >>>>>>> out: > >>>>>>> > >>>>>>> Plan A: > >>>>>>> > >>>>>>> "links" : [ > >>>>>>> { "rel": "rel1", "href" : "http://example/1", "type" : > >>>>>>> "text/plain" }, { "rel": "rel2", "href" : "http://example/2" > >>> "type" : > >>>>>>> "application/json" } > >>>>>>> ] > >>>>>>> > >>>>>>> Plan B: > >>>>>>> > >>>>>>> "links" : { > >>>>>>> "rel1" : { "href" : "http://example/1", "type" : "text/plain" }, > >>>>>>> "rel2" : { "href" : "http://example/2" "type" : > "application/json" > >>>>>>> } } > >>>>>> > >>>>>> Plan C: > >>>>>> > >>>>>> "links" : { > >>>>>> "rel1" : [{ "href" : "http://example/1", "type" : "text/plain" }, > >>>>>> { "href" : "http://example/2", "type" : "text/plain" > >>>>>> }], "rel2" : [{ "href" : "http://example/3" "type" : > >>>>>> "application/json" }] } > >>>>>> > >>>>>> For me, the options are Plan A or Plan C, as those are the only ones > >>>>>> that allow multiple instances of a single link relation. Plan A > >>>>>> requires you to process through the whole set of links to find all > >>>>>> instances of a single link relation. Plan C allows you to select > >>>>>> individual link relations and then process that specific array of > >>> links. > >>>>> > >>>>> > >>>>> Like Plan C also ... seems very similar (perhaps isomorphic?) to plan > >>>>> A with a slightly neater syntax. > >>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> My take: It doesn't matter very much. Plan A feels a little > >>>>>>> cleaner to me, but it's not worth the time/energy to argue over. > >>>>>>> -T > >>>>>> > >>>>>> Agreed. Again, this mainly just comes down to painting the barn > >>> really. > >>>>>> > >>>>>> - James > >>>>>> > >>>>>>> > >>>>>>> > >>>>>>> On Thu, Nov 29, 2012 at 8:02 AM, Melvin Carvalho > >>>>>>> <melvincarvalho@gmail.com> wrote: > >>>>>>>> > >>>>>>>> > >>>>>>>> On 29 November 2012 16:50, James M Snell <jasnell@gmail.com> > >>> wrote: > >>>>>>>>> > >>>>>>>>> +1 to everything Tim and Joe have said. Simpler is better. > >>>>>>>>> > >>>>>>>>> Fwiw, the approach I took with JSON activity streams [1] was to > >>>>>>>>> use rel values as member names to make client code more > >>>>>>>>> efficient, and have the values be arrays of link objects to > >>>>>>>>> allow multiple links... > >>>>>>>>> > >>>>>>>>> E.g.... > >>>>>>>>> > >>>>>>>>> { > >>>>>>>>> "blog": [ > >>>>>>>>> {"href": "http://...", ...}, > >>>>>>>>> {"href": "http://...", ...} > >>>>>>>>> ] > >>>>>>>>> } > >>>>>>>>> > >>>>>>>>> I know this part mostly comes down to a style choice, but this > >>>>>>>>> structure ends up being very efficient when it comes to picking > >>>>>>>>> out just the link relations you want while ignoring everything > >>>>>>>>> else. > >>>>>>>> > >>>>>>>> You may find this reference page valuable > >>>>>>>> > >>>>>>>> http://www.w3.org/2011/rdf-wg/wiki/JSON-Serialization-Examples > >>>>>>>> > >>>>>>>> It contains various json serialization standards > >>>>>>>> > >>>>>>>> 1.2.1 Shared Example for Serialization Lineup (Turtle) > >>>>>>>> 1.2.2 Linked Data API > >>>>>>>> 1.2.3 JRON > >>>>>>>> 1.2.4 JSN3 > >>>>>>>> 1.2.5 JSON-LD (CURIEs) > >>>>>>>> 1.2.6 JSON-LD (terms) > >>>>>>>> 1.2.7 JTriples > >>>>>>>> 1.2.8 RDF/JSON > >>>>>>>> 1.2.9 RDFj > >>>>>>>> 1.2.10 SPARQL Query Results in JSON > >>>>>>>> 1.2.11 Flat triples approach to RDF graphs in JSON > >>>>>>>> > >>>>>>>> Essentially the common parts are part of the Entity Attribute > >>>>>>>> Value model (aka subject predicate object) > >>>>>>>> > >>>>>>>> Activity streams is also a neat serialization with its own > >>>>>>>> content type. > >>>>>>>> > >>>>>>>> Personally I think JRD is one of the weaker serializations out > >>> there. > >>>>>>>> Though it seems incredibly tightly coupled to webfinger, for > >>>>>>>> historical, and perhaps some social, reasons. I've yet to hear > >>>>>>>> the full rationale for this, articulated. > >>>>>>>>> > >>>>>>>>> - james > >>>>>>>>> > >>>>>>>>> On Nov 29, 2012 6:11 AM, "Joe Gregorio" <joe@bitworking.org> > >>> wrote: > >>>>>>>>>> > >>>>>>>>>> On Thu, Nov 29, 2012 at 12:36 AM, Paul E. Jones > >>>>>>>>>> <paulej@packetizer.com> > >>>>>>>>>> wrote: > >>>>>>>>>>> Joe, > >>>>>>>>>>> > >>>>>>>>>>> But, the JRD syntax is already defined. Just pretend XRD > >>>>>>>>>>> never existed. > >>>>>>>>>>> Look at JRD on its own. It's simple. Why go make a bunch of > >>>>>>>>>>> changes to it now? > >>>>>>>>>> > >>>>>>>>>> I don't think Tim's proposal is a large number of changes, his > >>>>>>>>>> proposal drops expires which doesn't belong in the file, and it > >>>>>>>>>> drops properties. > >>>>>>>>>> > >>>>>>>>>> I don't think properties, at the links level, are a good thing > >>>>>>>>>> and the sample from the spec for configuring a printer is a > >>>>>>>>>> perfect example: > >>>>>>>>>> > >>>>>>>>>> { > >>>>>>>>>> "rel" : "http://example.net/rel/smtp-server", > >>>>>>>>>> "properties" : > >>>>>>>>>> { > >>>>>>>>>> "host" : "smtp.example.com", > >>>>>>>>>> "port" : "587", > >>>>>>>>>> "login-required" : "yes", > >>>>>>>>>> "transport" : "starttls" > >>>>>>>>>> } > >>>>>>>>>> }, > >>>>>>>>>> > >>>>>>>>>> That really should be: > >>>>>>>>>> > >>>>>>>>>> { > >>>>>>>>>> "rel" : "http://example.net/rel/smtp-server", > >>>>>>>>>> "href": "https://smtp.packetizer.com/config.dat" > >>>>>>>>>> }, > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> Where https://smtp.packetizer.com/config.dat is a file format > >>>>>>>>>> that contains the information in the properties, such as host, > >>>>>>>>>> port, transport, etc. > >>>>>>>>>> > >>>>>>>>>> I think that keeps the WebFinger story simple, the file format > >>>>>>>>>> is basic information about the entity you queried about > >>>>>>>>>> (subject, alias, properties), and then links related to that > >>>>>>>>>> entity. > >>>>>>>>>> > >>>>>>>>>> I don't believe WebFinger won't get wide adoption if you can't > >>>>>>>>>> put SMTP configuration info directly into the WF response. > >>>>>>>>>> > >>>>>>>>>> I don't believe WebFinger won't get wide adoption if you have > >>>>>>>>>> to do two requests to find that SMTP configuration info. > >>>>>>>>>> > >>>>>>>>>> I do believe WebFinger will get wide adoption if the format is > >>>>>>>>>> as simple as possible. > >>>>>>>>>> > >>>>>>>>>> I would be fine with keeping the top level properties object. > >>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> I can appreciate documenting all of JRD fully in the spec. > >>>>>>>>>>> Who wants to do that? I don't want to write that. Was Tim > >>>>>>>>>>> volunteering? > >>>>>>>>>> > >>>>>>>>>> Yes, I believe Tim was volunteering to do that, but he can > >>>>>>>>>> answer for himself. > >>>>>>>>>> > >>>>>>>>>> -joe > >>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> Paul > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> -- > >>>>>>>>>> Joe Gregorio http://bitworking.org > >>>>>>>>>> _______________________________________________ > >>>>>>>>>> apps-discuss mailing list > >>>>>>>>>> apps-discuss@ietf.org > >>>>>>>>>> https://www.ietf.org/mailman/listinfo/apps-discuss > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> _______________________________________________ > >>>>>>>>> apps-discuss mailing list > >>>>>>>>> apps-discuss@ietf.org > >>>>>>>>> https://www.ietf.org/mailman/listinfo/apps-discuss > >>>>>>>> > >>>>>>>> > >>>>>>>> _______________________________________________ > >>>>>>>> apps-discuss mailing list > >>>>>>>> apps-discuss@ietf.org > >>>>>>>> https://www.ietf.org/mailman/listinfo/apps-discuss > >>>>> > >>>>> > >>>>> _______________________________________________ > >>>>> apps-discuss mailing list > >>>>> apps-discuss@ietf.org > >>>>> https://www.ietf.org/mailman/listinfo/apps-discuss > >>>> > >>>> > >>>> _______________________________________________ > >>>> apps-discuss mailing list > >>>> apps-discuss@ietf.org > >>>> https://www.ietf.org/mailman/listinfo/apps-discuss > >>> > >>> > >>> > >>> -- > >>> Mike > >>> > >>> http://twitter.com/mikekelly85 > >>> http://github.com/mikekelly > >>> http://linkedin.com/in/mikekelly123 > >>> _______________________________________________ > >>> apps-discuss mailing list > >>> apps-discuss@ietf.org > >>> https://www.ietf.org/mailman/listinfo/apps-discuss > > > > > > > > -- > > Mike > > > > http://twitter.com/mikekelly85 > > http://github.com/mikekelly > > http://linkedin.com/in/mikekelly123 > _______________________________________________ > apps-discuss mailing list > apps-discuss@ietf.org > https://www.ietf.org/mailman/listinfo/apps-discuss >
- [apps-discuss] WebFinger payload as array or obje… Tim Bray
- Re: [apps-discuss] WebFinger payload as array or … Joe Gregorio
- Re: [apps-discuss] WebFinger payload as array or … Melvin Carvalho
- Re: [apps-discuss] WebFinger payload as array or … James M Snell
- Re: [apps-discuss] WebFinger payload as array or … Melvin Carvalho
- Re: [apps-discuss] WebFinger payload as array or … mike amundsen
- Re: [apps-discuss] WebFinger payload as array or … Mike Kelly
- Re: [apps-discuss] WebFinger payload as array or … mike amundsen
- Re: [apps-discuss] WebFinger payload as array or … Mike Kelly
- Re: [apps-discuss] WebFinger payload as array or … Mike Kelly
- Re: [apps-discuss] WebFinger payload as array or … Joseph Holsten
- Re: [apps-discuss] WebFinger payload as array or … Paul E. Jones
- Re: [apps-discuss] WebFinger payload as array or … Mike Kelly
- Re: [apps-discuss] WebFinger payload as array or … Joseph Holsten
- Re: [apps-discuss] WebFinger payload as array or … James M Snell
- Re: [apps-discuss] WebFinger payload as array or … Mike Kelly
- Re: [apps-discuss] WebFinger payload as array or … Joseph Holsten
- Re: [apps-discuss] WebFinger payload as array or … Mike Kelly
- Re: [apps-discuss] WebFinger payload as array or … Markus Lanthaler
- Re: [apps-discuss] WebFinger payload as array or … ☮ elf Pavlik ☮
- Re: [apps-discuss] WebFinger payload as array or … Nick Jennings
- Re: [apps-discuss] WebFinger payload as array or … Mike Kelly
- Re: [apps-discuss] WebFinger payload as array or … Markus Lanthaler
- Re: [apps-discuss] WebFinger payload as array or … chris.dent