use of org.apache.rya.streams.kafka.topology.TopologyFactory.ProcessorEntry in project incubator-rya by apache.
the class TopologyFactoryTest method projectionStatementPattern.
@Test
public void projectionStatementPattern() throws Exception {
final String query = "SELECT * WHERE { " + "?person <urn:talksTo> ?otherPerson . " + "}";
FACTORY.build(query, "source", "sink", new RandomUUIDFactory());
final List<ProcessorEntry> entries = FACTORY.getProcessorEntry();
assertTrue(entries.get(0).getNode() instanceof Projection);
assertTrue(entries.get(1).getNode() instanceof StatementPattern);
final StatementPattern expected = new StatementPattern(new Var("person"), TALKS_TO, new Var("otherPerson"));
assertEquals(expected, entries.get(1).getNode());
}
use of org.apache.rya.streams.kafka.topology.TopologyFactory.ProcessorEntry in project incubator-rya by apache.
the class TopologyFactoryTest method projectionJoinJoinStatementPattern.
@Test
public void projectionJoinJoinStatementPattern() throws Exception {
final String query = "SELECT * WHERE { " + "?person <urn:talksTo> ?otherPerson . " + "?otherPerson <urn:talksTo> ?dog . " + "?dog <urn:chews> ?toy . " + "}";
FACTORY.build(query, "source", "sink", new RandomUUIDFactory());
final List<ProcessorEntry> entries = FACTORY.getProcessorEntry();
assertTrue(entries.get(0).getNode() instanceof Projection);
assertTrue(entries.get(1).getNode() instanceof Join);
assertTrue(entries.get(2).getNode() instanceof Join);
StatementPattern expected = new StatementPattern(new Var("person"), TALKS_TO, new Var("otherPerson"));
assertEquals(expected, entries.get(3).getNode());
expected = new StatementPattern(new Var("otherPerson"), TALKS_TO, new Var("dog"));
assertEquals(expected, entries.get(4).getNode());
expected = new StatementPattern(new Var("dog"), CHEWS, new Var("toy"));
assertEquals(expected, entries.get(5).getNode());
}
use of org.apache.rya.streams.kafka.topology.TopologyFactory.ProcessorEntry in project incubator-rya by apache.
the class TopologyFactoryTest method projectionStatementPattern_rebind.
@Test
public void projectionStatementPattern_rebind() throws Exception {
final String query = "CONSTRUCT { ?person <urn:mightKnow> ?otherPerson } WHERE { " + "?person <urn:talksTo> ?otherPerson . " + "}";
FACTORY.build(query, "source", "sink", new RandomUUIDFactory());
final List<ProcessorEntry> entries = FACTORY.getProcessorEntry();
assertTrue(entries.get(0).getNode() instanceof Projection);
final StatementPattern expected = new StatementPattern(new Var("person"), TALKS_TO, new Var("otherPerson"));
assertEquals(expected, entries.get(1).getNode());
}
use of org.apache.rya.streams.kafka.topology.TopologyFactory.ProcessorEntry in project incubator-rya by apache.
the class TopologyFactoryTest method projectionJoinStatementPattern.
@Test
public void projectionJoinStatementPattern() throws Exception {
final String query = "SELECT * WHERE { " + "?person <urn:talksTo> ?otherPerson . " + "?otherPerson <urn:talksTo> ?dog . " + "}";
FACTORY.build(query, "source", "sink", new RandomUUIDFactory());
final List<ProcessorEntry> entries = FACTORY.getProcessorEntry();
assertTrue(entries.get(0).getNode() instanceof Projection);
assertTrue(entries.get(1).getNode() instanceof Join);
StatementPattern expected = new StatementPattern(new Var("person"), TALKS_TO, new Var("otherPerson"));
assertEquals(expected, entries.get(2).getNode());
expected = new StatementPattern(new Var("otherPerson"), TALKS_TO, new Var("dog"));
assertEquals(expected, entries.get(3).getNode());
}
Aggregations