use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.
the class TestReorder method match_07.
@Test
public void match_07() {
StatsMatcher matcher = matcher("((BNODE :p VAR) 5)");
Triple t = triple("(_:a :p ?v)");
double d = matcher.match(t);
assertEquals(5, d, 0);
}
use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.
the class TestReorder method stats_01.
@Test
public void stats_01() {
StatsMatcher m = matcher("((:x :p ANY) 5)");
ReorderTransformation transform = new ReorderWeighted(m);
BasicPattern bgp = bgp("(bgp)");
BasicPattern bgp2 = transform.reorder(bgp);
assertEquals(bgp2, bgp);
}
use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.
the class TestReorder method match_25.
// Bounds abbreviation rules.
@Test
public void match_25() {
StatsMatcher matcher = matcher("(:p 3) (other 1)");
Triple t = triple("(?x :p ?v)");
double d = matcher.match(t);
assertEquals(3, d, 0);
}
use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.
the class TestReorder method match_09.
@Test
public void match_09() {
StatsMatcher matcher = matcher("((VAR :p LITERAL) 5)");
Triple t = triple("(?x :p 1913)");
double d = matcher.match(t);
assertEquals(5, d, 0);
}
use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.
the class TestReorder method match_11.
@Test
public void match_11() {
StatsMatcher matcher = matcher("((VAR :p ANY) 10) ((VAR :p LITERAL) 5)");
Triple t = triple("(?x :p 1913)");
double d = matcher.match(t);
assertEquals(10, d, 0);
}
Aggregations