Search in sources :

Example 16 with StatsMatcher

use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.

the class TestReorder method match_21.

@Test
public void match_21() {
    StatsMatcher matcher = matcher("(:p 10) ");
    Triple t = triple("(?x :p 1913)");
    double d = matcher.match(t);
    assertEquals(StatsMatcher.weightPO_small, d, 0);
}
Also used : Triple(org.apache.jena.graph.Triple) StatsMatcher(org.apache.jena.sparql.engine.optimizer.StatsMatcher) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 17 with StatsMatcher

use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.

the class TestReorder method match_04.

@Test
public void match_04() {
    StatsMatcher matcher = matcher("((TERM :p VAR) 5)");
    Triple t = triple("(:x :p ?v)");
    double d = matcher.match(t);
    assertEquals(5, d, 0);
}
Also used : Triple(org.apache.jena.graph.Triple) StatsMatcher(org.apache.jena.sparql.engine.optimizer.StatsMatcher) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 18 with StatsMatcher

use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.

the class TestReorder method match_03.

@Test
public void match_03() {
    StatsMatcher matcher = matcher("((:x :p VAR) 5)");
    Triple t = triple("(:x :p ?v)");
    double d = matcher.match(t);
    assertEquals(5, d, 0);
}
Also used : Triple(org.apache.jena.graph.Triple) StatsMatcher(org.apache.jena.sparql.engine.optimizer.StatsMatcher) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 19 with StatsMatcher

use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.

the class TestReorder method match_05.

@Test
public void match_05() {
    StatsMatcher matcher = matcher("((URI :p VAR) 5)");
    Triple t = triple("(:x :p ?v)");
    double d = matcher.match(t);
    assertEquals(5, d, 0);
}
Also used : Triple(org.apache.jena.graph.Triple) StatsMatcher(org.apache.jena.sparql.engine.optimizer.StatsMatcher) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 20 with StatsMatcher

use of org.apache.jena.sparql.engine.optimizer.StatsMatcher in project jena by apache.

the class TestReorder method match_22.

@Test
public void match_22() {
    StatsMatcher matcher = matcher("(:p 11)");
    Triple t = triple("(:x :p 1913)");
    double d = matcher.match(t);
    assertEquals(1, d, 0);
}
Also used : Triple(org.apache.jena.graph.Triple) StatsMatcher(org.apache.jena.sparql.engine.optimizer.StatsMatcher) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Aggregations

StatsMatcher (org.apache.jena.sparql.engine.optimizer.StatsMatcher)21 BaseTest (org.apache.jena.atlas.junit.BaseTest)20 Test (org.junit.Test)20 Triple (org.apache.jena.graph.Triple)19 BasicPattern (org.apache.jena.sparql.core.BasicPattern)1 Item (org.apache.jena.sparql.sse.Item)1