From: Claudio Sacerdoti Coen Date: Wed, 27 Nov 2002 10:59:12 +0000 (+0000) Subject: * The new query language (now broken) works only on the new DB X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=a0454e23c4afdcda8e5ef3e4f639852f4eac9c21;p=helm.git * The new query language (now broken) works only on the new DB helm_mowgli_new_schema. * InConclusion, InHypothesis and so on are now inserted in the DB with their namespace. --- diff --git a/helm/gTopLevel/gTopLevel.ml b/helm/gTopLevel/gTopLevel.ml index aca0fe12d..0546d02b5 100644 --- a/helm/gTopLevel/gTopLevel.ml +++ b/helm/gTopLevel/gTopLevel.ml @@ -2635,7 +2635,8 @@ let _ = begin Mqint.set_database Mqint.postgres_db ; (* Mqint.init "dbname=helm_mowgli" ; *) - Mqint.init "host=mowgli.cs.unibo.it dbname=helm_mowgli user=helm" ; + (* Mqint.init "host=mowgli.cs.unibo.it dbname=helm_mowgli user=helm" ; *) + Mqint.init "host=mowgli.cs.unibo.it dbname=helm_mowgli_new_schema user=helm" ; end ; ignore (GtkMain.Main.init ()) ; initialize_everything () ; diff --git a/helm/gTopLevel/mQueryGenerator.ml b/helm/gTopLevel/mQueryGenerator.ml index 75c23e837..843eb96c0 100644 --- a/helm/gTopLevel/mQueryGenerator.ml +++ b/helm/gTopLevel/mQueryGenerator.ml @@ -99,9 +99,13 @@ let locate s = let searchPattern e c t level = let module M = MathQL in let module L = MQueryLevels in + let mainConclusion = + "http://www.cs.unibo.it/helm/schemas/schema-helm#MainConclusion" in + let inConclusion = + "http://www.cs.unibo.it/helm/schemas/schema-helm#InConclusion" in let in_path s = (s, []) in let assign v p = (in_path v, in_path p) in - let v_pos = M.Const ["MainConclusion"; "InConclusion"] in + let v_pos = M.Const [mainConclusion; inConclusion] in let q_where = M.Sub (M.RefOf @@ -125,7 +129,7 @@ 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 (false, M.RefineExact, ("backPointer", []), @@ -144,4 +148,5 @@ let searchPattern e c t level = let universe = M.Const (List.map uri_of_entry levels) in let q_let_u = M.LetVVar ("universe", universe, q_select) in let q_let_p = M.LetVVar ("positions", v_pos, q_let_u) in +prerr_endline ("### " ^ MQueryUtil.text_of_query q_let_p) ; execute_query q_let_p