amalgame/commit

make sure that augment_relations also takes in the uploaded reference correspondences

authorJacco van Ossenbruggen
Sat Aug 30 15:16:56 2014 +0200
committerJacco van Ossenbruggen
Sat Aug 30 15:16:56 2014 +0200
commit3a3a99e7632bf82cbb71c265abf8c6c975299e1e
tree84cc78f547d0806fdc514a8ba873ce4992741eeb
parent2e9cd690d3e7b72ae62eee0aa522e10fb9df991f
Diff style: patch stat
diff --git a/api/correspondence.pl b/api/correspondence.pl
index 7175a71..63f75d0 100644
--- a/api/correspondence.pl
+++ b/api/correspondence.pl
@@ -44,7 +44,7 @@ http_correspondence(Request) :-
 				  description('Include all target')])
 			]),
 	find_correspondences(Mapping, Strategy, Source, Target, AllSource, AllTarget, Cs),
-	augment_relations(Strategy, Mapping, Cs, CS_augmented, []),
+	augment_relations(Strategy, Cs, CS_augmented, []),
 
 	findall(R-L, mapping_relation(L, R), Relations),
 	phrase(html_correspondences(CS_augmented, [relations(Relations), mode(Mode)]), HTML),
diff --git a/api/mapping.pl b/api/mapping.pl
index 8902ebe..5a2ebb7 100644
--- a/api/mapping.pl
+++ b/api/mapping.pl
@@ -52,7 +52,7 @@ http_data_mapping(Request) :-
 
 	expand_node(Strategy, URL, Mapping0),
 	length(Mapping0, Count),
-	augment_relations(Strategy, URL, Mapping0, Augmented, []),
+	augment_relations(Strategy, Mapping0, Augmented, []),
 	maplist(mapping_label, Augmented, Labeled),
 	sort_key(SortBy, SortKey),
 	sort_by_arg(Labeled, SortKey, MSorted),
diff --git a/lib/amalgame/ag_publish.pl b/lib/amalgame/ag_publish.pl
index b355134..b8b24b0 100644
--- a/lib/amalgame/ag_publish.pl
+++ b/lib/amalgame/ag_publish.pl
@@ -136,7 +136,7 @@ prepare_mapping(Id, Strategy, Options) :-
 	->  expand_node(Strategy, Id, Mapping),
 	    (	Mapping = [_|_]
 	    ->	default_mapping_relation(Id, Default, Options),
-		augment_relations(Strategy, Id, Mapping, Augmented, [default_relation(Default)]),
+		augment_relations(Strategy, Mapping, Augmented, [default_relation(Default)]),
 		materialize_mapping_graph(Augmented, [graph(Id) | Options])
 	    ;	true % empty mapping, do nothing
 	    )
diff --git a/lib/amalgame/map.pl b/lib/amalgame/map.pl
index a32581a..5af91ba 100644
--- a/lib/amalgame/map.pl
+++ b/lib/amalgame/map.pl
@@ -9,7 +9,7 @@
 	   map_localname/3,             % +Strategy, +MappingGraph, ?Localname
 	   nickname_clear_cache/0,
 
-	   augment_relations/5,
+	   augment_relations/4,
 
 	   mapping_relation/2,
 	   materialize_mapping_graph/2, % +List, +Options
@@ -39,8 +39,7 @@ align(Source,Target,EvidenceList) terms.
 
 :- use_module(library(amalgame/edoal)).
 :- use_module(library(amalgame/rdf_util)).
-:- use_module(library(amalgame/expand_graph)).
-:- use_module(library(amalgame/ag_evaluation)).
+:- use_module(library(amalgame/ag_reference)).
 
 :- dynamic
 	nickname_cache/3.
@@ -381,12 +380,9 @@ create_nickname(Strategy, Graph, _Postfix, Nickname) :-
 nickname_clear_cache :-
 	retractall(nickname_cache(_,_,_)).
 
-augment_relations(Strategy, Id, Mapping, Augmented, Options) :-
-	(   evaluation_graph_chk(Strategy, Id, Prev)
-	->  expand_node(Strategy, Prev, PreviousEvaluation)
-	;   PreviousEvaluation = []
-	),
-	augment_relation(Mapping, PreviousEvaluation, Augmented, Options).
+augment_relations(Strategy, Mapping, Augmented, Options) :-
+	reference_mappings(Strategy, References),
+	augment_relation(Mapping, References, Augmented, Options).
 
 
 augment_relation([], _, [], _) :- !.