From 51d8b6d756afd9d1dff6e920876d782c376cb80c Mon Sep 17 00:00:00 2001 From: Sebastien Ferre Date: Fri, 2 Dec 2022 15:29:03 +0100 Subject: [PATCH] bug fix: rereshing when term constraint is reset --- lis.ml | 13 +- webapp/osparklis.js | 3463 +++++++++++++++++++++---------------------- 2 files changed, 1736 insertions(+), 1740 deletions(-) diff --git a/lis.ml b/lis.ml index 77cbf6b..a77404a 100644 --- a/lis.ml +++ b/lis.ml @@ -780,9 +780,10 @@ let geolocations_of_results (geolocs : (Sparql.term * (Rdf.var * Rdf.var)) list) let ajax_external_search_constr ~endpoint (search : Lisql.search) (k : (Lisql.constr, exn) Result.t -> unit) : unit = match search with + | WikidataSearch [] -> k (Result.Ok Lisql.True) | WikidataSearch kwds -> let query = String.concat "+" kwds in - let limit = 20 in + let limit = 30 in Jsutils.Wikidata.ajax_entity_search query limit (function @@ -799,6 +800,7 @@ let ajax_external_search_constr ~endpoint (search : Lisql.search) (k : (Lisql.co le in k (Result.Ok (Lisql.ExternalSearch (search, Some lt))) | (Result.Error _ as err) -> k err) + | TextQuery [] -> k (Result.Ok Lisql.True) | TextQuery kwds -> let lucene = Jsutils.lucene_query_of_kwds kwds in if lucene = "" @@ -958,11 +960,7 @@ object (self) | false, false -> OnlyIRIs method ajax_sparql_results ?limit term_constr elts (k : unit -> unit) : unit = - (* if limit or term_constr new, then redefine SPARQL query and results, and continue when ready *) - if results_ok && (limit = None || limit = Some current_limit) && term_constr = current_term_constr - then k () - else ( - (* define the new SPARQL query *) + (* define the new SPARQL query *) let limit = match limit with | None -> config_max_results#value @@ -1003,8 +1001,7 @@ object (self) (fun code -> (* no state update *) k ()) - ) - + method id_typing (id : Lisql.id) : Lisql_type.datatype list = try diff --git a/webapp/osparklis.js b/webapp/osparklis.js index b36e1b3..22ef93f 100644 --- a/webapp/osparklis.js +++ b/webapp/osparklis.js @@ -1,15 +1,15 @@ // Generated by js_of_ocaml 3.7.1 (function(ai){"use strict";var -wy="black",fd=260469468,go="children",MG=1650,MF=1351,gy="date",O1=1110,bN="la",O0=-171652197,kV="add",OZ=42558696,bH=3903731,aA=365180284,J0="save_expanded_terms",dg=771172693,Hf="[]",d7=-66304437,JZ="matches regexp (case insensitive)",ME="arg1",Hd="set_navigation",He="fecha",OY="save_ui_state",Hc="endsWith",xs="block",wx="StartsWith",Hb=815,q1="title",iK="result",a9=-512962225,OX=891,zd="id2",q0="abort_all_ajax",OW="MinimumConv",Ha="novalue/",ww="IsBlank",em="endpoint",JY=122,JX="new_place",xr=" (",G$="results_slides",OV=456275501,JW="\xc3\xa0",xq="vars",na=128,hf=">",zc="como",xp="float",MD=287411743,yj="by",zb=1027,gn="en",MC=933,r0="GET",iJ="matches",rZ=" ++ ",OU=-629094236,G_="arg2",yi="Const",wv=2147483000.,xo="In",MB=1251,JV="xsd:date",qZ="hierarchy",OT="Div",yh=-1067049653,fj=770676513,xn="n\xc3\xbamero",G9=172069535,nM="e",za=338643209,G8="p:",JU="strends",qY="tooltip_sample",kt=206270158,kE="missing (",G7=" URIs",fk="lisql.ml",JT='",nt=" * ",k5=">=",qU=955169437,Mo="o",Mn="host",wp="list",iG=256,wo="les",xg=-977585392,OE='