RDF.Description.pop

You're seeing just the function pop, go back to RDF.Description module for more information.

Specs

pop(t()) :: {RDF.Star.Triple.t() | [RDF.Star.Statement.Object] | nil, t()}

Pops an arbitrary triple from a RDF.Description.

Link to this function

pop(description, predicate)

View Source

Pops the objects of the given predicate of a Description.

When the predicate can not be found the optionally given default value or nil is returned.

Examples

iex> RDF.Description.new(EX.S, init: {EX.P, EX.O})
...> |> RDF.Description.pop(EX.P)
{[RDF.iri(EX.O)], RDF.Description.new(EX.S)}
iex> RDF.Description.new(EX.S, init: {EX.P, EX.O})
...> |> RDF.Description.pop(EX.Missing)
{nil, RDF.Description.new(EX.S, init: {EX.P, EX.O})}