implement the Fun constructor in a uniform way.
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
(*
* 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)
- 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
- | _ -> []
+ | s::tl ->
+ let res =
+ let c = pgc () in
+ let q =
+ "select objectName.uri from objectName where objectName.value = '" ^
+ s ^ "'"
+ in
+ pgresult_to_string_list (c#exec q)
+ in
+ append (res,(fun_ex tab tl))
;;
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);
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
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);