Loading ...
Sorry, an error occurred while loading the content.

Re: SQL for JSON?

Expand Messages
  • Alexey Luchkovsky
    TrimQuery solution is right pretty, but.... not for tree-based structures. Visitor pattern and XPATH on XML realy designed for tree. Before I decide on Visitor
    Message 1 of 11 , Mar 1, 2007
    View Source
    • 0 Attachment
      TrimQuery solution is right pretty, but.... not for tree-based
      structures.

      Visitor pattern and XPATH on XML realy designed for tree.
      Before I decide on Visitor I have seen JavaScript XPATH library
      written by Steffen Meschkat <mesch@...>. It's realy titanic
      solution, but it's designed for XML.

      Enter Visitor:
      function visit(aTree, anAcceptor, aVisitProcessor)

      I proceed from the assumption:
      - 90% tasks are based on search by equals or like.
      - 10% tasks can be realized by custom "acceptor" and/or custom "visit
      processor"

      Moreover, Visitor allowed to modify tree so well as search from them.
      For example, I can design code, that removed from JSON data structure
      all persons whose birth day arrived on full Moon (20 lines of code).

      Java Visitor on Tree vs. Events named Digester
      http://jakarta.apache.org/commons/digester/

      Resume:
      Of course Visitor is not competed with SQL (especially on server with
      indexes, cache etc), Visitor is not a rival for XPATH on XML.

      TrimQuery solution is very good and very helpful, but for JSON
      JsonTools is preffered more...
      http://sourceforge.net/projects/jsontools.

      Regards, Alexey Luchkovsky

      --- In json@yahoogroups.com, "Anand Sadasivam" <anand.sadasivam@...>
      wrote:
      >
      > Hi,
      >
      > Check out this...
      >
      > http://trimpath.com/project/wiki/TrimQuery
      >
      > you can see the demo right here...
      > http://trimpath.com/demos/test1/trimpath/query_demo.html .
      >
      >
      > Hope this helps.
      >
      > Regards,
      > Anand.S
      >
      >
      > On 2/26/07, Alexey Luchkovsky <luchkovsky@...> wrote:
      > >
      > > --- In json@yahoogroups.com <json%40yahoogroups.com>,
      "george.jempty" <
      > > george.jempty@> wrote:
      > > >
      > > > --- In json@yahoogroups.com <json%40yahoogroups.com>, "Matthew
      Morley"
      > > <WickedLogic@> wrote:
      > > > > If you are working in an environment where the JSON consumer
      is a web
      > > > > browser, let the server do the heavy lifting and pass you the
      > > > matches. If
      > > > > you really need the local ability to search or are doing
      non-browser
      > > > > exchanges, I am sure there exists generic functions to search
      > > > through sets
      > > > > of data and match criteria. The real question is which language
      > > you are
      > > > > doing it in, and is it worth the overhead and complication.
      > > >
      > > > Baloney. The real question is the OP's original question: "Has
      anyone
      > > > played with a way to find parts of a JSON structure like SQL?" This
      > > > is not an unreasonable question: in fact its been considered by
      > > > renowned Python/XML expert Uche Ogbuji; see
      > > > http://copia.ogbuji.net/blog/2006-12-23/Why_JSON_v
      > > > where he imagines "XQuery for JSON". By the way, a link to this very
      > > > same article can be found at the bottom of json.org.
      > > >
      > >
      > > JsonTools included solution for client lookup JSON data, you can find
      > > parts of a JSON structure, if you need concrete decision, send
      e-mail me.
      > >
      > >
      > >
      > >
      >
      >
      >
      > --
      > Anand.S
      > anand.sadasivam@...
      > +91 99804 75305
      >
      >
      > [Non-text portions of this message have been removed]
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.