01: package example.nz.org.take.r2ml.userv.domain;
02:
03: import java.util.Collection;
04:
05: import nz.org.take.KnowledgeBase;
06: import nz.org.take.Predicate;
07: import nz.org.take.Query;
08: import nz.org.take.r2ml.util.AbstractQueryGenerator;
09:
10: public class UServQueryGenerator extends AbstractQueryGenerator {
11:
12: public UServQueryGenerator() {
13: System.out.println("UServQueryGenerator loaded.");
14: }
15:
16: public void generateQueries(KnowledgeBase kb) {
17: Collection<Predicate> predicates = kb.getSupportedPredicates();
18: Collection<Query> queries = buildAllQueries(predicates);
19: // add queries
20: for (Query query : queries) {
21: if (!query.getInputParams()[0]
22: || (query.getInputParams().length > 1 && query
23: .getInputParams()[1])) {
24: ;// ommit this query
25: } else {
26: kb.add(query);
27: }
28: }
29: // System.out.println("generated querries for " + predicates.size()
30: // + " predicates");
31: }
32:
33: }
|