open Dbconn;;
open Utility;;
+let quoted s = Str.global_substitute (Str.regexp "'") (function _ -> "\\'") s
(* Cerca in una lista di assegnamenti (lista di coppie (path,path) dove path e'
di tipo (string * string list) quello relativo alla proprietà p e ne
"refObj"
| "backPointer" -> (* proprieta` refObj e backPointer *)
- print_endline "IN BACKPOINTER";
+(* print_endline "IN BACKPOINTER"; *)
let prop = get_prop_id relk in
if assl = [] then (* se non ci sono assegnamenti *)
let c = pgc () 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='" ^ uri ^ "'")) in
+ let tv = pgresult_to_string (c#exec ("select id from registry where uri='" ^ quoted uri ^ "'")) in
let qq = "select uri from t" ^ tv ^ " where prop_id='" ^ prop ^ "' order by uri asc" in
- print_endline qq;
+(* print_endline qq; *)
let res = c#exec qq in
let l = (pgresult_to_string_list res) in
- List.iter print_endline l;
+(* List.iter print_endline l; *)
(List.map
(function
[uri] -> [(uri,[])]
let c = pgc () 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='" ^ uri ^ "'")) in
+ let tv = pgresult_to_string (c#exec ("select id from registry where uri='" ^ quoted uri ^ "'")) in
let qq = "select uri, position, depth from t" ^ tv ^ " where prop_id='" ^ prop ^ "' order by uri asc" in
print_endline qq;
let res = c#exec qq in
[uri;position;depth] -> [(uri,[[((pos, []),[position])]])]
| _ -> assert false )
res#get_list) @ acc
- else (* voglio solo depth *)
+ else (* voglio solo depth *)
(List.map
(function
[uri;position;depth] -> [(uri,[[((dep, []),[depth])]])]