Re: JSON results object
Wouter Beek <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CAE1un7MSV9oLoYj6GDM1Gnmow+JmdzCZ-S2-3q_vsR10c3zVug@mail.gmail.com> |
I prefer reading JSON as dictionaries. I find them a more natural fit to the JSON datamodel than Prolog compound terms. See http://www.swi-prolog.org/pldoc/doc_for?object=json_read_dict/2 --- Cheers!, Wouter. E-mail: [email protected] WWW: www.wouterbeek.com Tel.: 0647674624 On Wed, Jan 29, 2014 at 8:07 PM, Kilian Evang <[email protected] > wrote: > On 2014-01-29 18:24, [email protected] wrote: > > I can successfully get the data, and convert it to the term, but > > can't seem to figure out how to actually get to the values inside. > > > > What is the best/easiest way to get to the usable data once you have > > the json(X) term? For example, my data looks like: > > > > json([size=1, limit=25, isLastPage= @(true), values=[json([... = > > ...|...])], start=0, filter= @(null)]) > > > > Where do i go from here? > > > > I've tried converting it to key pairs, associated lists, asserting it > > into the database and can't seem to figure out how to get to the > > meaty goodness inside. > > It depends on what you want to do with it, but it sounds like > json_convert might help you: > > > http://www.swi-prolog.org/pldoc/doc_for?object=section%28%27sec:jsonconvert%27%29 > > Kilian > _______________________________________________ > SWI-Prolog mailing list > [email protected] > https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog > > -------------- next part -------------- HTML attachment scrubbed and removed