Minor changes in specs
This commit is contained in:
parent
91dc078763
commit
8115554847
2 changed files with 6 additions and 7 deletions
|
@ -6,7 +6,6 @@ defmodule RDF.Boolean do
|
||||||
use RDF.Datatype, id: RDF.Datatype.NS.XSD.boolean
|
use RDF.Datatype, id: RDF.Datatype.NS.XSD.boolean
|
||||||
|
|
||||||
import Literal.Guards
|
import Literal.Guards
|
||||||
alias Literal
|
|
||||||
|
|
||||||
@type value :: boolean
|
@type value :: boolean
|
||||||
@type input :: value | String.t | number
|
@type input :: value | String.t | number
|
||||||
|
@ -95,7 +94,7 @@ defmodule RDF.Boolean do
|
||||||
|
|
||||||
see <https://www.w3.org/TR/xpath-functions/#func-not>
|
see <https://www.w3.org/TR/xpath-functions/#func-not>
|
||||||
"""
|
"""
|
||||||
@spec fn_not(value | input | Literal.t | any) :: Literal.t | nil
|
@spec fn_not(Literal.t | any) :: Literal.t | nil
|
||||||
def fn_not(value) do
|
def fn_not(value) do
|
||||||
case ebv(value) do
|
case ebv(value) do
|
||||||
%Literal{value: true} -> RDF.Boolean.Value.false
|
%Literal{value: true} -> RDF.Boolean.Value.false
|
||||||
|
@ -127,7 +126,7 @@ defmodule RDF.Boolean do
|
||||||
see <https://www.w3.org/TR/sparql11-query/#func-logical-and>
|
see <https://www.w3.org/TR/sparql11-query/#func-logical-and>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@spec logical_and(value | input | Literal.t | any, value | input | Literal.t | any) ::
|
@spec logical_and(Literal.t | any, Literal.t | any) ::
|
||||||
Literal.t | nil
|
Literal.t | nil
|
||||||
def logical_and(left, right) do
|
def logical_and(left, right) do
|
||||||
case ebv(left) do
|
case ebv(left) do
|
||||||
|
@ -171,7 +170,7 @@ defmodule RDF.Boolean do
|
||||||
see <https://www.w3.org/TR/sparql11-query/#func-logical-or>
|
see <https://www.w3.org/TR/sparql11-query/#func-logical-or>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@spec logical_or(value | input | Literal.t | any, value | input | Literal.t | any) ::
|
@spec logical_or(Literal.t | any, Literal.t | any) ::
|
||||||
Literal.t | nil
|
Literal.t | nil
|
||||||
def logical_or(left, right) do
|
def logical_or(left, right) do
|
||||||
case ebv(left) do
|
case ebv(left) do
|
||||||
|
@ -209,7 +208,7 @@ defmodule RDF.Boolean do
|
||||||
- <https://www.w3.org/TR/sparql11-query/#ebv>
|
- <https://www.w3.org/TR/sparql11-query/#ebv>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@spec ebv(value | input | Literal.t | any) :: Literal.t | nil
|
@spec ebv(Literal.t | any) :: Literal.t | nil
|
||||||
def ebv(value)
|
def ebv(value)
|
||||||
|
|
||||||
def ebv(true), do: RDF.Boolean.Value.true
|
def ebv(true), do: RDF.Boolean.Value.true
|
||||||
|
@ -245,7 +244,7 @@ defmodule RDF.Boolean do
|
||||||
@doc """
|
@doc """
|
||||||
Alias for `ebv/1`.
|
Alias for `ebv/1`.
|
||||||
"""
|
"""
|
||||||
@spec effective(value | input | Literal.t | any) :: Literal.t | nil
|
@spec effective(Literal.t | any) :: Literal.t | nil
|
||||||
def effective(value), do: ebv(value)
|
def effective(value), do: ebv(value)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,7 +29,7 @@ defmodule RDF.Serialization.Decoder do
|
||||||
@behaviour unquote(__MODULE__)
|
@behaviour unquote(__MODULE__)
|
||||||
|
|
||||||
@impl unquote(__MODULE__)
|
@impl unquote(__MODULE__)
|
||||||
@spec decode!(String.t) :: RDF.Graph.t | RDF.Dataset.t
|
@spec decode!(String.t, keyword | map) :: RDF.Graph.t | RDF.Dataset.t
|
||||||
def decode!(content, opts \\ []) do
|
def decode!(content, opts \\ []) do
|
||||||
case decode(content, opts) do
|
case decode(content, opts) do
|
||||||
{:ok, data} -> data
|
{:ok, data} -> data
|
||||||
|
|
Loading…
Reference in a new issue