/** * Tests quads to triples conversion * * @throws IOException */ @Test public void triples_to_quads_mapper_01() throws IOException { MapDriver<LongWritable, TripleWritable, LongWritable, QuadWritable> driver = this.getMapDriver(); Triple t = new Triple(NodeFactory.createURI("http://s"), NodeFactory.createURI("http://p"), NodeFactory.createLiteral("test")); Quad q = new Quad(Quad.defaultGraphNodeGenerated, t); driver.withInput(new Pair<LongWritable, TripleWritable>(new LongWritable(1), new TripleWritable(t))).withOutput( new Pair<LongWritable, QuadWritable>(new LongWritable(1), new QuadWritable(q))); driver.runTest(); }
/** * Tests quads to triples conversion * * @throws IOException */ @Test public void quads_to_triples_mapper_01() throws IOException { MapDriver<LongWritable, QuadWritable, LongWritable, TripleWritable> driver = this.getMapDriver(); Triple t = new Triple(NodeFactory.createURI("http://s"), NodeFactory.createURI("http://p"), NodeFactory.createLiteral("test")); Quad q = new Quad(Quad.defaultGraphNodeGenerated, t); driver.withInput(new Pair<LongWritable, QuadWritable>(new LongWritable(1), new QuadWritable(q))).withOutput( new Pair<LongWritable, TripleWritable>(new LongWritable(1), new TripleWritable(t))); driver.runTest(); }
/** * Tests quads to triples conversion * * @throws IOException */ @Test public void triples_to_quads_mapper_01() throws IOException { MapDriver<LongWritable, TripleWritable, LongWritable, QuadWritable> driver = this.getMapDriver(); Triple t = new Triple(NodeFactory.createURI("http://s"), NodeFactory.createURI("http://p"), NodeFactory.createLiteral("test")); Quad q = new Quad(t.getSubject(), t); driver.withInput(new Pair<LongWritable, TripleWritable>(new LongWritable(1), new TripleWritable(t))).withOutput( new Pair<LongWritable, QuadWritable>(new LongWritable(1), new QuadWritable(q))); driver.runTest(); }