This file provides JSON text to Prolog term mapping. We map lists to Prolog lists and objects to Prolog dicts. We resolve the string conflict in that we map strings to Prolog atoms, but use the compounds @(null), @(false) and @(true) for JSON null, false and true. The predicates write_json/[1,2] and read_json/[1,2] offer input and output.
As a convenience we provide the predicate json_atom/2 to convert JSON into an atom. The JSON terms are realized such that they inherit the input order of our Prolog dicts. To nevertheless allow the SWI-Prolog approach of JSON terms we provide the predicate json_keysort/2 which does a key sorting of all the Prolog dicts of a JSON term.
The following JSON text predicates are provided: