amalgame/commit
one more big alignment -> strategy renaming operation
author | Jacco van Ossenbruggen |
---|---|
Mon Jul 28 23:14:13 2014 +0200 | |
committer | Jacco van Ossenbruggen |
Mon Jul 28 23:14:13 2014 +0200 | |
commit | 23403a69e549080ce84fd663850fad5542f08906 |
tree | b9ce8cf8df128bc9b417af2903ab8bcbef91e601 |
parent | 765536424507605c5f4f8f8f5b1cb8eb360125f1 |
Diff style: patch stat
diff --git a/api/ag_process.pl b/api/ag_process.pl index ce1d222..4867d81 100644 --- a/api/ag_process.pl +++ b/api/ag_process.pl @@ -54,16 +54,16 @@ http_add_process(Request) :- process(Process, [uri, description('URI of an existing process or type of new process')]), - alignment(Strategy, + strategy(Strategy, [uri, - description('URI of the alignment graph to which the process is added')]), + description('URI of the strategy graph to which the process is added')]), update(Update, [boolean, default(false), descrption('When set to true process is updated with new parameters')]) ], [form_data(Params0)]), sort(SecInputs0, SecInputs), - subtract(Params0, [input=_,source=_,target=_,process=_,alignment=_,update=_,graphic=_], Params1), + subtract(Params0, [input=_,source=_,target=_,process=_,strategy=_,update=_,graphic=_], Params1), findall(secondary_input=S,member(secondary_input=S, Params1), SecParams), subtract(Params1, SecParams, Params), fix_not_expanded_options(Params, ExpandedParams), @@ -76,7 +76,7 @@ http_add_process(Request) :- ; true ), js_focus_node(Strategy, Focus, FocusNode), - js_alignment_nodes(Strategy, Nodes), + js_strategy_nodes(Strategy, Nodes), reply_json(json([focus=json(FocusNode), nodes=json(Nodes)])). @@ -89,9 +89,9 @@ http_add_process(Request) :- http_update_node(Request) :- authorized(write(default, _)), http_parameters(Request, - [ alignment(Strategy, + [ strategy(Strategy, [uri, - description('URI of alignment') + description('URI of strategy') ]), uri(URI, [uri, @@ -107,10 +107,10 @@ http_update_node(Request) :- rdf_transaction(update_node_props(Params, URI, Strategy)), update_amalgame_prov(Strategy, URI), change_ns_if_needed(PublishNS, URI, Strategy, NewStrategy), - js_alignment_nodes(NewStrategy, Nodes), + js_strategy_nodes(NewStrategy, Nodes), js_focus_node(NewStrategy, URI, FocusNode), - reply_json(json([alignment=NewStrategy, + reply_json(json([strategy=NewStrategy, nodes=json(Nodes), focus=json(FocusNode) ])), @@ -151,7 +151,7 @@ is_dependent_chk(Mapping, Process, Strategy) :- new_process(Type, Strategy, Source, Target, Input, SecInputs, Params, Focus) :- % hack needed till we have nested rdf transactions: - retractall(ag_alignment:nickname_cache(Strategy,_,_)), + retractall(ag_map:nickname_cache(Strategy,_,_)), rdf_bnode(URI), rdf_transaction( % this rdf_transaction is to make it MT safe @@ -352,9 +352,9 @@ change_ns_if_needed(NS, URI, Strategy, NewStrategy) :- http_delete_node(Request) :- authorized(write(default, _)), http_parameters(Request, - [ alignment(Strategy, + [ strategy(Strategy, [uri, - description('URI of alignment') + description('URI of strategy') ]), uri(URI, [uri, @@ -363,7 +363,7 @@ http_delete_node(Request) :- rdf_transaction((process_retract(URI, Strategy), node_retract(URI, Strategy) )), - js_alignment_nodes(Strategy, Nodes), + js_strategy_nodes(Strategy, Nodes), js_focus_node(Strategy, Strategy, FocusNode), reply_json(json([nodes=json(Nodes), focus=json(FocusNode) diff --git a/api/hints.pl b/api/hints.pl index 3515e0b..74791e9 100644 --- a/api/hints.pl +++ b/api/hints.pl @@ -79,7 +79,7 @@ find_hint(Strategy, Context, Hint) :- uri(Source), lastAction(current), newVal(json([uri(Source), type(vocab), label(L1)])), - alignment(Strategy) + strategy(Strategy) ]) ), text(Text) @@ -108,7 +108,7 @@ find_hint(Strategy, Context, Hint) :- process(Match), source(Focus), target(Target), - alignment(Strategy) + strategy(Strategy) ])), text(Text) ]). @@ -130,7 +130,7 @@ find_hint(Strategy, Context, Hint) :- uri(Mapping), lastAction(current), newVal(json([uri(Mapping), type(mapping)])), - alignment(Strategy) + strategy(Strategy) ])), text(Text) ]). @@ -149,7 +149,7 @@ find_hint(Strategy, Context, Hint) :- lastAction(current), newVal(json([uri(Mapping), type(mapping)])), input(Mapping), - alignment(Strategy) + strategy(Strategy) ])), text(Text) ]). @@ -169,7 +169,7 @@ find_hint(Strategy, Context, Hint) :- lastAction(select), process(Process), input(Mapping), - alignment(Strategy) + strategy(Strategy) ])), text(Text) ]). @@ -190,7 +190,7 @@ find_hint(Strategy, Context, Hint) :- data(json([ lastAction(current), uri(Focus), - alignment(Strategy), + strategy(Strategy), status(FinalStatus) ])), text(Text), @@ -210,13 +210,13 @@ find_hint(Strategy, Context, Hint) :- N > 0, N < 51, !, format(atom(Text), 'Evaluate: this dataset only contains ~w non-ambigious mappings, that is good! It has not yet been evaluated, however. Manual inspection could help you decide if the quality is sufficient.', [N]), - http_link_to_id(http_ag_evaluate, [alignment(Strategy), focus(Focus)],EvalPage), + http_link_to_id(http_ag_evaluate, [strategy(Strategy), focus(Focus)],EvalPage), Hint = json([ event(evaluate), data(json([ lastAction(current), focus(Focus), - alignment(Strategy), + strategy(Strategy), page(EvalPage) ])), text(Text) @@ -240,7 +240,7 @@ find_hint(Strategy, Context, Hint) :- lastAction(select), process(Process), input(Focus), - alignment(Strategy) + strategy(Strategy) ])), text(Text) ]). @@ -248,14 +248,14 @@ find_hint(Strategy, Context, Hint) :- find_hint(Strategy, Context, Hint) :- option(focus(Focus), Context), is_known_to_be_disambiguous(Strategy, Focus, Mapping), - http_link_to_id(http_ag_evaluate, [alignment(Strategy), focus(Mapping)],EvalPage), + http_link_to_id(http_ag_evaluate, [strategy(Strategy), focus(Mapping)],EvalPage), format(atom(Text), 'Evaluate: ~p contains ambiguous mappings. Maybe you can select the good ones after looking at what is causing the problem.', [Mapping]), Hint = json([ event(evaluate), data(json([ lastAction(current), focus(Mapping), - alignment(Strategy), + strategy(Strategy), page(EvalPage) ])), text(Text) diff --git a/api/mapping.pl b/api/mapping.pl index d7da12e..bd6c775 100644 --- a/api/mapping.pl +++ b/api/mapping.pl @@ -39,7 +39,7 @@ http_data_mapping(Request) :- http_parameters(Request, [ url(URL, [description('URL of mapping or evaluation graph')]), - alignment(Strategy, [description('URL of strategy')]), + strategy(Strategy, [description('URL of strategy')]), sort(SortBy, [default(source), oneof([source,target]), @@ -213,7 +213,7 @@ http_correspondence(Request) :- [description('URI of the target concept')]), mapping(Mapping, [description('URI of the mapping')]), - alignment(Strategy, [description('URL of strategy')]), + strategy(Strategy, [description('URL of strategy')]), allsource(AllSource, [boolean, default(false), description('Include all sources')]), @@ -229,7 +229,7 @@ http_correspondence(Request) :- print_html(HTML). find_correspondences(Mapping, Strategy, Source, Target, true, true, Cs):- -% Case we need all alignments involving Source or Target +% Case we need all correspondences involving Source or Target As = align(Source, _, _), At = align(_, Target, _), ( rdf(_, amalgame:evidenceGraph, _, Mapping) diff --git a/api/mappinglist.pl b/api/mappinglist.pl index fa871af..21cc1b5 100644 --- a/api/mappinglist.pl +++ b/api/mappinglist.pl @@ -14,24 +14,24 @@ :- use_module(library(amalgame/voc_stats)). :- use_module(library(amalgame/expand_graph)). -:- http_handler(amalgame(data/voc), http_data_voc, []). +:- http_handler(amalgame(data/voc), http_data_voc, []). :- http_handler(amalgame(data/mappinglist), http_mapping_list, []). %% http_mapping_list(+Request) % -% Return a JSON object with the mappings in an alignment +% Return a JSON object with the mappings in an alignment strategy. http_mapping_list(Request) :- http_parameters(Request, - [ alignment(Alignment, [description('URL of strategy')]), + [ strategy(Strategy, [description('URL of strategy')]), status(Status, [default(finalized)]) ]), Obj = json([uri=URI, label=Label]), - findall(Obj, mapping_in_alignment(Alignment, URI, Label, [status(Status)]), Mappings), + findall(Obj, mapping_in_strategy(Strategy, URI, Label, [status(Status)]), Mappings), reply_json(Mappings). -mapping_in_alignment(Alignment, MappingId, Label, Options) :- - rdf(MappingId, rdf:type, amalgame:'Mapping', Alignment), +mapping_in_strategy(Strategy, MappingId, Label, Options) :- + rdf(MappingId, rdf:type, amalgame:'Mapping', Strategy), ( option(status(finalized), Options) -> rdf_graph(MappingId) ; true @@ -44,7 +44,7 @@ http_data_voc(Request) :- http_parameters(Request, [ url(URL, [description('URL of scheme or vocabulary')]), - alignment(Strategy, [description('URL of strategy')]), + strategy(Strategy, [description('URL of strategy')]), limit(Limit, [default(RowsPerPage), number, description('limit number of concepts returned')]), diff --git a/api/node_info.pl b/api/node_info.pl index 6952b90..52cd1e9 100644 --- a/api/node_info.pl +++ b/api/node_info.pl @@ -36,7 +36,7 @@ http_node_info(Request) :- http_parameters(Request, [ url(URL, [description('URL of a node (mapping,vocab,process,strategy)')]), - alignment(Strategy, + strategy(Strategy, [description('URL of the alignment strategy')]) ]), amalgame_info(URL, Strategy, Stats), diff --git a/applications/analyser.pl b/applications/analyser.pl index 9cbe6bb..49d3f4e 100644 --- a/applications/analyser.pl +++ b/applications/analyser.pl @@ -29,23 +29,23 @@ http_ag_analyse(Request) :- http_parameters(Request, - [ alignment(Alignment, + [ strategy(Strategy, [uri, optional(true), - description('URI of an alignment')]), + description('URI of an strategy')]), mapping(Mapping, [uri, default(''), description('URI of initially selected mapping') ]) ]), - html_page(Alignment, Mapping). + html_page(Strategy, Mapping). -html_page(Alignment, Mapping) :- +html_page(Strategy, Mapping) :- reply_html_page(amalgame(app), [ title(['Align vocabularies']) ], [ \html_requires(css('analyser.css')), \html_ag_header([active(http_ag_analyse), - strategy(Alignment), + strategy(Strategy), focus(Mapping) ]), div(class('yui3-skin-sam yui-skin-sam'), @@ -60,7 +60,7 @@ html_page(Alignment, Mapping) :- ] ), script(type('text/javascript'), - [ \yui_script(Alignment, Mapping)]) + [ \yui_script(Strategy, Mapping)]) ]). agreement_table --> @@ -99,18 +99,18 @@ http_agreement(Request) :- % % Emit YUI object. -yui_script(Alignment, Mapping) --> +yui_script(Strategy, Mapping) --> { findall(M-C, js_module(M,C), Modules), pairs_keys(Modules, Includes), findall(K-V, js_path(K, V), Paths), - js_mappings(Alignment, JSMappings) + js_mappings(Strategy, JSMappings) }, yui3([json([modules(json(Modules))]) ], Includes, [ \yui3_new(eq, 'Y.Analyser', - json([strategy(Alignment), + json([strategy(Strategy), paths(json(Paths)), mappings(JSMappings), selected(Mapping) diff --git a/applications/builder.pl b/applications/builder.pl index 2b21410..ab990c0 100644 --- a/applications/builder.pl +++ b/applications/builder.pl @@ -54,22 +54,22 @@ precalc_voc_stats(Strategy) :- %% http_ag_build(+Request) % % HTTP handler for web page with interactive vocabulary alignment -% builder. +% strategy builder. http_ag_build(Request) :- % authorized(write(default, _)), http_parameters(Request, - [ alignment(Alignment, + [ strategy(Strategy, [uri, - description('URI of an alignment')]), + description('URI of an alignment strategy')]), focus(Focus, [uri, description('URI of current focus node'), - default(Alignment) + default(Strategy) ]) ]), - backward_compatibilty_fixes(Alignment), - html_page(Alignment, Focus). + backward_compatibilty_fixes(Strategy), + html_page(Strategy, Focus). /******************************* * HTML * @@ -119,12 +119,12 @@ html_page(Strategy, Focus) :- % % Emit YUI object. -yui_script(Alignment, Focus) --> +yui_script(Strategy, Focus) --> { findall(K-V, js_path(K, V), Paths), dict_pairs(PathD, path, Paths), findall(M-C, js_module(M,C), Modules), pairs_keys(Modules, Includes), - js_focus_node(Alignment, Focus, FocusNode), - js_alignment_nodes(Alignment, Nodes), + js_focus_node(Strategy, Focus, FocusNode), + js_strategy_nodes(Strategy, Nodes), ( has_write_permission -> Read_only = false ; Read_only = true @@ -135,7 +135,7 @@ yui_script(Alignment, Focus) --> ], Includes, [ \yui3_new(eq, 'Y.Builder', - json{alignment:Alignment, + json{strategy:Strategy, paths:PathD, nodes:Nodes, selected:FocusNode, @@ -297,10 +297,10 @@ cliopatria:concept_property(count, Concept, Graphs0, Count) :- mapped_descendant_count(Concept, Graphs, Count). -graph_mappings([Alignment], Graphs) :- - rdf(Alignment, rdf:type, amalgame:'AlignmentStrategy'), +graph_mappings([Strategy], Graphs) :- + rdf(Strategy, rdf:type, amalgame:'AlignmentStrategy'), !, - findall(Mapping, rdf(Mapping, rdf:type, amalgame:'Mapping', Alignment), Graphs). + findall(Mapping, rdf(Mapping, rdf:type, amalgame:'Mapping', Strategy), Graphs). graph_mappings(Graphs, Graphs). diff --git a/applications/evaluater.pl b/applications/evaluater.pl index 198703a..b5e7c9f 100644 --- a/applications/evaluater.pl +++ b/applications/evaluater.pl @@ -43,14 +43,14 @@ ag:menu_item(210=http_ag_evaluate, 'evaluate'). %% http_ag_evaluate(+Request) % -% Emit html page with for the alignment analyser. +% Emit html page with for the mapping analyser. http_ag_evaluate(Request) :- authorized(write(default, _)), http_parameters(Request, - [ alignment(Alignment, + [ strategy(Strategy, [uri, - description('URI of an alignment')]), + description('URI of an alignment strategy')]), focus(Mapping, [uri, default(''), description('URI of initially selected mapping') @@ -60,16 +60,16 @@ http_ag_evaluate(Request) :- -> SelectedMapping = Mapping ; rdfs_individual_of(SelectedMapping, amalgame:'Mapping') ), - html_page(Alignment, SelectedMapping). + html_page(Strategy, SelectedMapping). -html_page(Alignment, Mapping) :- +html_page(Strategy, Mapping) :- reply_html_page(amalgame(app), [ title(['Manual correspondence evaluation']) ], [ \html_requires(css('evaluater.css')), \html_requires(css('gallery-paginator.css')), \html_ag_header([active(http_ag_evaluate), - strategy(Alignment), + strategy(Strategy), focus(Mapping) ]), div(class('yui3-skin-sam yui-skin-sam'), @@ -83,7 +83,7 @@ html_page(Alignment, Mapping) :- \html_correspondence_overlay) ]), script(type('text/javascript'), - [ \yui_script(Alignment, Mapping) + [ \yui_script(Strategy, Mapping) ]) ]). @@ -103,11 +103,11 @@ html_sidebar --> % % Emit YUI object. -yui_script(Alignment, Mapping) --> +yui_script(Strategy, Mapping) --> { findall(K-V, js_path(K, V), Paths), findall(M-C, js_module(M,C), Modules), pairs_keys(Modules, Includes), - js_mappings(Alignment, Mappings) + js_mappings(Strategy, Mappings) }, yui3([json([ gallery('gallery-2011.02.23-19-01'), @@ -115,7 +115,7 @@ yui_script(Alignment, Mapping) --> ], Includes, [ \yui3_new(eq, 'Y.Evaluater', - config{alignment:Alignment, + config{strategy:Strategy, paths:json(Paths), mappings:Mappings, selected:Mapping diff --git a/applications/publisher.pl b/applications/publisher.pl index cfc2546..9a1f6e3 100644 --- a/applications/publisher.pl +++ b/applications/publisher.pl @@ -32,22 +32,22 @@ ag:menu_item(280=http_ag_publish_form, 'publish'). http_ag_publish_form(Request) :- authorized(write(default, _)), http_parameters(Request, - [ alignment(Alignment, + [ strategy(Strategy, [uri, - description('URI of an alignment workflow')]), + description('URI of an alignment strategy')]), focus(Focus, [uri, description('URI of current focus node'), - default(Alignment) + default(Strategy) ]) ]), - html_page(Alignment, Focus). + html_page(Strategy, Focus). http_ag_publish(Request) :- http_parameters(Request, - [ alignment(Alignment, + [ strategy(Strategy, [uri, - description('URI of an alignment workflow')]), + description('URI of an alignment strategy')]), status(Status, [uri, description('amalgame:status value')]), format(Format, [one_of([both, simple, edoal]), description('Format to publish in')]), default_relation(DefaultRelation, @@ -59,9 +59,9 @@ http_ag_publish(Request) :- expand_file_search_path(alignment_results(.), L), exists_directory(L), absolute_file_name(L,BaseDir),!, - file_base_name(Alignment, AlignmentB), + file_base_name(Strategy, AlignmentB), atomic_list_concat([BaseDir, AlignmentB], '/', Dir), - save_mappings(Alignment, Dir, [status(Status), format(Format),default_relation(DefaultRelation)]), + save_mappings(Strategy, Dir, [status(Status), format(Format),default_relation(DefaultRelation)]), http_redirect(moved, alignment_results(AlignmentB), Request). @@ -69,12 +69,12 @@ http_ag_publish(Request) :- * HTML * *******************************/ -%% html_page(+Alignment) +%% html_page(+Strategy) % -% Emit html page with layout for the alignment exporter +% Emit html page with layout for the alignment strategy exporter % application. -html_page(Alignment, Focus) :- +html_page(Strategy, Focus) :- findall(R, status_option(R), StatusOptions), rdf_equal(amalgame:final, DefaultStatus), supported_map_relations(MapRelations), @@ -87,13 +87,13 @@ html_page(Alignment, Focus) :- [ \html_ag_header( [active(http_ag_publish_form), focus(Focus), - strategy(Alignment)]), + strategy(Strategy)]), div([id(main), class('yui3-g')], [ form([class('yui3-u'), id(export_form), action(location_by_id(http_ag_publish)), method(post)], ['Publish the strategy file along with ', - input([type(hidden), name(alignment), value(Alignment)]), + input([type(hidden), name(strategy), value(Strategy)]), select([name(status), autocomplete(off)], [ \html_options([no,all|StatusOptions],DefaultStatus)]), ' mappings.', diff --git a/applications/startpage.pl b/applications/startpage.pl index 3993e5e..e522568 100644 --- a/applications/startpage.pl +++ b/applications/startpage.pl @@ -37,7 +37,7 @@ :- http_handler(amalgame(form/select), http_ag_form_select_strategy, []). :- http_handler(amalgame(form/url), http_ag_form_upload_strategy_resource, []). :- http_handler(amalgame(form/data), http_ag_form_upload_strategy_data, []). -:- http_handler(amalgame(form/reference), http_ag_form_upload_alignment, []). +:- http_handler(amalgame(form/reference), http_ag_form_upload_reference, []). %% http_amalgame_main_page(+Request) is det. % @@ -56,7 +56,7 @@ http_amalgame_main_page(Request) :- http_ag_form_select_strategy(Request) :- http_parameters(Request, [ - alignment(Strategies, + strategy(Strategies, [list(uri), description('URI of the selected strategy')]), submit(Action, @@ -77,7 +77,7 @@ http_ag_form_select_strategy(Request) :- %% http_ag_form_new_strategy(+Request) % -% Handle form data to create a new alignment +% Handle form data to create a new strategy http_ag_form_new_strategy(Request) :- http_parameters(Request, @@ -123,10 +123,10 @@ http_ag_form_upload_strategy_resource(Request) :- rdf_load(URL, [graph(TmpGraph)]), cp_strategy_from_tmp(Request, TmpGraph). -%% http_ag_form_upload_alignment(+Request) is det. +%% http_ag_form_upload_reference(+Request) is det. % -% Handle form to upload an existing alignment -http_ag_form_upload_alignment(Request) :- +% Handle form to upload an existing strategy +http_ag_form_upload_reference(Request) :- authorized(write(default, _)), http_parameters(Request, [ data(Data, @@ -162,7 +162,7 @@ scheme_label(URI, Key-URI) :- downcase_atom(CasedKey, Key). html_main_page(_Request) :- - findall(A-S, amalgame_alignment(A, S), Alignments), + findall(A-S, amalgame_strategy(A, S), Alignments), find_schemes(ConceptSchemes), reply_html_page(cliopatria(main), [ title(['Amalgame - strategies']) @@ -329,7 +329,7 @@ html_publish(Strategies) --> ! }, html_acc_item(publish, - 'publish alignment results', + 'publish alignment strategy results', [ form(action(location_by_id(L)), [ \html_strategy_table(Strategies, [linkto(L)]), \html_submit('Publish') @@ -341,7 +341,7 @@ html_publish(_) --> !. %% html_strategy_table(+Graphs, +Options) % -% Emit HTML table with alignment graph properties. +% Emit HTML table with strategy graph properties. html_strategy_table(Strategies, Options) --> html([ @@ -373,7 +373,7 @@ html_alignment_rows([URI-Schemes|Gs], Options) --> ; Comment = '' ) }, - html(tr([td(input([type(checkbox), autocomplete(off), class(option), name(alignment), value(URI)])), + html(tr([td(input([type(checkbox), autocomplete(off), class(option), name(strategy), value(URI)])), td(\html_strategy_name(URI, Options)), td(\html_scheme_labels(Schemes)), td(\turtle_label(Author)), @@ -389,7 +389,7 @@ html_scheme_labels([S|Ss]) --> html_strategy_name(Graph, Options) --> { graph_label(Graph, Label), option(linkto(LinkTo), Options, http_ag_build), - http_link_to_id(LinkTo, [alignment(Graph)], Link) + http_link_to_id(LinkTo, [strategy(Graph)], Link) }, html(a([href(Link)],Label)). @@ -410,7 +410,7 @@ html_reference --> }, html_acc_item(reference, 'upload existing/reference alignment', - form([action(location_by_id(http_ag_form_upload_alignment)), + form([action(location_by_id(http_ag_form_upload_reference)), method('POST'), enctype('multipart/form-data') ], [ p(['Upload an exisiting alignment to build upon, ', @@ -567,7 +567,7 @@ cp_strategy_from_tmp(Request, TmpGraph) :- build_redirect(Request, [Strategy]). build_redirect(Request, [Strategy|_]) :- - http_link_to_id(http_ag_build, [alignment(Strategy)], Redirect), + http_link_to_id(http_ag_build, [strategy(Strategy)], Redirect), http_redirect(moved, Redirect, Request). delete_redirect(Request, Strategies) :- @@ -597,7 +597,7 @@ merge_redirect(Request, Strategies) :- merge_strategy_nodes(Strategies, New), % Redirect to builder - http_link_to_id(http_ag_build, [alignment(New)], Redirect), + http_link_to_id(http_ag_build, [strategy(New)], Redirect), http_redirect(moved, Redirect, Request). merge_strategy_nodes([], _New) :- !. diff --git a/applications/strategy_viz.pl b/applications/strategy_viz.pl index 8e9c818..db28462 100644 --- a/applications/strategy_viz.pl +++ b/applications/strategy_viz.pl @@ -1,6 +1,6 @@ :- module(strategy_graph_viz, [ html_strategy_viz//1, - reply_alignment_graph/2 + reply_strategy_graph/2 ]). :- use_module(library(option)). @@ -24,10 +24,10 @@ :- setting(amalgame:secondary_input, oneof([show,hide]), show, 'Show or hide arrows for amalgame:secondary_input'). -strategy_viz_options(Alignment, +strategy_viz_options(Strategy, [edge_links(false), shape_hook(amalgame_shape), - label_hook(amalgame_label(Alignment)), + label_hook(amalgame_label(Strategy)), graph_attributes([rankdir('BT')]) ]). @@ -46,7 +46,7 @@ http_strategy_viz(Request) :- oneof([xdot,svg,html]), description('Return svg graph or html page with embedded object') ]), - alignment(Alignment, + strategy(Strategy, [description('URI from which we request the context')]), selected(Selected, [uri, @@ -55,25 +55,25 @@ http_strategy_viz(Request) :- ]) ]), % When a node has been selected, make sure we know the stats - ( ground(Selected) -> node_stats(Alignment, Selected, _); true), + ( ground(Selected) -> node_stats(Strategy, Selected, _); true), ( Format \== html - -> reply_alignment_graph(Alignment, Format) - ; strategy_viz_options(Alignment, Options), + -> reply_strategy_graph(Strategy, Format) + ; strategy_viz_options(Strategy, Options), reply_html_page(cliopatria(default), - [ title(['Graph for ', \turtle_label(Alignment)]) + [ title(['Graph for ', \turtle_label(Strategy)]) ], - [ \graphviz_graph(amalgame_triples(Alignment), Options) + [ \graphviz_graph(amalgame_triples(Strategy), Options) ]) ). -%% reply_alignment_graph(+AlignmentURI) +%% reply_strategy_graph(+StrategyURI) % -% Emit an alignment graph. +% Emit a strategy graph. -reply_alignment_graph(Alignment, Format) :- - strategy_viz_options(Alignment, Options), - amalgame_triples(Alignment, Triples), +reply_strategy_graph(Strategy, Format) :- + strategy_viz_options(Strategy, Options), + amalgame_triples(Strategy, Triples), meta_options(is_meta, Options, QOptions), reply_graphviz_graph(Triples, Format, QOptions). @@ -204,33 +204,33 @@ artifact_color(R, '#ACCF89') :- artifact_color(_R, '#EEFFEE'). -%% amalgame_label(+Alignment, +Resource, +Lang, +MaxLenth, -Label) +%% amalgame_label(+Strategy, +Resource, +Lang, +MaxLenth, -Label) % % Defines the node label of Resource. -amalgame_label(Alignment, Resource, Lang, MaxLen, Label) :- +amalgame_label(Strategy, Resource, Lang, MaxLen, Label) :- rdf_display_label(Resource, Lang, Text), truncate_atom(Text, MaxLen, Label0), - stats_label_list(Alignment, Resource, Stats), + stats_label_list(Strategy, Resource, Stats), ( rdfs_individual_of(Resource, amalgame:'Mapping') - -> map_nickname(Alignment, Resource, Abbreviation), + -> map_nickname(Strategy, Resource, Abbreviation), atomic_list_concat([Abbreviation, '.', Label0, '\n'|Stats], Label) ; atomic_list_concat([Label0, '\n'|Stats], Label) ). -stats_label_list(_Alignment, Resource, [Count]) :- +stats_label_list(_Strategy, Resource, [Count]) :- is_vocabulary(Resource), voc_property(Resource, numberOfConcepts(Count), [compute(no)]), !. -stats_label_list(Alignment, Resource, [IPercA]) :- - stats_cache(Resource-Alignment, Stats), +stats_label_list(Strategy, Resource, [IPercA]) :- + stats_cache(Resource-Strategy, Stats), option(inputPercentage(IPerc), Stats, 0), IPerc > 1, format(atom(IPercA), '~0f%', [IPerc]), !. -stats_label_list(Alignment, Resource, [ConceptStats]) :- - stats_cache(Resource-Alignment, Stats), +stats_label_list(Strategy, Resource, [ConceptStats]) :- + stats_cache(Resource-Strategy, Stats), option(sourcePercentageInput(SPerc), Stats, 0), option(targetPercentageInput(TPerc), Stats, 0), format(atom(ConceptStats), '~0f% ~0f%', [SPerc, TPerc]), diff --git a/components/amalgame/util.pl b/components/amalgame/util.pl index 66b09a2..d41afdf 100644 --- a/components/amalgame/util.pl +++ b/components/amalgame/util.pl @@ -53,11 +53,11 @@ html_menu_item(Handler, Label, Options) --> { option(strategy(Strategy), Options), option(focus(Focus), Options, Strategy), http_link_to_id(http_ag_build, - [alignment(Strategy)], ReturnToAfterLogin), + [strategy(Strategy)], ReturnToAfterLogin), http_link_to_id(Handler, [ 'openid.return_to'(ReturnToAfterLogin), focus(Focus), - alignment(Strategy) + strategy(Strategy) ], Link) }, diff --git a/lib/amalgame/util.pl b/lib/amalgame/util.pl index 44be65f..56a5651 100644 --- a/lib/amalgame/util.pl +++ b/lib/amalgame/util.pl @@ -5,11 +5,11 @@ rdf_lang/4, assert_user_provenance/2, - amalgame_alignment/2, + amalgame_strategy/2, js_mappings/2, js_focus_node/3, - js_alignment_nodes/2, + js_strategy_nodes/2, now_xsd/1, xsd_timestamp/2, @@ -95,10 +95,6 @@ has_write_permission :- logged_on(User, anonymous), catch(check_permission(User, write(default,_)), _, fail). -%% html_ag_header(+Active, +Alignment) -% -% Emit page header with menu bar - %% assert_user_provenance(+Resource, -NamedGraph) % @@ -115,14 +111,14 @@ assert_user_provenance(R, Graph) :- rdf_assert(R, dcterms:date, literal(type(xsd:dateTime, Time)), Graph). -%% amalgame_alignment(?Alignment, ?Schemes) +%% amalgame_strategy(?Strategy, ?Schemes) % -% Alignment is an amalgame alignment and schemes are the +% Strategy is an amalgame alignment strategy and Schemes are the % conceptSchemes that it includes. -amalgame_alignment(Alignment, Schemes) :- - rdfs_individual_of(Alignment, amalgame:'AlignmentStrategy'), - findall(S, rdf(Alignment, amalgame:includes, S), Schemes), +amalgame_strategy(Strategy, Schemes) :- + rdfs_individual_of(Strategy, amalgame:'AlignmentStrategy'), + findall(S, rdf(Strategy, amalgame:includes, S), Schemes), Schemes \== []. @@ -154,12 +150,12 @@ js_focus_node(Strategy, URI, NodeProps) :- findall(Type-Value, node_prop(Strategy, URI, Type, Value), Pairs), dict_pairs(NodeProps, node, Pairs). -%% js_alignment_nodes(+Alignment, -Nodes) +%% js_alignment_nodes(+Strategy, -Nodes) % -% Nodes contains all nodes in alignment with their Strategy type +% Nodes contains all nodes in alignment Strategy with their type % (process, vocab, strategy or mapping). -js_alignment_nodes(Strategy, Nodes) :- +js_strategy_nodes(Strategy, Nodes) :- findall(S, graph_resource(Strategy, S), NodeURIs), sort(NodeURIs, URIsUnique), maplist(node_data(Strategy), URIsUnique, Pairs), diff --git a/web/js/builder.js b/web/js/builder.js index f6cf638..2499373 100644 --- a/web/js/builder.js +++ b/web/js/builder.js @@ -15,7 +15,7 @@ YUI.add('builder', function(Y) { } Builder.NAME = "builder"; Builder.ATTRS = { - alignment : { + strategy : { value: null }, readonly : { @@ -133,7 +133,7 @@ YUI.add('builder', function(Y) { _initGraph : function() { this.strategy_viz = new Y.StratViz({ paths:this.get("paths"), - alignment: this.get("alignment"), + strategy: this.get("strategy"), selected: this.get("selected"), nodes: this.get("nodes") }).render(NODE_GRAPH); @@ -142,7 +142,7 @@ YUI.add('builder', function(Y) { _initInfo : function() { this.infobox = new Y.InfoBox({ srcNode: NODE_INFO, - alignment: this.get("alignment"), + strategy: this.get("strategy"), nodes: this.get("nodes"), selected: this.get("selected"), readonly: this.get('readonly'), @@ -162,7 +162,7 @@ YUI.add('builder', function(Y) { this.mapping = new Y.Mapping({ builder: this, paths: this.get("paths"), - alignment: this.get("alignment"), + strategy: this.get("strategy"), selected: this.get("selected") }); }, @@ -171,7 +171,7 @@ YUI.add('builder', function(Y) { this.vocabulary = new Y.Vocabulary({ paths:this.get("paths"), selected: this.get("selected"), - alignment: this.get("alignment") + strategy: this.get("strategy") }); }, @@ -198,7 +198,7 @@ YUI.add('builder', function(Y) { // data only contains the process parameters // we need to add the context - data.alignment = this.get("alignment"); + data.strategy = this.get("strategy"); if (data.lastAction) this.infobox.set("lastAction", data.lastAction); Y.io(paths.addprocess, { data:data, @@ -218,7 +218,7 @@ YUI.add('builder', function(Y) { var oSelf = this, paths = this.get("paths"), data = o.data; - data.alignment = this.get("alignment"); + data.strategy = this.get("strategy"); Y.io(paths.updatenode, { data:data, @@ -226,11 +226,11 @@ YUI.add('builder', function(Y) { var r = Y.JSON.parse(o.responseText); oSelf.set("nodes", r.nodes); oSelf.set("selected", r.focus); - if (!data.alignment == r.alignment) { - // alignment changed name, we need to fully reload ... + if (!data.strategy == r.strategy) { + // strategy changed name, we need to fully reload ... var l = window.location; var newURL = l.protocol + "//" + l.host + l.pathname + - "?alignment=" + encodeURIComponent(r.alignment); + "?strategy=" + encodeURIComponent(r.strategy); window.location.replace(newURL); } }} @@ -240,12 +240,12 @@ YUI.add('builder', function(Y) { _onNodeDelete : function(o) { var oSelf = this, paths = this.get("paths"), - alignment = this.get("alignment"); + strategy = this.get("strategy"); // inform the server and update the nodes Y.io(paths.deletenode, { data:{ - alignment:alignment, + strategy:strategy, uri:o.uri }, on:{success:function(e,o) { @@ -265,7 +265,7 @@ YUI.add('builder', function(Y) { var focus = e.data.focus; if(focus) { window.location = this.get("paths").ag_evaluate - +'?alignment='+encodeURIComponent(this.get("alignment")) + +'?strategy='+encodeURIComponent(this.get("strategy")) +"&focus="+encodeURIComponent(focus); } } diff --git a/web/js/evaluater.js b/web/js/evaluater.js index 98e6acf..26e706c 100644 --- a/web/js/evaluater.js +++ b/web/js/evaluater.js @@ -17,7 +17,7 @@ YUI.add('evaluater', function(Y) { } Evaluater.NAME = "evaluater"; Evaluater.ATTRS = { - alignment: { value: null }, + strategy: { value: null }, paths: { value: {} }, mappings: { value:{} }, selected: { value: null }, @@ -91,7 +91,7 @@ YUI.add('evaluater', function(Y) { srcNode: NODE_MAPPING_TABLE, datasource:DS, showRelation:true, - alignment: this.get("alignment"), + strategy: this.get("strategy"), focus:this.get("selected") }); }, @@ -131,7 +131,7 @@ YUI.add('evaluater', function(Y) { this.detailOverlay.set("visible", false); var cs = this._getSelection(); var c = cs[0]; - c.strategy = this.get("alignment"); + c.strategy = this.get("strategy"); c.mapping = this.get("selected"); c.mode = nav == "setall"?"all":"one"; if (this.form_dirty()) { @@ -212,7 +212,7 @@ YUI.add('evaluater', function(Y) { _fetchInfo : function(uri) { if(uri) { this.infoDS.sendRequest({ - request:'?url='+uri+'&alignment='+this.get("alignment"), + request:'?url='+uri+'&strategy='+this.get("strategy"), callback:{success:function(o) { var HTML = o.response.results[0].responseText; NODE_INFO.setContent(HTML); @@ -237,7 +237,7 @@ YUI.add('evaluater', function(Y) { // call the server var data = { - alignment:this.get("alignment"), + strategy:this.get("strategy"), mapping:this.get("selected"), source: this._source, target: this._target, diff --git a/web/js/infobox.js b/web/js/infobox.js index 496df39..082d119 100644 --- a/web/js/infobox.js +++ b/web/js/infobox.js @@ -41,7 +41,7 @@ YUI.add('infobox', function(Y) { lastAction: { value: null }, - alignment: { + strategy: { value: null }, paths : { @@ -81,7 +81,7 @@ YUI.add('infobox', function(Y) { var oSelf = this, paths = this.get("paths"), selected = this.get("selected"), - alignment = this.get("alignment"); + strategy = this.get("strategy"); // update the node properties that we already have this._setProperties(selected); @@ -91,7 +91,7 @@ YUI.add('infobox', function(Y) { Y.io(paths.info, { data: { 'url':selected.uri, - 'alignment':alignment + 'strategy':strategy }, on:{ success:function(e,r) { @@ -172,12 +172,12 @@ YUI.add('infobox', function(Y) { e.currentTarget.set('innerHTML', 'computing statistics ...'); var voc = this.get("selected").uri; var paths = this.get("paths"); - var alignment = this.get("alignment"); + var strategy = this.get("strategy"); var oSelf = this; Y.io(paths.deep_voc_stats, { data: { url:voc, - strategy:alignment + strategy:strategy }, on: { success:function(e,r) { @@ -190,7 +190,7 @@ YUI.add('infobox', function(Y) { }, _setProperties : function(selected) { - var alignment = this.get("alignment"), + var strategy = this.get("strategy"), content = this.get("srcNode"); if(selected) { @@ -270,7 +270,7 @@ YUI.add('infobox', function(Y) { Y.io(this.get("paths").hint, { data: { - strategy: this.get("alignment"), + strategy: this.get("strategy"), lastAction: this.get("lastAction"), focus: focus }, diff --git a/web/js/mapping.js b/web/js/mapping.js index 1032b2c..0fa986a 100644 --- a/web/js/mapping.js +++ b/web/js/mapping.js @@ -15,7 +15,7 @@ YUI.add('mapping', function(Y) { } Mapping.NAME = "mapping"; Mapping.ATTRS = { - alignment : { value: null }, + strategy : { value: null }, selected : { value: null }, builder : { value: null }, paths:{ @@ -76,7 +76,7 @@ YUI.add('mapping', function(Y) { this.mappingtable = new Y.MappingTable({ srcNode: NODE_MAPPING_TABLE, datasource:DS, - alignment: this.get("alignment"), + strategy: this.get("strategy"), mapping:mapping }); }, @@ -117,7 +117,7 @@ YUI.add('mapping', function(Y) { this.detailOverlay.set("visible", false); var cs = this._getSelection(); var c = cs[0]; - c.alignment = this.get("alignment"); + c.strategy = this.get("strategy"); c.mapping = this.get("selected").uri; if (c.relation) { this._submitCorrespondence(c); @@ -184,7 +184,7 @@ YUI.add('mapping', function(Y) { server = this.get("paths").cinfo; var data = { - alignment:this.get("alignment"), + strategy:this.get("strategy"), mapping:this.get("selected").uri, source: this._source, target: this._target, diff --git a/web/js/mappingtable.js b/web/js/mappingtable.js index f781d21..3d3e3f3 100644 --- a/web/js/mappingtable.js +++ b/web/js/mappingtable.js @@ -12,7 +12,7 @@ YUI.add('mappingtable', function(Y) { MappingTable.NAME = "mappingtable"; MappingTable.ATTRS = { srcNode: { value: null }, - alignment: { value: null }, + strategy: { value: null }, mapping: { value: null }, datasource: { value: null }, showRelation: { value: false }, @@ -92,7 +92,7 @@ YUI.add('mappingtable', function(Y) { var oSelf = this, mapping = this.get("mapping"), datasource = this.get("datasource"), - alignment = this.get("alignment"), + strategy = this.get("strategy"), table = this.table, paginator = this.paginator; @@ -119,7 +119,7 @@ YUI.add('mappingtable', function(Y) { if(mapping) { conf = conf ? conf : {}; conf.url = mapping; - conf.alignment=alignment; + conf.strategy=strategy; this.set("loading", true); datasource.sendRequest({ request:'?'+Y.QueryString.stringify(conf), diff --git a/web/js/startpage.js b/web/js/startpage.js index 4b7f90a..27010b9 100644 --- a/web/js/startpage.js +++ b/web/js/startpage.js @@ -44,8 +44,8 @@ YUI.add('startpage', function(Y) { }); - // the start button for the open alignment selector is only shown when - // an alignment is selected + // the start button for the open strategy selector is only shown when + // an strategy is selected Y.all("#open .option").on("click", function(e) { e.target.toggleClass("selected"); var nodes = Y.Node.all("#open .selected"); @@ -55,8 +55,8 @@ YUI.add('startpage', function(Y) { Y.all("#open .start").set("disabled", true); } }); - // the start button for the publish alignment selector is only shown when - // an alignment is selected + // the start button for the publish strategy selector is only shown when + // an strategy is selected Y.all("#publish .option").on("click", function(e) { e.target.toggleClass("selected"); var nodes = Y.Node.all("#publish .selected"); diff --git a/web/js/strategy_viz.js b/web/js/strategy_viz.js index 7846997..464d355 100644 --- a/web/js/strategy_viz.js +++ b/web/js/strategy_viz.js @@ -11,15 +11,9 @@ YUI.add('strategy_viz', function(Y) { } StratViz.NAME = "strategy_viz"; StratViz.ATTRS = { - alignment: { - value: null - }, - paths: { - value: null - }, - selected: { - value: null - } + strategy: { value: null }, + paths: { value: null }, + selected: { value: null } }; Y.extend(StratViz, Y.Widget, { @@ -52,7 +46,7 @@ YUI.add('strategy_viz', function(Y) { updateGraph : function(uri) { var oSelf = this, paths = this.get("paths"), - data = {"alignment":this.get("alignment")}; + data = {"strategy":this.get("strategy")}; if(uri) { data.selected = uri diff --git a/web/js/vocabulary.js b/web/js/vocabulary.js index 81dad86..f8c8bc5 100644 --- a/web/js/vocabulary.js +++ b/web/js/vocabulary.js @@ -14,7 +14,7 @@ YUI.add('vocabulary', function(Y) { conceptscheme : { value: null }, - alignment : { + strategy : { value: null }, selected : { @@ -127,7 +127,7 @@ YUI.add('vocabulary', function(Y) { }, fetchMappings : function() { - var alignment = this.get("alignment"), + var strategy = this.get("strategy"), mappingNode = this.mappingList, mappingSelect = this.mappingSelect, currentMappings = this._currentMappings; @@ -154,7 +154,7 @@ YUI.add('vocabulary', function(Y) { Y.io(this.get("paths").mappinglist, { data: { - 'alignment':alignment + 'strategy':strategy }, on:{ success:formatMappings