amalgame/commit

FIXED: remove hack to only return materialized mappings

authorJacco van Ossenbruggen
Sun Aug 31 21:57:42 2014 +0200
committerJacco van Ossenbruggen
Sun Aug 31 21:57:42 2014 +0200
commit17f80f1658b68be4d4ef945dce3b0621476008ba
treebc39ef53532358349f1aa14c39f397706e540f6c
parent8a1ef4549bc963f4764a415efb058580064df549
Diff style: patch stat
diff --git a/api/mappinglist.pl b/api/mappinglist.pl
index a2f787b..c3a5aaa 100644
--- a/api/mappinglist.pl
+++ b/api/mappinglist.pl
@@ -12,24 +12,23 @@
 
 %%	http_mapping_list(+Request)
 %
-%	Return a JSON object with the (finalize) mappings in an
-%	alignment strategy. This is a hack that needs fixing.
+%	Return a JSON object with the (final) mappings in an
+%	alignment strategy.
 
 http_mapping_list(Request) :-
 	http_parameters(Request,
 			[ strategy(Strategy,
 				   [description('URL of strategy')]),
 			  status(Status,
-				 [default(finalized)])
+				 [default(final)])
 			]),
 	Obj = json([uri=URI, label=Label]),
 	findall(Obj, mapping_in_strategy(Strategy, URI, Label, [status(Status)]), Mappings),
 	reply_json(Mappings).
 
 mapping_in_strategy(Strategy, MappingId, Label, Options) :-
+	option(status(StatusRequired), Options),
 	rdf(MappingId, rdf:type, amalgame:'Mapping', Strategy),
-	(   option(status(finalized), Options)
-	->  rdf_graph(MappingId)
-	;   true
-	),
+	rdf(MappingId, amalgame:status, MappingStatus),
+	rdf_global_id(_NS:StatusRequired, MappingStatus),
 	rdf_display_label(MappingId, Label).