{"id":18069838,"url":"https://github.com/gjgd/jsonld-checker","last_synced_at":"2026-03-14T14:04:09.197Z","repository":{"id":38455943,"uuid":"267641617","full_name":"gjgd/jsonld-checker","owner":"gjgd","description":"A tool for checking the validity of JSON-LD objects","archived":false,"fork":false,"pushed_at":"2023-09-29T14:38:10.000Z","size":13005,"stargazers_count":13,"open_issues_count":25,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T20:21:26.464Z","etag":null,"topics":["checking","hacktoberfest","jsonld","jsonld-context"],"latest_commit_sha":null,"homepage":"https://www.jsonld-checker.com","language":"TypeScript","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/gjgd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-05-28T16:35:50.000Z","updated_at":"2024-10-23T22:53:45.000Z","dependencies_parsed_at":"2024-06-18T20:04:15.965Z","dependency_job_id":"ebc6ee94-d6c5-4d90-a33e-5ae314bb627d","html_url":"https://github.com/gjgd/jsonld-checker","commit_stats":{"total_commits":301,"total_committers":5,"mean_commits":60.2,"dds":0.0830564784053156,"last_synced_commit":"74cb83b8f216553bf909b5787d2470d315f9a4a6"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjgd%2Fjsonld-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjgd%2Fjsonld-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjgd%2Fjsonld-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjgd%2Fjsonld-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gjgd","download_url":"https://codeload.github.com/gjgd/jsonld-checker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501702,"owners_count":21114676,"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":["checking","hacktoberfest","jsonld","jsonld-context"],"created_at":"2024-10-31T08:23:00.788Z","updated_at":"2025-09-23T09:59:10.623Z","avatar_url":"https://github.com/gjgd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONLD Checker\n\nhttps:/jsonld-checker.gjgd.xyz\n\n## Getting started with the lib:\n\n### Install\n\n```bash\nnpm install jsonld-checker\n```\n\n### Verifying JSON-LD\n\n```js\nconst validJsonLd = {\n  \"@context\": [\n    \"https://transmute-industries.github.io/universal-wallet/contexts/wallet-v1.json\"\n  ],\n  \"id\": \"did:example:123456789abcdefghi\",\n  \"type\": \"Person\",\n  \"name\": \"John Smith\",\n  \"image\": \"https://via.placeholder.com/150\",\n  \"description\": \"Professional software developer for Acme Corp.\",\n  \"tags\": [\n    \"professional\",\n    \"person\"\n  ],\n  \"correlation\": [\n    \"4058a72a-9523-11ea-bb37-0242ac130002\"\n  ]\n};\n\nconst resultOk = await jsonldChecker.check(validJsonLd);\n/*\nCheckResult { ok: true, error: { type: '', details: '' } }\n*/\nconsole.log(resultOk);\n```\n\n```js\nconst invalidJsonLd = {\n  \"@context\": [\n    \"https://transmute-industries.github.io/universal-wallet/contexts/wallet-v1.json\"\n  ],\n  \"id\": \"did:example:123\",\n  \"type\": [\n    \"CachedDIDDocument\"\n  ],\n  \"name\": \"Farming Sensor DID Document\",\n  \"image\": \"https://via.placeholder.com/150\",\n  \"description\": \"An IoT device in the middle of a corn field.\",\n  \"tags\": [\n    \"professional\"\n  ],\n  \"correlation\": [\n    \"4058a72a-9523-11ea-bb37-0242ac130002\"\n  ],\n  \"created\": \"2017-06-18T21:19:10Z\",\n  \"expires\": \"2026-06-18T21:19:10Z\",\n  \"didDocument\": {\n    \"@context\": \"https://w3id.org/did/v0.11\",\n    \"id\": \"did:example:123\",\n    \"assertionMethod\": [\n      \"did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN\"\n    ],\n    \"authentication\": [\n      \"did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN\"\n    ],\n    \"capabilityDelegation\": [\n      \"did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN\"\n    ],\n    \"capabilityInvocation\": [\n      \"did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN\"\n    ],\n    \"keyAgreement\": [\n      {\n        \"id\": \"did:example:123#zC5iai1sL93gQxn8LKh1i42fTbpfar65dVx4NYznYfG3Y5\",\n        \"type\": \"X25519KeyAgreementKey2019\",\n        \"controller\": \"did:example:123\",\n        \"publicKeyBase58\": \"6DrzegWwfw8Xg5MsHX95sVnJaPmtXP214B5X9hkG9oRs\"\n      }\n    ],\n    \"publicKey\": [\n      {\n        \"id\": \"did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN\",\n        \"type\": \"Ed25519VerificationKey2018\",\n        \"controller\": \"did:example:123\",\n        \"publicKeyBase58\": \"DqS5F3GVe3rCxucgi4JBNagjv4dKoHc8TDLDw9kR58Pz\"\n      }\n    ]\n  }\n};\n\nconst resultNotOk = await jsonldChecker.check(invalidJsonLd);\n/*\nCheckResult {\n  ok: false,\n  error: { type: 'MISSING_PROPERTIES_IN_CONTEXT', details: '[\"didDocument\"]' }\n}\n*/\nconsole.log(resultNotOk);\n```\n\n### Passing a custom document loader\n\nThe lib supports passing a custom document loader to the check function:\n\n```js\nconst privateContextUrl = 'https://my-domain.com/private-context.jsonld';\n// A document with a private context that cannot be resolved by the default document loader\nconst docWithPrivateContext = {\n  '@context': privateContextUrl,\n  customProperty: 'customValue',\n};\n\n// A custom document loader that can resolve a private context\nconst customDocumentLoader = async (url: string) =\u003e {\n  if (url === privateContextUrl) {\n    return {\n      contextUrl: null,\n      document: {\n        '@context': {\n          customProperty: 'https://custom-url.test',\n        },\n      },\n      documentUrl: url,\n    };\n  }\n  return {};\n};\n\nconst result = await check(docWithPrivateContext, customDocumentLoader);\n/*\nCheckResult { ok: true, error: { type: '', details: '' } }\n*/\n```\n\n# Useful links\n\n- https://github.com/digitalbazaar/jsonld.js\n- https://json-ld.org/playground/\n- https://transmute-industries.github.io/universal-wallet/\n- https://material-ui.com\n- https://github.com/typescript-cheatsheets/react-typescript-cheatsheet#reacttypescript-cheatsheets\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjgd%2Fjsonld-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgjgd%2Fjsonld-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjgd%2Fjsonld-checker/lists"}