RDF.Description.new can handle a property-value tuple when subject is given separately
This commit is contained in:
parent
f475f910d4
commit
f62316d833
1 changed files with 5 additions and 2 deletions
|
@ -32,9 +32,9 @@ defmodule RDF.Description do
|
|||
|
||||
def new(%RDF.Description{} = description, predicate, objects),
|
||||
do: RDF.Description.add(description, predicate, objects)
|
||||
def new(subject, predicate, objects),
|
||||
do: new(subject) |> add(predicate, objects)
|
||||
|
||||
def new(subject, {predicate, objects}),
|
||||
do: new(subject) |> add(predicate, objects)
|
||||
def new(subject, statements) when is_list(statements),
|
||||
do: new(subject) |> add(statements)
|
||||
def new(subject, %RDF.Description{predications: predications}),
|
||||
|
@ -42,6 +42,9 @@ defmodule RDF.Description do
|
|||
def new(subject, predications = %{}),
|
||||
do: new(subject) |> add(predications)
|
||||
|
||||
def new(subject, predicate, objects),
|
||||
do: new(subject) |> add(predicate, objects)
|
||||
|
||||
|
||||
@doc """
|
||||
Add objects to a predicate of a `RDF.Description`.
|
||||
|
|
Loading…
Reference in a new issue