Example #1
0
  static {
    matcher = new StatsMatcher();

    // matcher.addPattern(new Pattern(1,   TERM, TERM, TERM)) ;     // SPO - built-in - not needed a
    // s a rule

    // Numbers choosen as an approximation for a graph of 100 triples
    matcher.addPattern(new Pattern(2, TERM, TERM, VAR)); // SP?
    matcher.addPattern(new Pattern(5, TERM, type, TERM)); // ? type O -- worse than ?PO
    matcher.addPattern(new Pattern(3, VAR, TERM, TERM)); // ?PO
    matcher.addPattern(new Pattern(2, TERM, TERM, TERM)); // S?O

    matcher.addPattern(new Pattern(10, TERM, VAR, VAR)); // S??
    matcher.addPattern(new Pattern(20, VAR, VAR, TERM)); // ??O
    matcher.addPattern(new Pattern(30, VAR, TERM, VAR)); // ?P?

    matcher.addPattern(new Pattern(MultiTermSampleSize, VAR, VAR, VAR)); // ???
  }
Example #2
0
 @Override
 public double weight(PatternTriple pt) {
   return matcher.match(pt);
 }