Search in sources :

Example 1 with StatsMatcher

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

the class TestReorder method match_01.

@Test
public void match_01() {
    StatsMatcher matcher = matcher("((:x :p ANY) 5)");
    Triple t = triple("(:x :p ?v)");
    double d = matcher.match(t);
    assertEquals(5.0, 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 2 with StatsMatcher

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

the class TestReorder method match_23.

@Test
public void match_23() {
    StatsMatcher matcher = matcher("(:p 11)");
    // No match.
    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)

Example 3 with StatsMatcher

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

the class TestReorder method match_08.

@Test
public void match_08() {
    StatsMatcher matcher = matcher("((VAR :p LITERAL) 5)");
    // No match
    Triple t = triple("(?x :p ?v)");
    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)

Example 4 with StatsMatcher

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

the class TestReorder method match_06.

@Test
public void match_06() {
    StatsMatcher matcher = matcher("((LITERAL :p VAR) 5)");
    // No match
    Triple t = triple("(:x :p ?v)");
    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)

Example 5 with StatsMatcher

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

the class TestReorder method match_02.

@Test
public void match_02() {
    StatsMatcher matcher = matcher("((:x :p ANY) 5)");
    // No match
    Triple t = triple("(:x :q ?v)");
    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