# Using JSON with SWI-Prolog

**URL:** <https://swi-prolog.discourse.group/t/using-json-with-swi-prolog/2828>\
**Category:** Split Topic\
**Created:** [August 26, 2020, 1:18pm UTC](https://swi-prolog.discourse.group/t/using-json-with-swi-prolog/2828 "2020-08-26T13:18:13Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [August 26, 2020, 1:32pm UTC](https://swi-prolog.discourse.group/t/using-json-with-swi-prolog/2828/3 "2020-08-26T13:32:27Z")

</div>

> [@jan](#):
>
> Why not create the equivalent [SWI-Prolog](https://www.swi-prolog.org/pldoc/doc_for?object=manual) dict objects and leave the transformation to JSON to [json\_write\_dict/2](https://www.swi-prolog.org/pldoc/doc_for?object=json_write_dict/2)? In the HTTP server context the skeleton is typically

Yes that is one option I plan to explore but find that doing some of the parts manually at first makes it easier to understand what is happening when the need to fix problems later happens.

I am more in the experimental stage than anything right now and have never really used JSON, SWI-Prolog dicts or Cytoscape.js to a level that I feel comfortable so this is like doing lots of homework problems to learn.

I didn’t even know json\_write\_dict/2 existed until just yesterday when trying to answer this other [question](https://swi-prolog.discourse.group/t/convert-atom-to-term-give-me-another-value-the-atom-value-is-a-variable/2820).

There is also the code by CapelliC ([GitHub - CapelliC/swish\_cytoscape\_js: SWISH graph rendering by means of cytoscape\_js](https://github.com/CapelliC/swish_cytoscape_js)) which I want to better understand.

---

_[View the full topic](https://swi-prolog.discourse.group/t/using-json-with-swi-prolog/2828)._
