Fix RDF.PrefixMap.normalize/1

This commit is contained in:
Marcel Otto 2019-03-26 21:53:57 +01:00
parent 4f71d14377
commit 86ca2a866c

View file

@ -34,12 +34,12 @@ defmodule RDF.PrefixMap do
defp normalize({prefix, %IRI{} = namespace}) when is_atom(prefix),
do: {prefix, namespace}
defp normalize({prefix, namespace}) when is_atom(prefix),
do: normalize({prefix, IRI.new(namespace)})
defp normalize({prefix, namespace}) when is_binary(prefix),
do: normalize({String.to_atom(prefix), namespace})
defp normalize({prefix, namespace}) when is_binary(namespace),
do: normalize({prefix, IRI.new(namespace)})
defp normalize({prefix, _}),
do: raise("Invalid prefix on PrefixMap: #{inspect(prefix)}}")