anchor.diff:      %% Ignore triples that belong to other subjects (they are found through the
       %% recursive call in the clause above).
       undefined.
  +
  +%% @doc Merge a key/value map into an accumulator map, combining multiple
  +%% values for the same key.
  +-spec merge_values(map(), map()) -> map().
  +merge_values(KeyValue, Acc) ->
  +    %% Read current key from KeyValue pair
  +    Key = hd(maps:keys(KeyValue)),
  +    #{Key := NewValue} = KeyValue,
  +
  +    case maps:get(Key, Acc, undefined) of
  +        undefined ->
  +            maps:merge(Acc, KeyValue);
  +        Value when is_list(Value) ->
  +            Acc#{Key => [NewValue | Value]};
  +        Value ->
  +            Acc#{Key => [NewValue | [Value]]}
  +    end.
  
positive.code:     TripleMap = lists:foldl(
          fun(#triple{} = Triple, Map) ->
              %% Replace id in RDF resource with that of the current object
              maps:merge(Map, triple_to_map(Triple, RdfResource#rdf_resource{id = Object}))
          end,
          #{<<"@id">> => Object},
          m_rdf:filter_subject(RdfResource, Object)
  
negative.code:                 undefined ->
                      Acc;
                  TripleJson ->
                      merge_values(TripleJson, Acc)
              end
          end,
          #{<<"@id">> => Id},
  