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.1
SHA1 sum:dc3188516c1087fc619e789ba3fbeed7c773b023
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

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 test.pl -g 'use_module(json_answer).'  -g 'query("friend(donna, MyFriend).").' -g halt | jq
[
  {
    "myFriend": "eric"
  },
  {
    "myFriend": "mary"
  }
]

License

See LICENSE

Contents of pack "json_answer"

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