open MathQL;;
open Eval;;
open Utility;;
-open Dbconn;;
+
open Pattern;;*)
+open Dbconn;;
open Union;;
open Intersect;;
open Meet;;
*****************************************************************************)
-let init () = () (* FG: implementare l'apertura del database *)
+let prop_pool = ref None;;
+
+(*
+ * inizializzazione della connessione al database
+ *)
+
-let close () = () (* FG: implementare la chiusura del 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
+ )
+
and execute x =
exec_set_exp {svars = []; rvars = []; groups = []; vvars = []} x
+
+
+
+(*
+ * chiusura della connessione al database
+ *)
+ let close () = Dbconn.close ();;
+