metadataExtractor.cmx: metadataTypes.cmx metadataExtractor.cmi
metadataPp.cmo: metadataTypes.cmi metadataPp.cmi
metadataPp.cmx: metadataTypes.cmx metadataPp.cmi
-metadataDb.cmo: metadataExtractor.cmi metadataPp.cmi metadataTypes.cmi \
+metadataDb.cmo: metadataTypes.cmi metadataPp.cmi metadataExtractor.cmi \
metadataDb.cmi
-metadataDb.cmx: metadataExtractor.cmx metadataPp.cmx metadataTypes.cmx \
+metadataDb.cmx: metadataTypes.cmx metadataPp.cmx metadataExtractor.cmx \
metadataDb.cmi
-metadataConstraints.cmo: metadataPp.cmi metadataTypes.cmi \
+metadataConstraints.cmo: metadataTypes.cmi metadataPp.cmi \
metadataConstraints.cmi
-metadataConstraints.cmx: metadataPp.cmx metadataTypes.cmx \
+metadataConstraints.cmx: metadataTypes.cmx metadataPp.cmx \
metadataConstraints.cmi
| Gt of int
| Lt of int
+type rating_criterion =
+ [ `Hits (** order by number of hits, most used objects first *)
+ ]
+
let tbln n = "table" ^ string_of_int n
(*
in
((n+2), from, where)
-let at_least ~(dbd:Mysql.dbd) ?concl_card ?full_card ?diff tables
+let at_least ~(dbd:Mysql.dbd) ?concl_card ?full_card ?diff ?rating tables
(metadata: MetadataTypes.constr list)
=
let obj_tbl,rel_tbl,sort_tbl,conclno_tbl,fullno_tbl,hypno_tbl = tables in
let from = String.concat ", " from in
let where = String.concat " and " where in
let query =
+ match rating with
(*
sprintf
("select table0.source from %s, %s where %s and %s.source = table0.source"
^^ " order by %s.no")
from fullno_tbl where fullno_tbl fullno_tbl
*)
- sprintf "select table0.source from %s where %s" from where
+ | None -> sprintf "select table0.source from %s where %s" from where
+ | Some `Hits ->
+ sprintf
+ ("select table0.source from %s, hits where %s"
+ ^^ " and hits.source = table0.source order by hits.no desc")
+ from where
in
(* prerr_endline query; *)
let result = Mysql.exec dbd query in
(fun row -> match row.(0) with Some s -> s | _ -> assert false)
let at_least
- ~(dbd:Mysql.dbd) ?concl_card ?full_card ?diff
+ ~(dbd:Mysql.dbd) ?concl_card ?full_card ?diff ?rating
(metadata: MetadataTypes.constr list)
=
let module MT = MetadataTypes in
if MT.are_tables_ownerized () then
- (at_least ~dbd ?concl_card ?full_card ?diff
+ (at_least ~dbd ?concl_card ?full_card ?diff ?rating
(MT.obj_tbl (),MT.rel_tbl (),MT.sort_tbl (),
MT.conclno_tbl (),MT.fullno_tbl (),MT.hypno_tbl ())
metadata)
@
- (at_least ~dbd ?concl_card ?full_card ?diff
+ (at_least ~dbd ?concl_card ?full_card ?diff ?rating
(MT.library_obj_tbl,MT.library_rel_tbl,MT.library_sort_tbl,
MT.library_conclno_tbl,MT.library_fullno_tbl,MT.library_hypno_tbl)
metadata)
else
- at_least ~dbd ?concl_card ?full_card ?diff
+ at_least ~dbd ?concl_card ?full_card ?diff ?rating
(MT.library_obj_tbl,MT.library_rel_tbl,MT.library_sort_tbl,
MT.library_conclno_tbl,MT.library_fullno_tbl,MT.library_hypno_tbl)
metadata
| Gt of int
| Lt of int
+type rating_criterion =
+ [ `Hits (** order by number of hits, most used objects first *)
+ ]
+
(** @param concl_card cardinality condition on conclusion only
* @param full_card cardinality condition on the whole statement
* @param diff required difference between the number of different constants in
?concl_card:cardinality_condition ->
?full_card:cardinality_condition ->
?diff:cardinality_condition ->
+ ?rating:rating_criterion ->
MetadataTypes.constr list ->
string list