Search in sources :

Example 21 with NodeWritable

use of org.apache.jena.hadoop.rdf.types.NodeWritable in project jena by apache.

the class RdfTypesTest method node_writable_variable_02.

/**
     * Basic node writable round tripping test
     * 
     * @throws IOException
     * @throws InstantiationException
     * @throws IllegalAccessException
     * @throws ClassNotFoundException
     */
@Test
@Ignore
public void node_writable_variable_02() throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException {
    Node n = NodeFactory.createVariable("really-log-variable-name-asddsfr4545egfdgdfgfdgdtgvdg-dfgfdgdfgdfgdfg4-dfvdfgdfgdfgfdgfdgdfgdfgfdg");
    NodeWritable nw = new NodeWritable(n);
    testWriteRead(nw, nw);
}
Also used : NodeWritable(org.apache.jena.hadoop.rdf.types.NodeWritable) Node(org.apache.jena.graph.Node) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 22 with NodeWritable

use of org.apache.jena.hadoop.rdf.types.NodeWritable in project jena by apache.

the class RdfTypesTest method node_writable_literal_06.

/**
     * Basic node writable round tripping test
     * 
     * @throws IOException
     * @throws InstantiationException
     * @throws IllegalAccessException
     * @throws ClassNotFoundException
     */
@Test
public void node_writable_literal_06() throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException {
    Node n = NodeFactory.createLiteral("12.3e4", XSDDatatype.XSDdouble);
    NodeWritable nw = new NodeWritable(n);
    testWriteRead(nw, nw);
}
Also used : NodeWritable(org.apache.jena.hadoop.rdf.types.NodeWritable) Node(org.apache.jena.graph.Node) Test(org.junit.Test)

Example 23 with NodeWritable

use of org.apache.jena.hadoop.rdf.types.NodeWritable in project jena by apache.

the class AbstractCharacteristicSetGeneratingReducerTests method characteristic_set_generating_reducer_04.

/**
     * Test basic characteristic set computation
     * 
     * @throws IOException
     */
@Test
public void characteristic_set_generating_reducer_04() throws IOException {
    MapReduceDriver<LongWritable, T, NodeWritable, T, CharacteristicSetWritable, NullWritable> driver = this.getMapReduceDriver();
    T tuple = this.createTuple(1, "http://predicate");
    driver.addInput(new LongWritable(1), tuple);
    tuple = this.createTuple(1, "http://other");
    driver.addInput(new LongWritable(1), tuple);
    // Single entry sets
    this.createSet(driver, 1, "http://predicate");
    this.createSet(driver, 1, "http://other");
    // Two entry sets
    this.createSet(driver, 1, "http://predicate", "http://other");
    driver.runTest(false);
}
Also used : NodeWritable(org.apache.jena.hadoop.rdf.types.NodeWritable) CharacteristicSetWritable(org.apache.jena.hadoop.rdf.types.CharacteristicSetWritable) LongWritable(org.apache.hadoop.io.LongWritable) NullWritable(org.apache.hadoop.io.NullWritable) Test(org.junit.Test)

Example 24 with NodeWritable

use of org.apache.jena.hadoop.rdf.types.NodeWritable in project jena by apache.

the class AbstractCharacteristicSetGeneratingReducerTests method characteristic_set_generating_reducer_03.

/**
     * Test basic characteristic set computation
     * 
     * @throws IOException
     */
@Test
public void characteristic_set_generating_reducer_03() throws IOException {
    MapReduceDriver<LongWritable, T, NodeWritable, T, CharacteristicSetWritable, NullWritable> driver = this.getMapReduceDriver();
    T tuple = this.createTuple(1, "http://predicate");
    driver.addInput(new LongWritable(1), tuple);
    tuple = this.createTuple(2, "http://predicate");
    driver.addInput(new LongWritable(2), tuple);
    this.createSet(driver, 2, "http://predicate");
    driver.runTest(false);
}
Also used : NodeWritable(org.apache.jena.hadoop.rdf.types.NodeWritable) CharacteristicSetWritable(org.apache.jena.hadoop.rdf.types.CharacteristicSetWritable) LongWritable(org.apache.hadoop.io.LongWritable) NullWritable(org.apache.hadoop.io.NullWritable) Test(org.junit.Test)

Example 25 with NodeWritable

use of org.apache.jena.hadoop.rdf.types.NodeWritable in project jena by apache.

the class AbstractCharacteristicSetGeneratingReducerTests method characteristic_set_generating_reducer_02.

/**
     * Test basic characteristic set computation
     * 
     * @throws IOException
     */
@Test
public void characteristic_set_generating_reducer_02() throws IOException {
    MapReduceDriver<LongWritable, T, NodeWritable, T, CharacteristicSetWritable, NullWritable> driver = this.getMapReduceDriver();
    T tuple = this.createTuple(1, "http://predicate");
    driver.addInput(new LongWritable(1), tuple);
    driver.addInput(new LongWritable(1), tuple);
    this.createSet(driver, 1, "http://predicate");
    driver.runTest(false);
}
Also used : NodeWritable(org.apache.jena.hadoop.rdf.types.NodeWritable) CharacteristicSetWritable(org.apache.jena.hadoop.rdf.types.CharacteristicSetWritable) LongWritable(org.apache.hadoop.io.LongWritable) NullWritable(org.apache.hadoop.io.NullWritable) Test(org.junit.Test)

Aggregations

NodeWritable (org.apache.jena.hadoop.rdf.types.NodeWritable)29 Test (org.junit.Test)19 Node (org.apache.jena.graph.Node)16 LongWritable (org.apache.hadoop.io.LongWritable)10 NullWritable (org.apache.hadoop.io.NullWritable)6 CharacteristicSetWritable (org.apache.jena.hadoop.rdf.types.CharacteristicSetWritable)5 Ignore (org.junit.Ignore)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1 Tuple (org.apache.jena.atlas.lib.tuple.Tuple)1 Triple (org.apache.jena.graph.Triple)1 CharacteristicWritable (org.apache.jena.hadoop.rdf.types.CharacteristicWritable)1 NodeTupleWritable (org.apache.jena.hadoop.rdf.types.NodeTupleWritable)1 QuadWritable (org.apache.jena.hadoop.rdf.types.QuadWritable)1 TripleWritable (org.apache.jena.hadoop.rdf.types.TripleWritable)1 Quad (org.apache.jena.sparql.core.Quad)1