Re: [apps-discuss] JSON Patch not suitable for GeoJSON?

Julian Reschke <julian.reschke@gmx.de> Thu, 24 January 2013 14:57 UTC

Return-Path: <julian.reschke@gmx.de>
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 EAA2D21F84D5 for <apps-discuss@ietfa.amsl.com>; Thu, 24 Jan 2013 06:57:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.266
X-Spam-Level:
X-Spam-Status: No, score=-105.266 tagged_above=-999 required=5 tests=[AWL=-2.667, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 yr2QM7Dx4sTF for <apps-discuss@ietfa.amsl.com>; Thu, 24 Jan 2013 06:57:37 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by ietfa.amsl.com (Postfix) with ESMTP id 35B0621F84D1 for <apps-discuss@ietf.org>; Thu, 24 Jan 2013 06:57:37 -0800 (PST)
Received: from mailout-de.gmx.net ([10.1.76.19]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MhPBM-1UKsug1V3a-00Mb2H for <apps-discuss@ietf.org>; Thu, 24 Jan 2013 15:57:36 +0100
Received: (qmail invoked by alias); 24 Jan 2013 14:57:36 -0000
Received: from mail.greenbytes.de (EHLO [192.168.1.102]) [217.91.35.233] by mail.gmx.net (mp019) with SMTP; 24 Jan 2013 15:57:36 +0100
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX18HIbMeP00H7eKtrNdYADPcAfWadncIMYYI0Tqzr4 +HFAMqjMhzovsE
Message-ID: <51014BDE.7080706@gmx.de>
Date: Thu, 24 Jan 2013 15:57:34 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
MIME-Version: 1.0
To: Martin Kofahl <M.Kofahl@gmx.de>
References: <20130124130052.272540@gmx.net>
In-Reply-To: <20130124130052.272540@gmx.net>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Cc: apps-discuss@ietf.org
Subject: Re: [apps-discuss] JSON Patch not suitable for GeoJSON?
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, 24 Jan 2013 14:57:38 -0000

On 2013-01-24 14:00, Martin Kofahl wrote:
> Hello. I came across the draft-ietf-appsawg-json-patch-10 proposal and hope that's the right here place to put a question.
>
> As far I can see any remove, replace, etc. operations can be applied on object members or numbered array elements, only. I don't think this is sufficient for some formats. Taking GeoJSON
>
> { "type": "FeatureCollection",
>    "features": [
>      { "type": "Feature",
>        "id": "2",
>        "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
>        "properties": {"prop0": "value0"}
>      },
>      ...
>    ]
> }
>
> as an example, operations may have to be applied on objects filtered by some key-value-conditions in its leafs.
>
> A JSON Patch document may have to look like this:
>
> [
>    { "op": "remove", "path": "/features/*/[\"id\"=\"2\"]::parent" }
> ]
>
> Maybe you can exert this suggestion.
> ...

Essentially you're asking for XPath-like expression (which I sympathize 
with :-).

However, the design goal was to keep things as simple as possible, and 
furthermore the spec just has been approved.

So, too late as well :-)

Best regards, Julian