amalgame/commit

move rdf_literal_predicates_cache/1 to amalgame caching module

authorJacco van Ossenbruggen
Tue Oct 25 17:01:39 2016 +0200
committerJacco van Ossenbruggen
Tue Oct 25 17:01:39 2016 +0200
commit81becc7167d51311db3959d640e6f550654bb7cb
tree43748ff589c35f1f5d011be2fe16e099e1db84df
parent64f34e90bfc23af682eb11b3fdcf24d8a5ff34de
Diff style: patch stat
diff --git a/lib/amalgame/caching.pl b/lib/amalgame/caching.pl
index 381fd0f..f3120ba 100644
--- a/lib/amalgame/caching.pl
+++ b/lib/amalgame/caching.pl
@@ -3,6 +3,7 @@
 	      get_stats_cache/3,
 	      set_stats_cache/3,
 	      get_expand_cache/3,
+	      rdf_literal_predicates_cache/1,
 	      cache_result/4,
 	      cache_mapped_concepts/4,
 	      clean_repository/0,
@@ -29,6 +30,7 @@
 :- use_module(scheme_stats).
 
 :- dynamic
+	rdf_literal_predicates_cache/1,
 	expand_cache/2,
 	mapped_concepts_cache/4,
 	stats_cache/2.
@@ -39,6 +41,7 @@
 
 user:message_hook(make(done(_)), _, _) :-
 	flush_expand_cache(_),
+	retractall(rdf_literal_predicates_cache(_)),
 	nickname_clear_cache,
 	fail.
 user:message_hook(make(done(_)), _, _) :-
diff --git a/lib/amalgame/rdf_util.pl b/lib/amalgame/rdf_util.pl
index 0fd1baa..b697482 100644
--- a/lib/amalgame/rdf_util.pl
+++ b/lib/amalgame/rdf_util.pl
@@ -13,15 +13,14 @@
 :- use_module(library(semweb/rdf_db)).
 :- use_module(library(semweb/rdf_label)).
 :- use_module(user(preferences)).
+:- use_module(library(amalgame/caching)).
+
 
 :- rdf_meta
 	rdf_has(r,r,o,r,r),
 	rdf_lang(r,r,-),
 	rdf_lang(r,r,+,-).
 
-:- dynamic
-	rdf_literal_predicates_cache/1.
-
 %%	rdf_has(S,P,O,RP,G) is nondet
 %
 %	Behaves as rdf_has/4 but the underlying triple needs to be in