• 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/pengines/term_to_json.pl
All Application Manual Name SummaryHelp

  • ext
    • pengines
      • pengines.pl -- Pengines: Web Logic Programming Made Easy
      • pengines_io.pl -- Provide Prolog I/O for HTML clients
      • term_to_json.pl
        • term_to_json/3
        • term_to_json/2
 term_to_json(+Term, +Bindings, -JsonTerm) is det
 term_to_json(+Term, -JsonTerm) is det
Convert any general Prolog term into a JSON term. Prolog lists are treated in a special way. Also, JSON terms are not converted. Mapping:
  • Variable: {"type":"var", "name":<string>}
  • Atom: {"type":"atom", "value":<string>}
  • Integer: {"type":"integer", "value":<integer>}
  • Float: {"type":"float", "value":<float>}
  • List: JSON array
  • Dict: a JSON object. Values are processed recursively. (the tag is ignored)
  • json([Key=Value, ...]): a JSON object Values are processed recursively.
  • compound: {"type":"compound", "functor":<string>, "args":<array>}
Arguments:
Bindings- is a list of Name=Var terms for variables that get their name from the environment.
ClioPatria (version V3.1.1-51-ga0b30a5)