X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql_interpreter%2Fmqint.ml;h=af3298cce4493df4696656db34c72393934b6cf0;hb=fd1cdc0fff3f15c67d949e016135c77c7c4a7ebd;hp=ba7d0713a592a3fd7b7a034d44ff833e45d465be;hpb=61872e154b77378c203e4a9b179b4067cfe7f23b;p=helm.git diff --git a/helm/ocaml/mathql_interpreter/mqint.ml b/helm/ocaml/mathql_interpreter/mqint.ml index ba7d0713a..af3298cce 100644 --- a/helm/ocaml/mathql_interpreter/mqint.ml +++ b/helm/ocaml/mathql_interpreter/mqint.ml @@ -33,8 +33,9 @@ open MathQL;; open Eval;; open Utility;; -open Dbconn;; + open Pattern;;*) +open Dbconn;; open Union;; open Intersect;; open Meet;; @@ -76,25 +77,7 @@ let see_prop_pool () = (match !prop_pool with Some l -> l | _ -> print_endline "ciao"; assert false) ;; -(* - * inizializzazione della connessione al database - *) -let init () = - let _ = Dbconn.init () in - let c = pgc () in - let res = - c#exec "select name,id from property where ns_id in (select id from namespace where url='http://www.cs.unibo.it/helm/schemas/mattone.rdf#')" - in - prop_pool := Some - ( - List.map - (function - a::b::_ -> (a, b) - | _ -> print_endline "no"; assert false - ) - res#get_list - ) -;; + let get_prop_id prop = if prop="refObj" then "F" @@ -249,18 +232,30 @@ let execute q = MQList qq -> xres_to_res (execute_ex [] qq) ;; -(* - * chiusura della connessione al database - *) -let close () = Dbconn.close ();; +let prop_pool = ref None;; *****************************************************************************) -let init () = () (* FG: implementare l'apertura del database *) - -let close () = () (* FG: implementare la chiusura del database *) +let init () = Dbconn.init () +(* + let c = pgc () in + let res = + c#exec "select name,id from property where ns_id in (select id from namespace where url='http://www.cs.unibo.it/helm/schemas/mattone.rdf#')" + in + prop_pool := Some + ( + List.map + (function + a::b::_ -> (a, b) + | _ -> print_endline "no"; assert false + ) + res#get_list + ) +*) +let close () = Dbconn.close () +let check () = Dbconn.pgc () exception BooleExpTrue @@ -350,3 +345,11 @@ and exec_val_exp c = function and execute x = exec_set_exp {svars = []; rvars = []; groups = []; vvars = []} x + + + +(* + * chiusura della connessione al database + *) + let close () = Dbconn.close ();; +