• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

/usr/lib/swipl/library/ext/json/json.pl
All Application Manual Name SummaryHelp

  • ext
    • json
      • json.pl -- Reading and writing JSON serialization
        • atom_json_term/3
        • json_read/2
        • json_read/3
        • json_write/2
        • json_write/3
        • json_write_hook/4
        • json_dict_pairs/2
        • is_json_term/1
        • is_json_term/2
        • json_read_dict/2
        • json_read_dict/3
        • json_write_dict/2
        • json_write_dict/3
        • atom_json_dict/3
        • json/4
      • json_grammar.pl -- JavaScript grammar
      • json_convert.pl
      • json_schema.pl
      • json_rpc_server.pl
      • json_rpc_common.pl
      • json_rpc_client.pl
 json(+Content, +Vars, +VarDict, -JSON) is det
The predicate json/4 implements JSON quasi quotations. These quotations produce a JSON dict that is suitable for json_write_dict/2. The quasi quoter only accepts valid, but possibly partial JSON documents. The quoter replaces content whose value is a Prolog variable that appears in the argument list of the json indicator. Notably, you can't use a Prolog variable in place of an object key. Here is an example.
  {|json(Name)||
      { "name": Name,
        "created": {
          "day":null,
          "month":"December",
          "year":2007
        },
        "confirmed":true,
        "members":[1,2,3]
      }
  |}.
ClioPatria (version V3.1.1-59-g7b9a7a3)