{"id":13507821,"url":"https://github.com/rdf-elixir/jsonld-ex","last_synced_at":"2026-01-12T00:56:49.221Z","repository":{"id":47645859,"uuid":"95329315","full_name":"rdf-elixir/jsonld-ex","owner":"rdf-elixir","description":"An implementation of JSON-LD for Elixir","archived":false,"fork":false,"pushed_at":"2023-12-18T13:17:40.000Z","size":461,"stargazers_count":68,"open_issues_count":1,"forks_count":16,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-05-21T19:17:17.639Z","etag":null,"topics":["elixir","json-ld","rdf"],"latest_commit_sha":null,"homepage":"https://rdf-elixir.dev/","language":"Elixir","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/rdf-elixir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-06-25T00:13:24.000Z","updated_at":"2024-03-28T18:31:01.000Z","dependencies_parsed_at":"2023-12-18T14:50:20.564Z","dependency_job_id":null,"html_url":"https://github.com/rdf-elixir/jsonld-ex","commit_stats":null,"previous_names":["marcelotto/jsonld-ex"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fjsonld-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fjsonld-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fjsonld-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fjsonld-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdf-elixir","download_url":"https://codeload.github.com/rdf-elixir/jsonld-ex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036067,"owners_count":21037092,"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":["elixir","json-ld","rdf"],"created_at":"2024-08-01T02:00:40.143Z","updated_at":"2026-01-12T00:56:49.211Z","avatar_url":"https://github.com/rdf-elixir.png","language":"Elixir","funding_links":[],"categories":["Domain-specific language"],"sub_categories":[],"readme":"\u003cimg style=\"border:0px;\" width=\"64\" src=\"https://json-ld.org/images/json-ld-logo-64.png\" alt=\"JSON-LD-logo-64\" align=\"right\"/\u003e\n\n# JSON-LD.ex\n\n[![Hex.pm](https://img.shields.io/hexpm/v/json_ld.svg?style=flat-square)](https://hex.pm/packages/json_ld)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/json_ld/)\n[![Coverage Status](https://coveralls.io/repos/github/rdf-elixir/jsonld-ex/badge.svg?branch=master)](https://coveralls.io/github/rdf-elixir/jsonld-ex?branch=master)\n[![Total Download](https://img.shields.io/hexpm/dt/json_ld.svg)](https://hex.pm/packages/json_ld)\n[![License](https://img.shields.io/hexpm/l/json_ld.svg)](https://github.com/rdf-elixir/jsonld-ex/blob/master/LICENSE.md)\n\n[![ExUnit Tests](https://github.com/rdf-elixir/jsonld-ex/actions/workflows/elixir-build-and-test.yml/badge.svg)](https://github.com/rdf-elixir/jsonld-ex/actions/workflows/elixir-build-and-test.yml)\n[![Dialyzer](https://github.com/rdf-elixir/jsonld-ex/actions/workflows/elixir-dialyzer.yml/badge.svg)](https://github.com/rdf-elixir/jsonld-ex/actions/workflows/elixir-dialyzer.yml)\n[![Quality Checks](https://github.com/rdf-elixir/jsonld-ex/actions/workflows/elixir-quality-checks.yml/badge.svg)](https://github.com/rdf-elixir/jsonld-ex/actions/workflows/elixir-quality-checks.yml)\n\n\nAn implementation of the [JSON-LD 1.1] standard for Elixir and [RDF.ex].\n\nThe API documentation can be found [here](https://hexdocs.pm/json_ld/). For a guide and more information about RDF.ex and it's related projects, go to \u003chttps://rdf-elixir.dev\u003e.\n\n\n## Features\n\n- fully conforming JSON-LD 1.1 API processor\n- JSON-LD reader/writer for [RDF.ex]\n- customizable HTTP client for remote document loading\n- tests of the [JSON-LD test suite] (see [here](https://github.com/rdf-elixir/jsonld-ex/tree/master/earl_reports) for the EARL reports)\n\n\n## TODO\n\n- [JSON-LD Framing]\n- [JSON-LD HTML Content Algorithms]\n\n\n## Usage\n\n### Expand a document\n\n```elixir\n\"\"\"\n{\n \"@context\":\n {\n    \"name\": \"http://xmlns.com/foaf/0.1/name\",\n    \"homepage\": {\n      \"@id\": \"http://xmlns.com/foaf/0.1/homepage\",\n      \"@type\": \"@id\"\n    }\n },\n \"name\": \"Manu Sporny\",\n \"homepage\": \"http://manu.sporny.org/\"\n}\n\"\"\"\n|\u003e Jason.decode!\n|\u003e JSON.LD.expand\n```\n\nproduces\n\n```elixir\n[%{\"http://xmlns.com/foaf/0.1/homepage\" =\u003e [%{\"@id\" =\u003e \"http://manu.sporny.org/\"}],\n   \"http://xmlns.com/foaf/0.1/name\" =\u003e [%{\"@value\" =\u003e \"Manu Sporny\"}]}]\n```\n\n### Compact a document\n\n```elixir\ncontext = Jason.decode! \"\"\"\n  {\n    \"@context\": {\n      \"name\": \"http://xmlns.com/foaf/0.1/name\",\n      \"homepage\": {\n        \"@id\": \"http://xmlns.com/foaf/0.1/homepage\",\n        \"@type\": \"@id\"\n      }\n    }\n  }\n  \"\"\"\n\n\"\"\"\n[\n  {\n    \"http://xmlns.com/foaf/0.1/name\": [ \"Manu Sporny\" ],\n    \"http://xmlns.com/foaf/0.1/homepage\": [\n      {\n       \"@id\": \"http://manu.sporny.org/\"\n      }\n    ]\n  }\n]\n\"\"\"\n|\u003e Jason.decode!\n|\u003e JSON.LD.compact(context)\n```\n\nproduces \n\n```elixir\n%{\"@context\" =\u003e %{\n    \"homepage\" =\u003e %{\n        \"@id\" =\u003e \"http://xmlns.com/foaf/0.1/homepage\", \n        \"@type\" =\u003e \"@id\"},\n    \"name\" =\u003e \"http://xmlns.com/foaf/0.1/name\"\n    },\n  \"homepage\" =\u003e \"http://manu.sporny.org/\", \n  \"name\" =\u003e \"Manu Sporny\"}\n```\n\n\n## RDF Reader and Writer\n\nJSON-LD.ex can be used to serialize or deserialize RDF graphs by using it as a RDF.ex reader and writer.\n\n```elixir\ndataset = JSON.LD.read_file!(\"file.jsonld\")\nJSON.LD.write_file!(dataset, \"file.jsonld\")\n```\n\nWhen a context is provided via the `:context` option (as a map, a `RDF.PropertyMap` or a string with a URL to a remote context), the document gets automatically compacted on serialization.\n\n```elixir\nJSON.LD.write_file!(dataset, \"file.jsonld\", context: %{ex: \"https://example.com/\"})\nJSON.LD.write_file!(dataset, \"file.jsonld\", context: \"https://schema.org/\")\n```\n\n## Pretty printing\n\nPretty printing is possible on all writer functions with all the formatter options of [Jason](https://hexdocs.pm/jason/Jason.Formatter.html#pretty_print/2), the underlying JSON encoder, to which the given options are passed through.\n\n```elixir\nJSON.LD.write_file!(dataset, \"file.jsonld\", pretty: true)\nJSON.LD.write_string(dataset, \"file.jsonld\", pretty: [indent: \"\\t\"])\n```\n\n\n## Contributing\n\nsee [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n\n## Consulting\n\nIf you need help with your Elixir and Linked Data projects, just contact [NinjaConcept](https://www.ninjaconcept.com/) via \u003ccontact@ninjaconcept.com\u003e.\n\n\n## Acknowledgements\n\n\u003ctable style=\"border: 0;\"\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ca href=\"https://nlnet.nl/\"\u003e\u003cimg src=\"https://nlnet.nl/logo/banner.svg\" alt=\"NLnet Foundation Logo\" width=\"150\"\u003e\u003c/a\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"https://nlnet.nl/commonsfund/\" \u003e\u003cimg src=\"https://nlnet.nl/logo/NGI/NGIZero-green.hex.svg\" alt=\"NGI0 Logo\" height=\"150\"\u003e\u003c/a\u003e\u003c/td\u003e  \n\u003ctd\u003e\u003ca href=\"https://www.jetbrains.com/?from=RDF.ex\"\u003e\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg\" alt=\"JetBrains Logo\" height=\"150\"\u003e\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\nThis project is partly funded through [NGI0 Commons Fund](https://nlnet.nl/commonsfund/), a fund established by [NLnet](https://nlnet.nl/) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) program.\n\n[JetBrains](https://www.jetbrains.com/?from=RDF.ex) supports the project with complimentary access to its development environments.\n\n\n## License and Copyright\n\n(c) 2017-present Marcel Otto. MIT Licensed, see [LICENSE](LICENSE.md) for details.\n\n\n[RDF.ex]:             https://hex.pm/packages/rdf\n[JSON-LD 1.1]:        https://www.w3.org/TR/json-ld11/ \"JSON-LD 1.1\"\n[JSON-LD API]:        https://www.w3.org/TR/json-ld11-api/ \"JSON-LD 1.1 Processing Algorithms and API\"\n[JSON-LD Framing]:    http://json-ld.org/spec/latest/json-ld-framing/\n[JSON-LD test suite]: http://json-ld.org/test-suite/\n[JSON-LD HTML Content Algorithms]:    https://www.w3.org/TR/json-ld11-api/#html-content-algorithms\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdf-elixir%2Fjsonld-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdf-elixir%2Fjsonld-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdf-elixir%2Fjsonld-ex/lists"}