Add and improve existing typespecs on BGP behaviour

This commit is contained in:
Marcel Otto 2020-06-08 10:08:09 +02:00
parent 49bcb27bb0
commit 1ca082cbb2

View file

@ -1,13 +1,21 @@
defmodule RDF.Query.BGP do
@moduledoc """
An interface for various BGP algorithm implementations.
An interface for various BGP matching algorithm implementations.
"""
@type variable :: String.t
@type triple_pattern :: {
subject :: variable | RDF.Term.t,
predicate :: variable | RDF.Term.t,
object :: variable | RDF.Term.t
}
@type triple_patterns :: list(triple_pattern)
@type solution :: map
@type solutions :: [solution]
@callback query(triple_patterns :: [], data :: RDF.Data.t, opts :: Keyword.t) :: solutions
@callback query_stream(triple_patterns :: [], data :: RDF.Data.t, opts :: Keyword.t) :: Enumerable.t()
@callback query(triple_patterns :: [], data :: RDF.Graph.t, opts :: Keyword.t) :: solutions
@callback query_stream(triple_patterns :: [], data :: RDF.Graph.t, opts :: Keyword.t) :: Enumerable.t()
end