Skip to content

Commit

Permalink
[mod_ginger_rdf] Remove spurious code
Browse files Browse the repository at this point in the history
  • Loading branch information
robvandenbogaard committed Jul 8, 2024
1 parent 82c2b25 commit d8ee77f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/mod_ginger_rdf/support/ginger_json_ld.erl
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,15 @@ compact_predicate(Predicate) ->
%% @doc Deserialize a JSON-LD document into an RDF resource.
-spec deserialize(tuple() | list()) -> #rdf_resource{}.
deserialize(JsonLd) when is_map(JsonLd) ->
Context = maps:get(<<"@context">>, JsonLd, #{}),
deserialize_with_context(undefined, JsonLd, Context);
deserialize_with_context(undefined, JsonLd, #{});
deserialize(JsonLd) ->
%% Fall back to mochijson {struct, ...} structure
open(JsonLd).

%% Guide the parser; indicate that we are actually looking for a specific id
%% so we don't get confused when we encounter multiple subjects in the jsonld.
deserialize(Id, JsonLd) when is_map(JsonLd) ->
Context = maps:get(<<"@context">>, JsonLd, #{}),
deserialize_with_context(Id, JsonLd, Context).
deserialize_with_context(Id, JsonLd, #{}).

deserialize_with_context(Id, JsonLd, Context) ->
LocalContext = maps:get(<<"@context">>, JsonLd, #{}),
Expand Down

0 comments on commit d8ee77f

Please sign in to comment.