yaz/commit
allow view for any user
author | Michiel Hildebrand |
---|---|
Wed Feb 23 14:17:20 2011 +0100 | |
committer | Michiel Hildebrand |
Wed Feb 23 14:17:20 2011 +0100 | |
commit | ef305c7b12844a2b5af4e6e3e61aece8e4ac599d |
tree | 506bee4376f45c34ae9a520b2e7991161e2d9e88 |
parent | b1cfe3fb87f980f74073eeb2d99a280d026d89df |
Diff style: patch stat
diff --git a/applications/yaz_cgarden.pl b/applications/yaz_cgarden.pl index d2a0a68..ab46e5c 100644 --- a/applications/yaz_cgarden.pl +++ b/applications/yaz_cgarden.pl @@ -51,7 +51,7 @@ http_yaz_cgarden(Request) :- [optional(true), desription('When set only annotations within this process are shown')]), user(User, - [default(CurrentUser), + [optional(true),%default(CurrentUser), description('When set only annotations created by this user are shown')]), interval(Interval, [default(10000), @@ -73,9 +73,10 @@ http_yaz_cgarden(Request) :- ], _GardenProcess), video_annotations(Video, As0, Options), sort_by_arg(As0, 2, As), - rdf_equal(skos:inScheme,Inscheme), - rdf_equal(gtaa:'GTAA',GTAA), - link_tags_to_concepts(As, [Inscheme-GTAA], Annotations), + %rdf_equal(skos:inScheme,Inscheme), + %rdf_equal(gtaa:'GTAA',GTAA), + rdf_equal(skos:'Concept', SKOSConcept), + link_tags_to_concepts(As, SKOSConcept, Annotations), html_video_page(Process, Video, CurrentUser, Annotations, 0, Options). %% link_tags_to_concepts(+Annotations, -Annotations1) @@ -83,23 +84,18 @@ http_yaz_cgarden(Request) :- % Add candidate concepts. link_tags_to_concepts([], _, []). -link_tags_to_concepts([A0|As], Ps, [A|Rest]) :- - A0 = annotation(literal(Tag),Start,End,Entries), - A = annotation(literal(Tag),Start,End,Entries,Score,Concepts), - tag_score(Entries, Score), - ( reconcile(Tag, 3, [], Ps, Hits) +link_tags_to_concepts([A0|As], Type, [A|Rest]) :- + A0 = annotation(Tag,Start,End,Entries,Score), + A = annotation(Tag,Start,End,Entries,Score,Concepts), + tag_value(Tag, Value), + ( reconcile(Value, 3, Type, [], Hits) -> maplist(hit_concept, Hits, Concepts) ; Concepts = [] ), - maplist(hit_concept, Hits, Concepts), - link_tags_to_concepts(As, Ps, Rest). + link_tags_to_concepts(As, Type, Rest). -tag_score(Entries, Score) :- - findall(S, (member(i(E,_), Entries), - rdf(E, pprime:score, literal(S)) - ), - Ss), - sumlist(Ss, Score). +tag_value(literal(L), L). +tag_value(uri(_,L), L). hit_concept(hit(_,URI,_,Label), concept(URI,Label,Alt,Desc)) :- ( rdf_has(URI, rdfs:label, Lit), @@ -191,14 +187,14 @@ html_video_page_yui(Game, Video, User, Annotations, StartTime, _Options) --> symbol(fetchData), symbol({}), symbol(true)))*/ ]). -js_support_functions(Game, User) --> +js_support_functions(_Game, User) --> { http_location_by_id(http_yaz_api_cgarden_data, DataServer) }, js_function_decl(fetchData, [e], \[ -' var data = {user:"',User,'", - game:"',Game,'"}; - Y.io("',DataServer,'", {data: data, +' var data = {user:"',User,'"};', + %game:"',Game,'"}; +' Y.io("',DataServer,'", {data: data, on: {success:handleResponse} });\n' ]),