{"id":14029961,"url":"https://github.com/filip26/iridium-cbor-ld","last_synced_at":"2026-01-19T09:34:45.047Z","repository":{"id":47216807,"uuid":"509241593","full_name":"filip26/iridium-cbor-ld","owner":"filip26","description":"Semantic, self-describing binary format for Linked Data","archived":false,"fork":false,"pushed_at":"2025-12-03T19:08:33.000Z","size":1247,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-03T23:37:14.755Z","etag":null,"topics":["cbor","cbor-ld","cborld","compression","java","json-ld","linked-data","self-describing","self-descriptive"],"latest_commit_sha":null,"homepage":"https://apicatalog.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filip26.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["filip26"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://wise.com/share/filipk558","https://paypal.me/FilipKolarik"]}},"created_at":"2022-06-30T21:44:21.000Z","updated_at":"2025-12-01T11:36:21.000Z","dependencies_parsed_at":"2024-01-03T18:43:30.468Z","dependency_job_id":"26699e6c-2d60-489e-8614-87ffd9a98732","html_url":"https://github.com/filip26/iridium-cbor-ld","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/filip26/iridium-cbor-ld","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Firidium-cbor-ld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Firidium-cbor-ld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Firidium-cbor-ld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Firidium-cbor-ld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filip26","download_url":"https://codeload.github.com/filip26/iridium-cbor-ld/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Firidium-cbor-ld/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["cbor","cbor-ld","cborld","compression","java","json-ld","linked-data","self-describing","self-descriptive"],"created_at":"2024-08-11T21:01:24.731Z","updated_at":"2026-01-19T09:34:45.041Z","avatar_url":"https://github.com/filip26.png","language":"Java","funding_links":["https://github.com/sponsors/filip26","https://wise.com/share/filipk558","https://paypal.me/FilipKolarik"],"categories":["Java"],"sub_categories":[],"readme":"# Iridium CBOR-LD\n\nCBOR-LD is a **self-describing** binary format that encodes Linked Data expressed in JSON-LD into a compact form. Its primary purpose is to compress the verbose textual representation of JSON-LD into just a few bytes; small enough to embed in a QR code, barcode, or any other constrained medium.\n\nCompression is achieved through **semantic compaction** by relying on shared semantics. The result can always be expanded back into full JSON-LD without loss of meaning.  \n\nThe CBOR-LD format makes Linked Data efficient to store, transmit, and embed in environments where space and bandwidth are limited, while retaining semantic interoperability with the wider Linked Data ecosystem.  \n\nIridium CBOR-LD provides a full implementation of the [CBOR-LD 1.0 specification](https://json-ld.github.io/cbor-ld-spec/), including support for custom dictionaries and integration with Verifiable Credential Barcodes.\n\n[![Java 17 CI](https://github.com/filip26/iridium-cbor-ld/actions/workflows/coverage.yml/badge.svg?branch=main)](https://github.com/filip26/iridium-cbor-ld/actions/workflows/coverage.yml)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/07fd47ee8fa64d68a47cc83365fa07d6)](https://app.codacy.com/gh/filip26/iridium-cbor-ld/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/07fd47ee8fa64d68a47cc83365fa07d6)](https://app.codacy.com/gh/filip26/iridium-cbor-ld/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_coverage)\n[![javadoc](https://javadoc.io/badge2/com.apicatalog/iridium-cbor-ld/javadoc.svg)](https://javadoc.io/doc/com.apicatalog/iridium-cbor-ld)\n[![Maven Central](https://img.shields.io/maven-central/v/com.apicatalog/iridium-cbor-ld.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:com.apicatalog%20AND%20a:iridium-cbor-ld)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## ✨ Features\n\n- 🔄 Semantic compression and decompression\n- ⚙️ Configurable API for flexible integration\n- 🧱 Support for custom document dictionaries and builders\n- 📦 Integration with [Verifiable Credential Barcodes](https://w3c-ccg.github.io/vc-barcodes/)\n\n## Example\n\nThe JSON-LD document to encode:\n\n```json\n{\n  \"@context\": \"https://example/context\",\n  \"@type\": \"Person\",\n  \"name\": \"Filip Kolařík\",\n  \"project\": \"did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK\",\n  \"modified\": \"2025-11-25T01:02:03Z\"\n}\n```\n\nEncoded CBOR-LD:\n\n```javascript\n// with custom dictionary; code = 123\n[[123, { 0: 1, 2: 100, 102: 1764032523, 104: Filip Kolařík, 106: 1 }]]\n\n// without dictionary, using only referenced context as dictionary\n[[1, { 0: https://example/context, 2: 100, 102: 1764032523, 104: Filip Kolařík, 106: [1025, [0xED,0x01, ... 34 bytes]] }]]\n```\n\n👉 See the [test case](https://github.com/filip26/iridium-cbor-ld/blob/main/src/test/java/com/apicatalog/cborld/NativeTest.java#L31) for context, dictionary, and other details.\n\n## Usage\n\n### Encoding\n\n```javascript\n// create an encoder builder initialized with default values\nvar encoder = CborLd.createEncoder()\n               // terms dictionary (optional)\n               .dictionary(dictionary)\n               // use bundled static contexts (true by default)\n               .useBundledContexts(true)\n               // loader (optional)\n               .loader(...)\n               // create a new encoder instance\n               .build(); \n\n// encode a document\nbyte[] encoded = encoder.encode(document);\n```\n\n\u003e Please note: Only JSON-LD documents containing referenced contexts can be compressed. This is because referenced contexts act as shared dictionaries that enable term mapping across documents. Compression is not possible with inline contexts, as their definitions are embedded directly in the document and cannot be reused or referenced externally.\n\n\n### Decoding\n\n```javascript\n// create a decoder builder initialized with default values\nvar decoder = CborLd.createDecoder()\n               // terms dictionaries (optional)\n               .dictionary(dictionary1);\n               .dictionary(dictionary2);               \n               // ...\n               // use bundled static contexts (true by default)\n               .useBundledContexts(true)\n               // loader (optional)\n               .loader(...)\n               // create a new decoder instance\n               .build(); \n\n// decode\ndocument = decoder.decode(encoded);\n```\n\n### Dictionary\n\nUse dictionaries to maximize the compression ratio. A dictionary consists of terms and the codes they are encoded to. The dictionary code is preserved in the encoded CBOR-LD, but the decoder must have the same dictionary enabled. See the [W3C CBOR-LD Registry for examples](https://json-ld.github.io/cbor-ld-spec/#registry).\n\nA dictionary should contain terms that are not present in contexts, such as the context URIs themselves, custom common values bound to types, and custom common URIs.\n\n```javascript\n// build a new dictionary\nvar dictionary = DocumentDictionaryBuilder\n            .create(DICTIONARY_CODE)\n            .context(\"https://www.w3.org/ns/credentials/v2\", 1)\n            .context(\"https://w3id.org/vc-barcodes/v1\", 2)\n            .type(\"https://w3id.org/security#cryptosuiteString\",\n                    DictionaryBuilder.create()\n                            .set(\"ecdsa-rdfc-2019\", 1)\n                            .set(\"ecdsa-sd-2023\", 2)\n                            .set(\"eddsa-rdfc-2022\", 3)\n                            .set(\"ecdsa-xi-2023\", 4))\n            .uri(\"did:key:zD...\", 1)\n            .uri(\"did:key:zD...\", 2)            \n            .uri(\"https://example.../status-lists\", 3)\n            .build();\n\n// use with encoder\nvar encoder = CborLd.createEncoder()\n                .dictionary(dictionary)\n                .loader(...)\n                // ... customize\n                .build();\n\n// use with decoder, please note you can register multiple dictionaries\nvar decoder = CborLd.createDecoder()\n                .dictionary(dictionary)\n                .loader(...)\n                // ... customize\n                .build();\n               \n```\n\n### Diagnose / Debug\n\n```javascript\nvar debug = CborLd.create[Decoder|Encoder]()\n                // ... customize\n                .debug();\n\ndebug.[encode|decode](...);\n\ndebug.isCborLd();      // true if the encoded document is in CBOR-LD format\ndebug.version();       // CBOR-LD encoding version\ndebug.dictionary();    // static terms\ndebug.terms();         // dynamic term map\n\ndebug.isError();       // true if an exception has been thrown\ndebug.error();         // an exception or null\n\ndebug.dump();          // dump as JSON\n\n```\n\n### Backward Compatibility\n\n```javascript\n// CBOR-LD v0.5\nCborLd.createEncoder(CborLdVersion.V05)\n      // ... customize      \n      .build();\n\n// CBOR-LD v0.6\nCborLd.createEncoder(CborLdVersion.V06)\n      // ... customize      \n      .build();\n\n// Multi-Decoder \nCborLd.createDecoder(CborLdVersion.V1, CborLdVersion.V06, CborLdVersion.V05)\n      // sets dictionary for v1\n      .dictionary(dictionary)\n      // sets dictionary for v0.6\n      .dictionary(CborLdVersion.V06, dictionary)\n      // ... customize\n      .build();      \n```\n\n## Installation\n\nJava 17+\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.apicatalog\u003c/groupId\u003e\n    \u003cartifactId\u003eiridium-cbor-ld\u003c/artifactId\u003e\n    \u003cversion\u003e0.7.3\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\n\n#### JSON-P Provider\n\nAdd JSON-P provider, if it is not on the classpath already.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.glassfish\u003c/groupId\u003e\n    \u003cartifactId\u003ejakarta.json\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## 🛠️ LD-CLI\n[LD-CLI](https://github.com/filip26/ld-cli) is a command-line utility for\nworking with CBOR-LD, JSON-LD, multiformats, and related specifications.\n\nIt provides encoding, decoding, detection, analysis, and format conversion\nfeatures, making it useful for inspecting identifiers, testing content\naddressing, and integrating multiformats into development workflows.\n\n### Example\n\nDecompress CBOR-LD into JSON-LD\n```bash\nld-cli decompress --pretty --hex --dictionary ./utopia-barcodes-dictionary-example.json \u003c\u003c\u003c 'd90664a60183198000198001198002189d82187618a418b8a3189c18a618ce18b218d01ae592208118baa2189c18a018a8447582002018be18aa18c0a5189c186c18d60418e018e618e258417ab7c2e56b49e2cce62184ce26818e15a8b173164401b5d3bb93ffd6d2b5eb8f6ac0971502ae3dd49d17ec66528164034c912685b8111bc04cdc9ec13dbadd91cc18e418ac'\n```\n\n## Contributing\n\nAll PR's welcome!\n\n\n### Building\n\nFork and clone the project repository.\n\n```bash\n\u003e cd iridium-cbor-ld\n\u003e mvn package\n```\n\n## Resources\n\n* [CBOR-LD 1.0](https://json-ld.github.io/cbor-ld-spec/)\n* [Concise Binary Object Representation (CBOR)](https://datatracker.ietf.org/doc/html/rfc8949)\n* [Hello CBOR-LD Presentation](https://docs.google.com/presentation/d/1ksh-gUdjJJwDpdleasvs9aRXEmeRvqhkVWqeitx5ZAE/edit?usp=sharing)\n* [cbor.io](https://cbor.io/)\n* [JavaScript CBOR-LD Processor](https://github.com/digitalbazaar/cborld)\n* [CBOR Playground](https://cbor.me/)\n\n## Sponsors\n\n\u003ca href=\"https://github.com/digitalbazaar\"\u003e\n  \u003cimg src=\"https://avatars.githubusercontent.com/u/167436?s=200\u0026v=4\" width=\"40\" /\u003e\n\u003c/a\u003e \n\n## Commercial Support\n\nCommercial support and consulting are available.  \nFor inquiries, please contact: filip26@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilip26%2Firidium-cbor-ld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilip26%2Firidium-cbor-ld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilip26%2Firidium-cbor-ld/lists"}