core: Description.triples and Graph.triples

This commit is contained in:
Marcel Otto 2016-12-01 00:06:45 +01:00
parent 1db0dfd797
commit 9764a01753
2 changed files with 3 additions and 0 deletions

View file

@ -344,6 +344,8 @@ defmodule RDF.Description do
|> MapSet.union(predicates(description))
end
def triples(description = %RDF.Description{}), do: Enum.to_list(description)
@doc """
Returns the number of statements of a `RDF.Description`.

View file

@ -344,6 +344,7 @@ defmodule RDF.Graph do
end) |> MapSet.union(subjects(graph))
end
def triples(graph = %RDF.Graph{}), do: Enum.to_list(graph)
def include?(%RDF.Graph{descriptions: descriptions},
triple = {subject, _, _}) do