Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CB92A200B17 for ; Tue, 7 Jun 2016 05:20:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C6E1D160A55; Tue, 7 Jun 2016 03:20:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1A44F160A24 for ; Tue, 7 Jun 2016 05:20:54 +0200 (CEST) Received: (qmail 30842 invoked by uid 500); 7 Jun 2016 03:20:54 -0000 Mailing-List: contact dev-help@metamodel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@metamodel.apache.org Delivered-To: mailing list dev@metamodel.apache.org Received: (qmail 30830 invoked by uid 99); 7 Jun 2016 03:20:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2016 03:20:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 2964AC136B for ; Tue, 7 Jun 2016 03:20:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id fdSkbbZea6bx for ; Tue, 7 Jun 2016 03:20:51 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 4485F5F3DA for ; Tue, 7 Jun 2016 03:20:50 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id s139so17995617oie.2 for ; Mon, 06 Jun 2016 20:20:50 -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 :content-transfer-encoding; bh=ulK6Gq++CY+un6HxlABf6xeS9AYL78WWKQebktpbJNY=; b=LkcG1B3jT8dfKVNLpMmlUypRfTIefk01av/+44EUVl8vU5j+bkOOrV/75fH/dL/586 bCbkSkgeGNTUbxsHzB4+w2WNXQSh1uaO2V5u0NvwLTc+HfD4pYTcRvyxyZnqanIHOR9H bzWSTgcqOPwP+cJZk1FeNbClsZAc+MX0zncpfA0spwHmqFLo+MDT6dkxy/abGho8k34v t2kAcE9JlLRXgBJ1ry8lhFmG6ceHsjFDGrxSg3+TsoX5yZjjCgLULMuQ3TILQWQ/lvnM 0ljtf/sS6NNNmXx6h/kXS9aD7CMHKVncbbsJConGSUF2KXmU9TOMqdOuZ9smblT8xB1h d/eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=ulK6Gq++CY+un6HxlABf6xeS9AYL78WWKQebktpbJNY=; b=JPhxi0fiYDcIjLtouGR+busWO+PSRO4o3k8gBLWK3gv53gPV2S4sYgHEu5CuAsAbJV s2J1TJLoF4BIXOiP7GklH2GmZRi8tuF9ZOcgOnOqv0XIzrrDip0zWQiBqLiE2ASBvfUB AThu1wpp/dTW+kVLhQq4ksFZ4o/fkYvtPq49TcFQkz86cmpj9ydZZBmVwikvO5GsaApd 0Iyw44F+alqRf8MO8eSz66gRMIPNUctueN7DtjHui2CA0Z9SSbMhXqPSLHQBFswn6IwS /FdmLXEXRTdeTIbdoytGHWGYtGo2SjI2s4Ux0jPXDOzGsNMseBSYvvQMKXps+btxOc+1 bkeA== X-Gm-Message-State: ALyK8tJgGSxceuqiA19kEysZJ9iiq0Kh/ge46E3PyCtJhXHtgpYNhXlHQrieFZiZ4bwtsNc95o9nHrM9R3D6dg== X-Received: by 10.202.3.135 with SMTP id 129mr8613718oid.91.1465269649168; Mon, 06 Jun 2016 20:20:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.39.169 with HTTP; Mon, 6 Jun 2016 20:20:48 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?Kasper_S=C3=B8rensen?= Date: Mon, 6 Jun 2016 20:20:48 -0700 Message-ID: Subject: Re: Checking compliance to a schema with metamodel To: "dev@metamodel.apache.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Tue, 07 Jun 2016 03:20:56 -0000 Or else I'm not really understanding your question at least :) Would be interested if it is something we _could_ offer from MetaModel side that just isn't there yet. What do you have in mind in terms of pseudo/wish code? 2016-06-06 20:17 GMT-07:00 Juan Rodr=C3=ADguez Hortal=C3=A1 : > Hi Kasper, thanks for your answer. I understand I could use those tools t= o > validate a JSON object against an expected schema expressed as a JSON > schema, or as a mapping to a java POJO. You can use metamodel to specify > JSON transformation as SQL queries, the idea I had was using metamodel to > specify JSON validations as SQL table schemas. But using JSON schema look= s > like the simplest solution here. > > Thanks again for your help. > > Greetings, > > Juan > > On Sat, Jun 4, 2016 at 9:10 AM, Kasper S=C3=B8rensen < > i.am.kasper.sorensen@gmail.com> wrote: > >> I'm not sure MetaModel is the right tool for the job in your case, >> Juan. I might be wrong and not seeing the light here. >> In cases where I've needed to do JSON validation, I've used (and can >> thus far recommend using) Jackson and Hibernate Validator. >> >> 2016-06-02 12:37 GMT-07:00 Juan Rodr=C3=ADguez Hortal=C3=A1 >> : >> > Hi, >> > >> > I have to check that some JSON objects have a certain shape. I was >> > considering specifying the schema as a Table object, and then using >> > JsonDataContext for implementing this check. The idea is defining a >> method >> > that given a Table and a String for a JSON object, returns a boolean >> saying >> > whether the JSON is complaint with the schema or not. Can that be easi= ly >> > implemented with metamodel? >> > >> > Thanks in advance. >> > >> > Greetings, >> > >> > Juan >>