diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c96e8c..333a33c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com). +## Unreleased + +### Fixed + +- remote contexts with a list couldn't be processed correctly (failed with a `JSON.LD.InvalidLocalContextError`) + +[Compare v0.3.3...HEAD](https://github.com/rdf-elixir/jsonld-ex/compare/v0.3.3...HEAD) + + + ## 0.3.3 - 2020-10-13 This version mainly upgrades to RDF.ex 0.9. diff --git a/lib/json/ld/context.ex b/lib/json/ld/context.ex index cac1f8d..ffb84fc 100644 --- a/lib/json/ld/context.ex +++ b/lib/json/ld/context.ex @@ -112,7 +112,7 @@ defmodule JSON.LD.Context do message: "Invalid remote context: No @context key in #{inspect(document)}" # 3.2.4) - 3.2.5) - do_update(active, local, remote, options) + update(active, local, remote, options) end # 3.4) - 3.8) diff --git a/test/unit/context_test.exs b/test/unit/context_test.exs index cfc1bc0..a640d83 100644 --- a/test/unit/context_test.exs +++ b/test/unit/context_test.exs @@ -150,6 +150,19 @@ defmodule JSON.LD.ContextTest do end end + describe "remote contexts" do + test "when the remote context is a list" do + assert context = JSON.LD.context("https://dev.poast.org/schemas/litepub-0.1.jsonld") + assert %{ + "Emoji" => "http://joinmastodon.org/ns#Emoji", + # https://www.w3.org/ns/activitystreams + "Accept" => "https://www.w3.org/ns/activitystreams#Accept", + # https://w3id.org/security/v1 + "CryptographicKey" => "https://w3id.org/security#Key" + } = iri_mappings(context) + end + end + describe "errors" do %{ "no @id, @type, or @container" => %{