amalgame/commit
make proper literals of overlap set names. Willem Melder
author | Jacco van Ossenbruggen |
---|---|
Mon May 13 13:45:13 2013 +0200 | |
committer | Jacco van Ossenbruggen |
Mon May 13 13:45:42 2013 +0200 | |
commit | b18ee4f92a0aaad0736b89a6b1af9952e2c39de8 |
tree | 8a95640517e44f99bed283b41ad131349f7aeff8 |
parent | 534480417c22bbbebb650bc086b3ca33c786fa59 |
Diff style: patch stat
diff --git a/api/ag_process.pl b/api/ag_process.pl index edfe7cb..502eb4b 100644 --- a/api/ag_process.pl +++ b/api/ag_process.pl @@ -180,6 +180,7 @@ assert_output(Process, Type, Strategy, Input, SecInputs, Strategy) :- oset_power(SecInputs, [[]|PowSet]), forall(member(InSet0, PowSet), ( sort(InSet0, InSet), + term_to_atom(InSet, InSetAtom), new_output(OutputClass, Process, amalgame:wasGeneratedBy, Input, Strategy, OutputUri), findall(Nick, ( member(Id, InSet), @@ -189,7 +190,7 @@ assert_output(Process, Type, Strategy, Input, SecInputs, Strategy) :- atomic_list_concat(Nicks, AllNicks), format(atom(Comment), 'Mappings found only in: ~p', [InSet]), format(atom(Label), 'Intersect: ~w', [AllNicks]), - rdf_assert(OutputUri, amalgame:overlap_set, literal(InSet), Strategy), + rdf_assert(OutputUri, amalgame:overlap_set, literal(InSetAtom), Strategy), rdf_assert(OutputUri, rdfs:comment, literal(Comment), Strategy), rdf_assert(OutputUri, rdfs:label, literal(Label), Strategy) ) diff --git a/lib/ag_modules/ag_overlap.pl b/lib/ag_modules/ag_overlap.pl index 97af849..1478c39 100644 --- a/lib/ag_modules/ag_overlap.pl +++ b/lib/ag_modules/ag_overlap.pl @@ -3,6 +3,7 @@ ]). :- use_module(library(semweb/rdf_db)). +:- use_module(library(semweb/rdf_label)). :- use_module(library(amalgame/expand_graph)). :- use_module(library(amalgame/map)). @@ -23,8 +24,9 @@ input_expander(Strategy, Id, Id:Expanded) :- expand_node(Strategy, Id, Expanded). output_expander(Overlaps, Strategy, OutputUri-MappingMerged) :- - rdf(OutputUri, amalgame:overlap_set, literal(OverlapId), Strategy), - ( memberchk(OverlapId-Mapping, Overlaps) + rdf(OutputUri, amalgame:overlap_set, OverlapId, Strategy), + literal_text(OverlapId, OverlapTxt), + ( memberchk(OverlapTxt-Mapping, Overlaps) -> append(Mapping, MappingFlat), merge_provenance(MappingFlat, MappingMerged) ; MappingMerged = [] @@ -42,8 +44,9 @@ overlap(MappingList, Overlaps) :- group_pairs_by_key(TransposedPairsSorted, Overlaps). my_transpose_pairs([], []). -my_transpose_pairs([(S:T)-L|Tail], [IDs-Es|Result]) :- +my_transpose_pairs([(S:T)-L|Tail], [IDsAtom-Es|Result]) :- findall(Id, member((Id:align(S,T,_)), L), IDs), + term_to_atom(IDs, IDsAtom), findall(align(S,T,E), member((_I:align(S,T,E)), L), Es), my_transpose_pairs(Tail, Result). create_pairs([], []).