jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: JSOP vs JSON-Patch, was: [Jackrabbit Wiki] Update of "Jsop" by stefan
Date Wed, 21 Mar 2012 12:47:35 GMT
On Tue, Mar 20, 2012 at 6:53 PM, Julian Reschke <julian.reschke@gmx.de> wrote:
> 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
> <http://trac.tools.ietf.org/html/draft-ietf-appsawg-json-patch-01>.
>
> 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 feature.

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 transformation
from JSON Patch.

however, after skim-reading the JSON Patch draft i noticed the following issues:

- 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 work.
>
> Thoughts?

since forward slashes are not allowed in jcr names i guess it's not an issue
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 <wikidiffs@apache.org>
> Reply-To: dev@jackrabbit.apache.org
> To: Apache Wiki <wikidiffs@apache.org>
>
> 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=diff&rev1=42&rev2=43
>
> Comment:
> the order of child nodes & properties is unspecified.
>
>
>   * + 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 only
> applies to child nodes however; it does not apply to the order of
> properties. For example, an implementation may sort the properties by name.
> + The added node may contain child nodes.
>
>  '''addPropertyDiff:'''
>
>

Mime
View raw message