core: remove add and put from RDF.Data protocol

We will introduce RDF.Data.merge instead, which can be implemented more consistently
over all structures.
This commit is contained in:
Marcel Otto 2017-06-02 17:35:34 +02:00
parent e666d9d143
commit 460d4eef17
3 changed files with 0 additions and 26 deletions

View file

@ -3,16 +3,6 @@ defprotocol RDF.Data do
An abstraction over the different data structures for collections of RDF statements.
"""
@doc """
Add statements to a RDF data structure.
"""
def add(data, statements)
@doc """
Adds statements to a RDF data structure and overwrites all existing statements with the same subjects and predicates.
"""
def put(data, statements)
@doc """
Deletes statements from a RDF data structure.
"""

View file

@ -503,8 +503,6 @@ defimpl Enumerable, for: RDF.Description do
end
defimpl RDF.Data, for: RDF.Description do
def add(description, statements), do: RDF.Description.add(description, statements)
def put(description, statements), do: RDF.Description.put(description, statements)
def delete(%RDF.Description{subject: subject} = description,
%RDF.Description{subject: other_subject})
when subject != other_subject,

View file

@ -366,20 +366,6 @@ defmodule RDF.DescriptionTest do
}
end
test "add", %{description: description} do
assert RDF.Data.add(description, {EX.S, EX.p1, EX.O4}) ==
Description.add(description, {EX.S, EX.p1, EX.O4})
assert RDF.Data.add(description, {EX.Other, EX.p2, EX.O4}) == description
end
test "put", %{description: description} do
assert RDF.Data.put(description, {EX.S, EX.p1, EX.O4}) ==
Description.put(description, {EX.S, EX.p1, EX.O4})
assert RDF.Data.put(description, {EX.Other, EX.p2, EX.O4}) == description
end
test "delete", %{description: description} do
assert RDF.Data.delete(description, {EX.S, EX.p1, EX.O2}) ==
Description.delete(description, {EX.S, EX.p1, EX.O2})