From 0c62b48dd8d961279e780f6fbc2a915d18b77b92 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Thu, 21 Nov 2002 18:16:50 +0000 Subject: [PATCH] WARNING!!! From now on the V7_3_new_exportation branches of ocaml/mathql and ocaml/mathql_interpreter are DEPRECATED!!! You must switch back to the main branch. --- helm/gTopLevel/gTopLevel.ml | 7 ++++-- helm/gTopLevel/mQueryGenerator.ml | 39 ++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/helm/gTopLevel/gTopLevel.ml b/helm/gTopLevel/gTopLevel.ml index 8ec91964e..4a2fdc561 100644 --- a/helm/gTopLevel/gTopLevel.ml +++ b/helm/gTopLevel/gTopLevel.ml @@ -2631,8 +2631,11 @@ let initialize_everything () = let _ = if !usedb then - Mqint.init "dbname=helm_mowgli" ; -(* Mqint.init "host=mowgli.cs.unibo.it dbname=helm_mowgli user=helm" ; *) + begin + Mqint.set_database Mqint.postgres_db ; + (* Mqint.init "dbname=helm_mowgli" ; *) + Mqint.init "host=mowgli.cs.unibo.it dbname=helm_mowgli user=helm" ; + end ; ignore (GtkMain.Main.init ()) ; initialize_everything () ; if !usedb then Mqint.close (); diff --git a/helm/gTopLevel/mQueryGenerator.ml b/helm/gTopLevel/mQueryGenerator.ml index 8616cf9d2..b91261c07 100644 --- a/helm/gTopLevel/mQueryGenerator.ml +++ b/helm/gTopLevel/mQueryGenerator.ml @@ -199,19 +199,27 @@ let execute_query query = let locate s = let module M = MathQL in - let q = M.Ref (M.Fun "objectName" (M.Const [s])) in - execute_query q + let q = + M.Ref (M.Attribute true M.RefineExact ("objectName", []) (M.Const [s])) + in + execute_query q let searchPattern e c t level = let module M = MathQL in let v_pos = M.Const ["MainConclusion"; "InConclusion"] in - let q_where = M.Sub (M.RefOf ( - M.Select ("uri", - M.Relation (M.ExactOp, ["refObj"], M.RVar "uri0", ["pos"]), - M.Ex ["uri"] (M.Meet (M.VVar "positions", M.Record ("uri", "pos"))) - )), M.VVar "universe" - ) - in + let q_where = + M.Sub + (M.RefOf + (M.Select + ("uri", + M.Relation + (false, M.RefineExact, ("refObj", []), M.RVar "uri0", ["pos"]), + M.Ex ["uri"] + (M.Meet (M.VVar "positions", M.Record ("uri", ("pos", [])))) + ) + ), + M.VVar "universe" + ) in let uri_of_entry (r, b, v) = r in let rec restrict level = function | [] -> [] @@ -220,13 +228,16 @@ let searchPattern e c t level = else restrict level tail in let build_select (r, b, v) = - let pos = if b then "MainConclusion" else "InConclusion" in + let pos = if b then "MainConclusion" else "InConclusion" in M.Select ("uri", - M.Relation (M.ExactOp, ["backPointer"], M.Ref (M.Const [r]), ["pos"]), - M.Ex ["uri"] (M.Sub (M.Const [pos], M.Record ("uri", "pos"))) - ) - in + M.Relation + (false, + M.RefineExact, + ("backPointer", []), + M.Ref (M.Const [r]), + ["pos"]), + M.Ex ["uri"] (M.Sub (M.Const [pos], M.Record ("uri", ("pos", []))))) in let rec build_intersect = function | [] -> M.Pattern (M.Const [".*"]) | [hd] -> build_select hd -- 2.39.2