accurator/commit

Added code for removing works from campaigns.

authorChris Dijkshoorn
Thu Apr 28 14:35:11 2016 +0200
committerChris Dijkshoorn
Thu Apr 28 14:35:11 2016 +0200
commitb4af6c367d1075d867a992f59e02d7b8341108d7
treed5e4452a593aac906b36e6f29ef8fbd084baf9dc
parent6c2da9282f63c1f6a73111998d7e2d95f77cd088
Diff style: patch stat
diff --git a/lib/accurator/subset_selection.pl b/lib/accurator/subset_selection.pl
index f0c6787..adcf472 100644
--- a/lib/accurator/subset_selection.pl
+++ b/lib/accurator/subset_selection.pl
@@ -7,7 +7,8 @@
 							 target_annotation/3,
 							 target_ubvu_pages/2,
 							 target_description_scanner/0,
-							 target_title_scanner/0]).
+							 target_title_scanner/0,
+							 remove_targets/2]).
 
 /** <module> Subset selection for annotation
 */
@@ -337,3 +338,17 @@ target_description_scanner :-
 	debug(tag_works, 'Number scanned: ~p',
 		  [NumberClassWorks]),
 	maplist(campaign_nomination(Options), ClassWorks).
+
+%%	remove_target(+Work, +TargetType)
+%
+%	For a list of works, remove the target.
+% remove_targets(['http://purl.org/collections/nl/ubvu/print-218010001015'], 'http://accurator.nl/ubvu#Target')
+remove_targets(Works, TargetType) :-
+	maplist(remove_target(TargetType), Works).
+
+%%	remove_target(+Work, +TargetType)
+%
+%	Remove a target of a work
+remove_target(TargetType, Work) :-
+	rdf_retractall(Work, rdf:type, TargetType),
+	rdf_retractall(Work, accu:targetedBy, _Targetter).