]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_interpreter/relation.ml
final ispell
[helm.git] / helm / ocaml / mathql_interpreter / relation.ml
index f2402688d70d1628e23e6a29d308d1d2555a4e4c..044bb82d367bccec92f3756da9b38cd61f4c30d7 100644 (file)
@@ -30,8 +30,6 @@
  *)
 
 
-
-
 open Union;;
 open Dbconn;;
 open Utility;;
@@ -55,7 +53,7 @@ let get_prop_id prop =
 ;;
 
 
-let relation_ex inv rop path rset assl =
+let relation_ex handle inv rop path rset assl =
   let relk = fst path in
   match relk with
 
@@ -69,7 +67,7 @@ let relation_ex inv rop path rset assl =
 (*    print_endline "IN BACKPOINTER"; *)
     let prop = get_prop_id relk in
     if assl = [] then    (* se non ci sono assegnamenti *)
-      let c = pgc () in
+      let c = MQIConn.pgc handle in
       let rset_list =  (* lista di singoletti:resource_set di un elemento *)
       (List.fold_left (fun acc (uri,l) ->
         let tv = pgresult_to_string (c#exec ("select id from registry where uri='" ^ quoted uri ^ "'")) in
@@ -96,7 +94,7 @@ let relation_ex inv rop path rset assl =
   
              
     else               (* con assegnamenti *)
-      let c = pgc () in
+      let c = MQIConn.pgc handle in
       let rset_list =  (* lista di singoletti:resource_set di un elemento *)
       (List.fold_left (fun acc (uri,l) ->
         let tv = pgresult_to_string (c#exec ("select id from registry where uri='" ^ quoted uri ^ "'")) in
@@ -139,7 +137,7 @@ let relation_ex inv rop path rset assl =
 
   | "refRel" ->                        (* proprietà refRel *)
     if assl = [] then []    (* se non ci sono assegnamenti *)
-(*      let c = pgc () in
+(*      let c = MQIConn.pgc handle in
       let rset_list =  (* lista di singoletti:resource_set di un elemento *)
       (List.fold_left (fun acc (uri,l) ->
         let qq = "select uri from hrefRel order by uri asc" in
@@ -162,7 +160,7 @@ let relation_ex inv rop path rset assl =
   
     else               (* con assegnamenti *)
       if inv then   (* INVERSA *)
-        let c = pgc () in
+        let c = MQIConn.pgc handle in
         let rset_list =  (* lista di singoletti:resource_set di un elemento *)
         (List.fold_left (fun acc (uri,l) ->
           let qq = "select uri, position, depth from hrefRel order by uri asc" in
@@ -199,7 +197,7 @@ let relation_ex inv rop path rset assl =
         in  
         edup rset_list 
       else                          (* DIRETTA, con risorsa nulla *)
-        let c = pgc () in
+        let c = MQIConn.pgc handle in
         let rset_list =  (* lista di singoletti:resource_set di un elemento *)
         (List.fold_left (fun acc (uri,l) ->
           let qq = "select position, depth from hrefRel order by uri asc" in
@@ -247,7 +245,7 @@ let relation_ex inv rop path rset assl =
   
   | "refSort" ->                    (* proprietà refSort *)
     if assl = [] then []   (* se non ci sono assegnamenti *)
-(*      let c = pgc () in
+(*      let c = MQIConn.pgc handle in
       let rset_list =  (* lista di singoletti:resource_set di un elemento *)
       (List.fold_left (fun acc (uri,l) ->
         let qq = "select uri from hrefSort order by uri asc" in
@@ -272,7 +270,7 @@ let relation_ex inv rop path rset assl =
   
      else               (* con assegnamenti *)
        if inv then                               (*INVERSA ----> SISTEMARE: vedi refRel!!!!*)
-         let c = pgc () in
+         let c = MQIConn.pgc handle in
          let rset_list =  (* lista di singoletti:resource_set di un elemento *)
          (List.fold_left (fun acc (uri,l) ->
            let qq = "select uri, position, depth, sort from hrefSort order by uri asc" in
@@ -348,7 +346,7 @@ let relation_ex inv rop path rset assl =
          edup rset_list 
 
       else       (* DIRETTA con risorsa vuota ----> SISTEMARE: vedi refRel!!!!*)
-         let c = pgc () in
+         let c = MQIConn.pgc handle in
          let rset_list =  (* lista di singoletti:resource_set di un elemento *)
          (List.fold_left (fun acc (uri,l) ->
            let qq = "select position, depth, sort from hrefSort order by uri asc" in
@@ -499,7 +497,7 @@ let muse path assl r =
 
 (* prende un resource_set, una vvar (primo el. di assl) a cui associare la posizione, e la relazione (refObj o backPointer) e per ogni resource chiama la muse 
 NOTA: "rop" per ora non viene usato perche' vale sempre "ExactOp" *)
-let relation_galax_ex inv rop path rset assl = []
+let relation_galax_ex handle inv rop path rset assl = []
 
 (*