]> matita.cs.unibo.it Git - helm.git/commitdiff
Fun patched but works only in one direction (from the alias to the uri).
authornatile <??>
Mon, 28 Oct 2002 10:36:40 +0000 (10:36 +0000)
committernatile <??>
Mon, 28 Oct 2002 10:36:40 +0000 (10:36 +0000)
helm/ocaml/mathql_interpreter/.depend
helm/ocaml/mathql_interpreter/func.ml
helm/ocaml/mathql_interpreter/mqint.ml

index 72a3dd440c059093fc40a9d469a2c8881013deeb..5629c47dffdb58a3df94aa5a317a71b31c6c2a73 100644 (file)
@@ -16,7 +16,7 @@ intersect.cmo: intersect.cmi
 intersect.cmx: intersect.cmi 
 func.cmo: dbconn.cmi intersect.cmi utility.cmi func.cmi 
 func.cmx: dbconn.cmx intersect.cmx utility.cmx func.cmi 
-mqint.cmo: context.cmo dbconn.cmi diff.cmi intersect.cmi meet.cmi \
+mqint.cmo: context.cmo dbconn.cmi diff.cmi func.cmi intersect.cmi meet.cmi \
     relation.cmi sub.cmi union.cmi mqint.cmi 
-mqint.cmx: context.cmx dbconn.cmx diff.cmx intersect.cmx meet.cmx \
+mqint.cmx: context.cmx dbconn.cmx diff.cmx func.cmx intersect.cmx meet.cmx \
     relation.cmx sub.cmx union.cmx mqint.cmi 
index 1338af00899bdfd7332cdf2e047d20e23503b0f4..bd262762952c47b229a6a1c332b078446f039494 100644 (file)
@@ -34,23 +34,14 @@ open Intersect;;
 (*
  * implementazione delle funzioni dublin core
  *)
-let rec func_dc tab outv inv = function
+let rec fun_ex tab = function
     [] -> []
   | s::tl -> let res =
              let c = pgc () in
-            let q = ("select " ^ tab ^ "." ^ outv ^ " from " ^ tab ^ " where " ^ tab ^ "." ^ inv ^ " = '" ^ s ^ "'") in
-             pgresult_to_string_list (c#exec q)
+            let q = ("select objectName.uri from objectName where objectName.value = '" ^ s ^ "'") in
+            print_endline ("@@@@LA QUERY E': " ^ q);
+            pgresult_to_string_list (c#exec q)
              in
-             append (res,(func_dc tab outv inv tl))
-;;
-
-(*
- *
- *)
-let fun_ex f value =
- match f with
-   "name" -> func_dc "names" "name" "uri" value
- | "reference" -> func_dc "names" "uri" "name" value
- | _ -> []
+             append (res,(fun_ex tab tl))
 ;;
 
index 54dc0e05c40d44c6fbedcf184f8109a5d8e547d4..64aea7d3373d682aada9ba33cf6604bcfd31ceb8 100644 (file)
@@ -54,7 +54,7 @@ let check () =
    let status = Dbconn.pgc () 
    in ()
 
-let stat = ref false
+let stat = ref true
 
 let set_stat b = stat := b
 
@@ -64,7 +64,7 @@ let postgres_db = "postgres"
 
 let galax_db = "galax"
 
-let dbname = ref postgres_db
+let dbname = ref galax_db
 
 let set_database s = 
     if s = postgres_db || s = galax_db then dbname := s
@@ -87,7 +87,7 @@ let rec exec_set_exp c = function
         let ll1 = string_of_int (List.length rs1) in
         let ll2 = string_of_int (List.length rs2) in
         let diff = string_of_float (after -. before) in
-       if ! stat then
+       if !stat then
         (print_endline("INTERSECT(" ^ ll1 ^ "," ^ ll2 ^ ") = " ^ string_of_int (List.length res) ^
          ": " ^ diff ^ "s");
          flush stdout);
@@ -97,7 +97,7 @@ let rec exec_set_exp c = function
        let res = union_ex (exec_set_exp c sexp1) (exec_set_exp c sexp2) in
        let after = Sys.time() in
        let diff = string_of_float (after -. before) in
-        if ! stat then
+        if !stat then
        (print_endline ("UNION: " ^ diff ^ "s");
          flush stdout);
         res                    
@@ -130,7 +130,7 @@ let rec exec_set_exp c = function
          res)
        else
         (let res = relation_galax_ex rop path (exec_set_exp c sexp) attl in
-         if ! stat then
+         if !stat then
          (print_string ("RELATION-GALAX " ^ (List.hd path) ^ " = " ^ string_of_int(List.length res) ^ ": ");
           print_endline (string_of_float (Sys.time() -. before) ^ "s");
           flush stdout);