Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "json_answer"

Title:Convenience module to convert a prolog query into a JSON answer
Rating:Not rated. Create the first rating!
Latest version:0.3
SHA1 sum:d3a54c604bc5655806a1e7c43afe6caa97a00a38
Author:Risto Stevcev <risto1@gmail.com>

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.1dc3188516c1087fc619e789ba3fbeed7c773b0233https://github.com/Risto-Stevcev/json_answer.git
0.28e6ceea50dc33aceb5d89a8ad7c4b1230ae5d9651https://github.com/Risto-Stevcev/json_answer.git
f56c84cfaffa6a99b15b72d1de5a0b475f6f25ae3https://github.com/Risto-Stevcev/json_answer.git
0.3d3a54c604bc5655806a1e7c43afe6caa97a00a387https://github.com/Risto-Stevcev/json_answer.git

prolog-json-answer

Convenience module to convert a prolog query into a JSON answer for IPC.

This is useful for interop with prolog and another language.

Usage

$ swipl -f prolog/json_answer.pl \
  -g 'assert(foo(bar, baz))' -g 'assert(foo(bar, qux))' \
  -g 'term_to_dict_list(foo(bar,_), D), json:json_write_dict(current_output, D)' \
  -g halt
[ {"foo": ["bar", "baz" ]},  {"foo": ["bar", "qux" ]} ]

License

See LICENSE

Contents of pack "json_answer"

Pack contains 6 files holding a total of 6.1K bytes.