{"id":37428093,"url":"https://github.com/dcdpr/rdf-canonicalization-cpp","last_synced_at":"2026-01-16T06:32:34.355Z","repository":{"id":234539338,"uuid":"741613178","full_name":"dcdpr/rdf-canonicalization-cpp","owner":"dcdpr","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-20T20:33:22.000Z","size":1796,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-20T23:12:20.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcdpr.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":"2024-01-10T18:51:16.000Z","updated_at":"2024-05-20T20:33:26.000Z","dependencies_parsed_at":"2024-04-19T19:04:25.498Z","dependency_job_id":"ced3eec1-12c6-4786-a87f-07471b03631e","html_url":"https://github.com/dcdpr/rdf-canonicalization-cpp","commit_stats":null,"previous_names":["dcdpr/rdf-canonicalization-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcdpr/rdf-canonicalization-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdpr%2Frdf-canonicalization-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdpr%2Frdf-canonicalization-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdpr%2Frdf-canonicalization-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdpr%2Frdf-canonicalization-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcdpr","download_url":"https://codeload.github.com/dcdpr/rdf-canonicalization-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdpr%2Frdf-canonicalization-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","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":[],"created_at":"2026-01-16T06:32:34.255Z","updated_at":"2026-01-16T06:32:34.321Z","avatar_url":"https://github.com/dcdpr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rdf-canonicalization-cpp\n\nA C++ implementation of the [RDF Dataset Canonicalization](https://w3c.github.io/rdf-canon/spec/) specification.\n\n## Building rdf-canonicalization-cpp\n\nTo build rdf-canonicalization-cpp, you will need:\n\n* cmake\n* g++, clang or Visual Studio (community edition)\n* [jsonld-cpp](https://github.com/dcdpr/jsonld-cpp) installed locally\n\nrdf-canonicalization-cpp uses a standard cmake build system:\n\n```\nmkdir build\ncd build\ncmake ..\nmake\n```\n\nIf `jsonld-cpp` is not installed to a standard location, you will need to provide `cmake` with a prefix path:\n\n```\ncmake -DCMAKE_PREFIX_PATH=/tmp/jsonld-install ..\n```\n\n### Installing prerequisites\n\nIf the above build instructions don't work, you probably need to install some\nprerequisites. For example, on a fresh Debian Bullseye system:\n\n```\n$ sudo apt install make cmake gcc g++\n```\n\nAfter that, make sure you can build and install `jsonld-cpp`. See its [documentation](https://github.com/dcdpr/jsonld-cpp) for more details.\n\nNow you can try to build rdf-canonicalization-cpp again.\n\n## Examples\n\nThere is a command line application included in rdf-canonicalization-cpp and a couple of example JSON-LD files to use.\n\n```shell\n\u003e cat ../examples/ex01a.jsonld\n```\n```json\n{\n  \"@context\": {\n    \"name\": \"http://xmlns.com/foaf/0.1/name\",\n    \"isKnownBy\": { \"@reverse\": \"http://xmlns.com/foaf/0.1/knows\", \"@container\": \"@index\" }\n  },\n  \"@id\": \"http://example.com/people/markus\",\n  \"name\": \"Markus Lanthaler\",\n  \"isKnownBy\": {\n    \"Dave\": {\n      \"@id\": \"http://example.com/people/dave\",\n      \"name\": \"Dave Longley\"\n    },\n    \"Gregg\": {\n      \"@id\": \"http://example.com/people/gregg\",\n      \"name\": \"Gregg Kellogg\"\n    }\n  }\n}\n```\n```shell\n\u003e cat ../examples/ex01b.jsonld\n```\n```json\n{ \"@context\": { \"name\": \"http://xmlns.com/foaf/0.1/name\", \"isKnownBy\": { \"@reverse\": \"http://xmlns.com/foaf/0.1/knows\", \"@container\": \"@index\" } }, \"@id\": \"http://example.com/people/markus\", \"isKnownBy\": { \"Dave\": { \"@id\": \"http://example.com/people/dave\", \"name\": \"Dave Longley\" }, \"Gregg\": { \"@id\": \"http://example.com/people/gregg\", \"name\": \"Gregg Kellogg\" } }, \"name\": \"Markus Lanthaler\" } \n```\n\n### jsonld2canonrdf\n\n`jsonld2canonrdf` can convert a JSON-LD document into normalized RDF data in NQuads format. This program first runs JSON-LD API's ['expansion'](https://www.w3.org/TR/json-ld-api/#expansion) algorithm on the input file, then converts it to RDF using JSON-LD API's ['RDF serialization'](https://www.w3.org/TR/json-ld-api/#rdf-serialization-deserialization), and will finally ['canonicalize'](https://w3c.github.io/rdf-canon/spec/#canon-algorithm) the result. The canonicalized RDF data will be output to the terminal.\n\n```shell\n\u003e ./jsonld2canonrdf ../examples/ex01a.jsonld\n```\n```\n\u003chttp://example.com/people/dave\u003e \u003chttp://xmlns.com/foaf/0.1/knows\u003e \u003chttp://example.com/people/markus\u003e .\n\u003chttp://example.com/people/dave\u003e \u003chttp://xmlns.com/foaf/0.1/name\u003e \"Dave Longley\" .\n\u003chttp://example.com/people/gregg\u003e \u003chttp://xmlns.com/foaf/0.1/knows\u003e \u003chttp://example.com/people/markus\u003e .\n\u003chttp://example.com/people/gregg\u003e \u003chttp://xmlns.com/foaf/0.1/name\u003e \"Gregg Kellogg\" .\n\u003chttp://example.com/people/markus\u003e \u003chttp://xmlns.com/foaf/0.1/name\u003e \"Markus Lanthaler\" .\n```\n\n\nOne could use `jsonld2canonrdf` with the two example files included to show how the normalized RDF can be hashed to prove that the two documents are equivalent:\n\n```shell\n\u003e ./jsonld2canonrdf ../examples/ex01a.jsonld | shasum -a 256\ncb92d57d8b7abf09e4642338049bd9ee91a0ee0fe327e0a6061a8bbc2f4314bf  -\n\u003e ./jsonld2canonrdf ../examples/ex01b.jsonld | shasum -a 256\ncb92d57d8b7abf09e4642338049bd9ee91a0ee0fe327e0a6061a8bbc2f4314bf  -\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdpr%2Frdf-canonicalization-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcdpr%2Frdf-canonicalization-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdpr%2Frdf-canonicalization-cpp/lists"}