]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/metadata/metadataDb.ml
implemented here at_least constraints matching engine
[helm.git] / helm / ocaml / metadata / metadataDb.ml
index 3d618a52cdb7db8c7a7edf122c38b8650950b311..e7e60fafff64e823519d50bfba721fe51c91dc25 100644 (file)
  * http://helm.cs.unibo.it/
  *)
 
+open MetadataTypes
+
 open Printf
 
 module DB = Dbi_mysql
 
-let sort_tbl = "refSort"
-let rel_tbl = "refRel"
-let obj_tbl = "refObj"
-let owners_tbl = "owners"
-let conclno_tbl = "no_inconcl_aux"
-let conclno_hyp_tbl = "no_concl_hyp"
-let name_tbl = "objectName"
-
 (* let baseuri = "http://www.cs.unibo.it/helm/schemas/schema-helm#" *)
 let baseuri = ""
 let inconcl_uri = baseuri ^ "InConclusion"
@@ -122,14 +116,14 @@ let clean ~(dbh: Dbi.connection) ~owner =
     in
     query#execute [];
     List.map
-      (function [source_col] -> source_col | _ -> assert false)
+      (function [`String source_col] -> source_col | _ -> assert false)
       (query#fetchall ())
   in
   let del_from tbl =
     let query =
       dbh#prepare (sprintf "DELETE FROM %s WHERE source LIKE \"?%%\"" tbl)
     in
-    query#execute owned_uris
+    List.iter (fun source_col -> query#execute [`String source_col]) owned_uris
   in
   List.iter del_from
     [sort_tbl; rel_tbl; obj_tbl; conclno_tbl; conclno_hyp_tbl; name_tbl;