From f475f910d49795c03a96b5366944a53990e5faed Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Wed, 14 Jun 2017 05:19:18 +0200 Subject: [PATCH] Print a message before the compilation of bigger vocabulary namespaces --- lib/rdf/vocabulary_namespace.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rdf/vocabulary_namespace.ex b/lib/rdf/vocabulary_namespace.ex index 1b10d63..a42de61 100644 --- a/lib/rdf/vocabulary_namespace.ex +++ b/lib/rdf/vocabulary_namespace.ex @@ -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)