{"id":21907318,"url":"https://github.com/marcastr0/json-to-prolog","last_synced_at":"2026-05-09T10:55:34.060Z","repository":{"id":87378077,"uuid":"128781956","full_name":"MarcAstr0/json-to-prolog","owner":"MarcAstr0","description":"Simple Javascript library for converting JSON objects to Prolog facts.","archived":false,"fork":false,"pushed_at":"2019-02-15T13:17:30.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T07:44:25.695Z","etag":null,"topics":["json","nodejs","prolog"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcAstr0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-09T14:08:30.000Z","updated_at":"2024-03-01T11:14:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"350a0efb-37f8-4559-b82c-1deb3b34ea21","html_url":"https://github.com/MarcAstr0/json-to-prolog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcAstr0%2Fjson-to-prolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcAstr0%2Fjson-to-prolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcAstr0%2Fjson-to-prolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcAstr0%2Fjson-to-prolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcAstr0","download_url":"https://codeload.github.com/MarcAstr0/json-to-prolog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244923368,"owners_count":20532673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","nodejs","prolog"],"created_at":"2024-11-28T17:00:27.713Z","updated_at":"2026-05-09T10:55:28.659Z","avatar_url":"https://github.com/MarcAstr0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-to-prolog\n\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)\n\n## Overview\n\nSimple Javascript library for converting JSON objects to Prolog facts. Useful for converting, for\nexample, results from a database query to Prolog facts.\n\nFor example, the following object:\n\n```json\n{\n  \"parent\": [\n    { \"parent\": \"mike\", \"child\": \"greg\" },\n    { \"parent\": \"mike\", \"child\": \"marcia\" },\n    { \"parent\": \"mike\", \"child\": \"peter\" },\n    { \"parent\": \"mike\", \"child\": \"jan\" },\n    { \"parent\": \"mike\", \"child\": \"bobby\" },\n    { \"parent\": \"mike\", \"child\": \"cindy\" },\n    { \"parent\": \"carol\", \"child\": \"greg\" },\n    { \"parent\": \"carol\", \"child\": \"marcia\" },\n    { \"parent\": \"carol\", \"child\": \"peter\" },\n    { \"parent\": \"carol\", \"child\": \"jan\" },\n    { \"parent\": \"carol\", \"child\": \"bobby\" },\n    { \"parent\": \"carol\", \"child\": \"cindy\" }\n  ]\n}\n```\n\nWill convert to:\n\n```prolog\n% parent(Parent, Child).\nparent(mike, greg).\nparent(mike, marcia).\nparent(mike, peter).\nparent(mike, jan).\nparent(mike, bobby).\nparent(mike, cindy).\nparent(carol, greg).\nparent(carol, marcia).\nparent(carol, peter).\nparent(carol, jan).\nparent(carol, bobby).\nparent(carol, cindy).\n```\n\nThe JSON object must follow the following format:\n\n```json\n{\n  \"predicate1\": [\n    { \"argument1\": \"someValue\", ..., \"argumentN\": \"anotherValue\"},\n    ...,\n    { \"argument1\": \"andAnotherValue\", ..., \"argumentN\": \"etc.\"}\n  ],\n  ...,\n  \"predicateN\": [\n    ...\n  ]\n}\n```\n\nEach property of the main object describes a predicate, and each predicate has an array (list) of\nfacts represented as objects, with the predicate's arguments as properties.\n\n## Installation\n\n## Usage\n\n## To Do\n\n* Complete the README.\n* Add a method for converting _from_ Prolog to JSON.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcastr0%2Fjson-to-prolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcastr0%2Fjson-to-prolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcastr0%2Fjson-to-prolog/lists"}