X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmetadata%2FmetadataDb.ml;h=e7e60fafff64e823519d50bfba721fe51c91dc25;hb=7403c949ea3a84624f8c05deee00de53336937ba;hp=3d618a52cdb7db8c7a7edf122c38b8650950b311;hpb=21758b512843088d19e81830d9fb121725c8a16e;p=helm.git diff --git a/helm/ocaml/metadata/metadataDb.ml b/helm/ocaml/metadata/metadataDb.ml index 3d618a52c..e7e60faff 100644 --- a/helm/ocaml/metadata/metadataDb.ml +++ b/helm/ocaml/metadata/metadataDb.ml @@ -23,18 +23,12 @@ * 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;