Skip to content

Commit

Permalink
Improve coerce graph name
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrueger committed Feb 29, 2024
1 parent e894663 commit 74d6c42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rdf/model/statement.ex
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ defmodule RDF.Statement do
def coerce_graph_name(%IRI{} = iri), do: iri
def coerce_graph_name(%BlankNode{} = bnode), do: bnode
def coerce_graph_name("_:" <> identifier), do: BlankNode.new(identifier)
def coerce_graph_name(iri) when maybe_ns_term(iri) or is_binary(iri), do: IRI.new!(iri)
def coerce_graph_name(iri) when is_binary(iri) or maybe_ns_term(iri), do: IRI.new!(iri)

def coerce_graph_name(arg),
do: raise(RDF.Quad.InvalidGraphContextError, graph_context: arg)
Expand Down

0 comments on commit 74d6c42

Please sign in to comment.