Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D2C39B6C for ; Wed, 21 Mar 2012 12:48:00 +0000 (UTC) Received: (qmail 98337 invoked by uid 500); 21 Mar 2012 12:48:00 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 98295 invoked by uid 500); 21 Mar 2012 12:48:00 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 98286 invoked by uid 99); 21 Mar 2012 12:48:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2012 12:48:00 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stefan.guggisberg@gmail.com designates 209.85.210.170 as permitted sender) Received: from [209.85.210.170] (HELO mail-iy0-f170.google.com) (209.85.210.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2012 12:47:55 +0000 Received: by iaeh11 with SMTP id h11so3238548iae.1 for ; Wed, 21 Mar 2012 05:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Vy6avOapQlp9DPsymtmaEP6UZDJ4acV2u3QoZY8Cihs=; b=YqAe7ETRs4w1ljXDmkdSai03w0T5G59w13C030icq/A50ikLFHHX1vaYM/ZLRqyB9Y lrsVQDYIzKFxHQ1psFgIcqHIInmkShuZun6evdvkidwvEs2/2IBIGYhlZpcpykYeyOPQ n9MlxL5B4zwu7LjZ6F66USAvqoaTrm+ucbkEC5HXe/QUEmVgqgGeFIUEZ1mNGpL2FFDw KCXFaweugaKsrM4qm/0tWdIy/FLYMom0FeNTZWb8SbAd+3DQf3s/ulPeC/WPDErkO8oe 96fee351/kSepUnOALqTkSEebHHnm6vHITlQhd5icUGrWPBRBdQuARVQTi8Gf44Lgp36 FfUw== MIME-Version: 1.0 Received: by 10.50.159.198 with SMTP id xe6mr2990296igb.74.1332334055372; Wed, 21 Mar 2012 05:47:35 -0700 (PDT) Received: by 10.42.174.1 with HTTP; Wed, 21 Mar 2012 05:47:35 -0700 (PDT) In-Reply-To: <4F68C432.2080108@gmx.de> References: <20120320171207.96104.27975@eos.apache.org> <4F68C432.2080108@gmx.de> Date: Wed, 21 Mar 2012 13:47:35 +0100 Message-ID: Subject: Re: JSOP vs JSON-Patch, was: [Jackrabbit Wiki] Update of "Jsop" by stefan From: Stefan Guggisberg To: oak-dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Mar 20, 2012 at 6:53 PM, Julian Reschke wro= te: > Hi, > > so Stefan is cleaning up the JSOP Wiki page (thanks!). > > I think it's time to look again at the difference between the JSOP diff > format (as used in MK.commit()), and the IETF JSON Patch format, now > . > > JSOP has lost it's dependency on member ordering, and JSON Patch now has > "test" and "copy", so it seems the only missing gap is the metadata featu= re. WRT the set of operations (add, replace, copy et al) i agree that there's a nice 1:1 match. WRT the metadata feature. it might be useful in certain situations but i am not sure whether we really need it. > > If this is true, we can (mostly) define the JSOP diff format as a > transformation from JSON Patch. That might be useful in order to avoid > bikeshed discussions about syntax. i agree that it would be useful if we could define JSOP diff as a transform= ation from JSON Patch. however, after skim-reading the JSON Patch draft i noticed the following is= sues: - adding nested object trees doesn't seem to be explicitly covered, e.g. +"/a/b/c" : { "foo" : "bar"} the draft only talks about manipulating non-object members of a document. - the draft does explicitly cover manipulating arrays of values. that's not applicable to the mk data model (array values are not supported). furthermore, there= 's no equivalent jcr operation. > > One open issue seems to be escaping inside pathString; if a JSON member > contains a forward slash ("/"), how is it represented in a pathString? > > 1) We could define that it's not allowed to be in a member name, thus we > don't need escaping, or > > 2) We could adopt the escaping syntax from JSON Pointer (now "^"). > > 1) has the advantage of being simple. > > 2) has the advantage that it would work with generic JSON data, something= I > think we need to deal with if we want to use JSOP diff outside the MK wor= k. > > Thoughts? since forward slashes are not allowed in jcr names i guess it's not an issu= e for JSOP diff since "/" would need be encoded already according to the jcr rules. i would prefer 1) but i am fine with either 1) or 2). cheers stefan > > Best regards, Julian > > -------- Original Message -------- > Subject: [Jackrabbit Wiki] Update of "Jsop" by stefan > Date: Tue, 20 Mar 2012 17:12:07 -0000 > From: Apache Wiki > Reply-To: dev@jackrabbit.apache.org > To: Apache Wiki > > Dear Wiki user, > > You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" = for > change notification. > > The "Jsop" page has been changed by stefan: > http://wiki.apache.org/jackrabbit/Jsop?action=3Ddiff&rev1=3D42&rev2=3D43 > > Comment: > the order of child nodes & properties is unspecified. > > > =A0 * + pathString: object > > - The added node may contain child nodes. The order of child node is > preserved, that means, when requesting the object, the child nodes will > appear in the same order as they appear when the node was added. This onl= y > applies to child nodes however; it does not apply to the order of > properties. For example, an implementation may sort the properties by nam= e. > + The added node may contain child nodes. > > =A0'''addPropertyDiff:''' > >