{"id":37205128,"url":"https://github.com/fadado/jbol","last_synced_at":"2026-01-14T23:38:17.792Z","repository":{"id":70278167,"uuid":"58069805","full_name":"fadado/JBOL","owner":"fadado","description":"JBOL is a collection of modules for the JQ language.","archived":false,"fork":false,"pushed_at":"2020-07-11T07:41:02.000Z","size":3574,"stargazers_count":79,"open_issues_count":3,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-01-11T20:00:16.931Z","etag":null,"topics":["jq","json","json-schema"],"latest_commit_sha":null,"homepage":"","language":"JSONiq","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/fadado.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}},"created_at":"2016-05-04T17:11:30.000Z","updated_at":"2026-01-05T10:13:27.000Z","dependencies_parsed_at":"2023-02-24T09:30:38.957Z","dependency_job_id":null,"html_url":"https://github.com/fadado/JBOL","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fadado/JBOL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadado%2FJBOL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadado%2FJBOL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadado%2FJBOL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadado%2FJBOL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadado","download_url":"https://codeload.github.com/fadado/JBOL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadado%2FJBOL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["jq","json","json-schema"],"created_at":"2026-01-14T23:38:17.257Z","updated_at":"2026-01-14T23:38:17.770Z","avatar_url":"https://github.com/fadado.png","language":"JSONiq","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ≈ JBOL ≈\n\n**JBOL** is a collection of modules and tools for the **JQ** language.\n\n`jq` is a lightweight and flexible command-line JSON processor, and to use\n`jq` you must program in the **JQ** language, a lazy functional language with an evaluation\nmodel similar to the _goal-directed style_ of **SNOBOL** and **Icon** languages.\nIf you are interested in **JBOL** you can also see [_jqt_](https://fadado.github.io/jqt/),\na related project offering a template engine implemented on top of `jq`.\n\nThe name **JBOL** has been chosen to honor the inspirational **SNOBOL** influence.\n\n## Modules\n\nAll **JBOL** modules reside in the `fadado.github.io` directory\n\n## Tools\n\nThin _Bash_ wrappers around **JQ** filters:\n\n### jgen\n\n`jgen` generates JSON schemas for instance documents.\n\n### jval\n\n`jval` validates instance documents against a JSON [schema](http://json-schema.org/).\n`jval` supports the entire JSON schema draft v4 specification, except for\nremote references. It\u0026rsquo;s tested against the official\n[JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite),\nand the only failed tests are in the files `definitions.json`, `ref.json` and `refRemote.json`.\n\nSome of the `jval` limitations are:\n\n* Remote references are not supported.\n* Schema-reference resolution does not check recursivity: if there is a nested\n  cross-schema reference, it will not stop.\n* Some checks for the `format` keyword are not very accurate or consider valid any non empty string.\n* Errors cannot reference exactly the line where are produced.\n\n### jxml\n\n`jxml` transforms JSON values to XML documents.\n\n## Installation\n\nIf you have the latests _GNU Make_ tool in your system run this command:\n\n```zsh\n$ sudo make install\n```\n\nThis will install modules and other data files to `/usr/local/share/jbol`, and\ntools to `/usr/local/bin`.\n\nIf you don’t like to install into the `/usr/local` system directory you\ncan change the destination directory:\n\n```zsh\n$ sudo make install prefix=/your/installation/path\n```\n\n### Manual installation\n\nAll provided modules are in the `fadado.github.io` directory. Copy this\ndirectory to the top-level **JQ** modules path with commands equivalent to:\n\n```zsh\n$ sudo mkdir -p /usr/local/share/jbol\n$ sudo cp -r fadado.github.io /usr/local/share/jbol\n```\n\nThe tools and related schema files can be installed with commands equivalent\nto:\n\n```zsh\n$ sudo mkdir -p /usr/local/bin\n$ sudo cp bin/* /usr/local/bin\n$ sudo cp -r schemata /usr/local/share/jbol\n```\n\n## Usage\n\nIn your **JQ** scripts include or import modules with directives like\n\n```jq\nimport \"fadado.github.io/string\" as str;\nimport \"fadado.github.io/string/table\" as table;\nimport \"fadado.github.io/string/regexp\" as re;\n```\n\nand then use the modules services in your code:\n\n```jq\ndef remove_digits($s):\n    $s | table::translate(\"01234567890\"; \"\")\n;\ndef normalize_space($s):\n    $s | [re::split] | str::join(\" \")\n;\n```\n\nFinally, run your script with the `jq` appropriated `-L` option:\n\n```zsh\n$ jq -L/usr/local/share/jbol -f script.jq\n```\n\nTo use the tools ask first for help:\n\n```\n$ jgen --help\njgen -- Generates JSON schemas for instance documents\n\nUsage: jgen [-h | --help | -v | --version]\n       jgen [options...] [files...]\n\njgen generates a JSON schema for each instance document read from the\nstandard input.  One or more files may be specified, in which case jgen will\nread input from those instead.\n\nOptions:\n    -a, --verbose-array     Add array constraints\n    -c, --compact           Compact output\n    -h, --help              Show this help\n    -k, --sort-keys         Sort output keys \n    -n, --verbose-number    Add number constraints\n    -o, --verbose-object    Add object constraints\n    -r, --required          Add the 'required' keyword\n    -s, --verbose-string    Add string constraints\n    -v, --version           Print version information\n```\n\n```\n$ jval --help\njval -- Validates instance documents against a JSON schema\n\nUsage: jval [-h | --help | -v | --version]\n       jval [options...] schema [file...]\n\njval validates against an schema a JSON instance document read from the\nstandard input.  One or more files may be specified, in which case jval will\nread input from those instead.\n\nOptions:\n    -h, --help              Show this help\n    -q, --quiet             Suppress all normal output (status is zero or one)\n    -s, --schema            Validates a JSON schema against the Schema meta-schema\n    -v, --version           Print version information\n    -y, --hyper             Validates a JSON schema against the Hyper-Schema meta-schema\n```\n\n```\n$ jxml --help\njxml -- Transforms JSON to XML\n\nUsage: jxml [-h | --help | -v | --version]\n       jxml [options...] file\n\njxml transforms JSON values to XML documents.\n\nOptions:\n    -h, --help              Show this help\n    -r, --root              Set the root element name\n    -e, --element           Set the array elements name\n    -t, --tab=size          Set the whitespace string for indentation\n    -v, --version           Print version information\n```\n\n## Tests end examples\n\nThe `Makefile` has rules to help you run the tests included in the `tests`\ndirectory.  To run all tests simply execute `make`, or `make check` to force\nthe execution, again, of previously successful tests.\n\nSeveral **JQ** scripts are included in the `examples` directory.  The `Makefile` has\nrules to help you run the examples, but you should study first the code to know\nhow each example works. \n\nAs an example, calling 'make nqsmart` runs this script generating in a smart\nway the solutions for the classical _8 queens_ problem:\n\n```jq\ninclude \"fadado.github.io/prelude\";\nimport \"fadado.github.io/array\" as array;\n\n# Smart N-Queens\n\ndef queens($n; $columns):\n    def safe($j):\n        length as $i | every(\n            range($i) as $k\n            | .[$k] as $l\n            | (($i-$k)|fabs) != (($j-$l)|fabs)\n        )\n    ;\n    def qput:\n        if length == $n # assert(($columns - .) == [])\n        then . # one solution found\n        else\n            # for each available column\n            ($columns - .)[] as $column\n            | select(safe($column))\n            | array::push($column)\n            | qput\n        end\n    ;\n    #\n    [] | qput\n;\n\n8 as $N | queens($N; [range($N)])\n\n# vim:ai:sw=4:ts=4:et:syntax=jq\n```\n\nTo run the examples and tests the `Makefile` puts the `jq` binary full pathname\nin the macro `JQ` (defined by default as `/usr/local/bin/jq`). You can modify\nthis macro definition when calling `make` using this syntax:\n\n```zsh\n$ make nqsmart JQ=/usr/bin/jq\n```\n\n\u003c!--\nvim:syntax=markdown:et:ts=4:sw=4:ai\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadado%2Fjbol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadado%2Fjbol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadado%2Fjbol/lists"}