RDF.Graph.get_and_update

You're seeing just the function get_and_update, go back to RDF.Graph module for more information.
Link to this function

get_and_update(graph, subject, fun)

View Source

Specs

Gets and updates the description of the given subject, in a single pass.

Invokes the passed function on the RDF.Description of the given subject; this function should return either {description_to_return, new_description} or :pop.

If the passed function returns {description_to_return, new_description}, the return value of get_and_update is {description_to_return, new_graph} where new_graph is the input Graph updated with new_description for the given subject.

If the passed function returns :pop the description for the given subject is removed and a {removed_description, new_graph} tuple gets returned.

Examples

iex> RDF.Graph.new({EX.S, EX.P, EX.O})
...> |> RDF.Graph.get_and_update(EX.S, fn current_description ->
...>      {current_description, {EX.P, EX.NEW}}
...>    end)
{RDF.Description.new(EX.S, init: {EX.P, EX.O}), RDF.Graph.new({EX.S, EX.P, EX.NEW})}