aers_rewrite/commit

improve update output

authorCWI eculture 2
Thu Jan 31 14:44:13 2013 +0100
committerCWI eculture 2
Thu Jan 31 14:44:13 2013 +0100
commit752f0abe575df4575c364a3f14626a5b89c968be
tree82020b3dc38daaff433b295c164fd71c721dbc0b
parent301474a2d8b5de81581eeb64b430042caf220256
Diff style: patch stat
diff --git a/lib/ascii_simplify.pl b/lib/ascii_simplify.pl
index 6ca02a6..03dedae 100644
--- a/lib/ascii_simplify.pl
+++ b/lib/ascii_simplify.pl
@@ -4,6 +4,7 @@
 	  ]).
 
 :- use_module(library(semweb/rdf_db)).
+:- use_module(library(semweb/rdf_label)).
 :- use_module(library(semweb/rdf_turtle_write)).
 :- use_module(library(xmlrdf/rdf_rewrite)).
 
@@ -116,6 +117,9 @@ remove_updated(Case) :-
 	Reports = [_,_|_],
 	sort_by_id(Reports, Sorted),
 	reverse(Sorted, [_Latest|Updated]),
+	length(Updated, Count),
+	literal_text(Case, CaseNumber),
+	debug(simplify, 'found ~w update(s) in case ~w', [Count,CaseNumber]),
 	maplist(recursive_retract, Updated).
 
 sort_by_id(Reports, Sorted) :-
@@ -128,7 +132,7 @@ add_id_key(Report, Id-Report) :-
 	!.
 
 recursive_retract(S) :-
-	rdf_subject(S),
+	atom(S),
 	!,
 	forall(rdf(S, _, O),
 	       recursive_retract(O)),