Print a message before the compilation of bigger vocabulary namespaces

This commit is contained in:
Marcel Otto 2017-06-14 05:19:18 +02:00
parent be2f10f5cd
commit f475f910d4

View file

@ -14,6 +14,7 @@ defmodule RDF.Vocabulary.Namespace do
alias RDF.Utils.ResourceClassifier
@vocabs_dir "priv/vocabs"
@big_vocab_threshold 300
defmacro __using__(_opts) do
quote do
@ -34,6 +35,10 @@ defmodule RDF.Vocabulary.Namespace do
{:data, data} -> {rdf_data_vocab_terms(data, base_uri), data}
end
if data && RDF.Data.subject_count(data) > @big_vocab_threshold do
IO.puts("Compiling vocabulary namespace for #{base_uri} may take some time")
end
terms =
terms
|> term_mapping!(opts)