Search in sources :

Example 81 with Quad

use of org.apache.jena.sparql.core.Quad in project jena by apache.

the class TestFactoryRDF method factoryRDF_quad_01.

@Test
public void factoryRDF_quad_01() {
    Node g = factory.createURI("http://test/g");
    Node s = factory.createURI("http://test/s");
    Node p = factory.createURI("http://test/p");
    Node o = factory.createURI("http://test/o");
    Quad quad = factory.createQuad(g, s, p, o);
    assertEquals(g, quad.getGraph());
    assertEquals(s, quad.getSubject());
    assertEquals(p, quad.getPredicate());
    assertEquals(o, quad.getObject());
}
Also used : Quad(org.apache.jena.sparql.core.Quad) LabelToNode(org.apache.jena.riot.lang.LabelToNode) Node(org.apache.jena.graph.Node) Test(org.junit.Test)

Example 82 with Quad

use of org.apache.jena.sparql.core.Quad in project jena by apache.

the class TestSerializable method serialize_quad_01.

@Test
public void serialize_quad_01() throws Exception {
    Quad q = SSE.parseQuad("(:g :s :p :o)");
    Quad q1 = roundTrip(q);
    assertEquals(q, q1);
}
Also used : Quad(org.apache.jena.sparql.core.Quad) Test(org.junit.Test)

Example 83 with Quad

use of org.apache.jena.sparql.core.Quad in project jena by apache.

the class TestSerializable method serialize_quad_02.

@Test
public void serialize_quad_02() throws Exception {
    Quad q = SSE.parseQuad("(_ :s :p :o)");
    Quad q1 = roundTrip(q);
    assertEquals(q, q1);
    assertNotEquals(q.getSubject(), q1.getObject());
}
Also used : Quad(org.apache.jena.sparql.core.Quad) Test(org.junit.Test)

Example 84 with Quad

use of org.apache.jena.sparql.core.Quad in project jena by apache.

the class TestSerializable method serialize_quad_03.

@Test
public void serialize_quad_03() throws Exception {
    Quad q = SSE.parseQuad("(<_:abc> ?y ?x <_:abc>)");
    Quad q1 = roundTrip(q);
    assertEquals(q, q1);
    assertEquals(q.getGraph(), q1.getObject());
}
Also used : Quad(org.apache.jena.sparql.core.Quad) Test(org.junit.Test)

Example 85 with Quad

use of org.apache.jena.sparql.core.Quad in project jena by apache.

the class spatialindexer method exec.

@Override
protected void exec() {
    // Set<Node> properties = getIndexedProperties() ;
    spatialIndex.startIndexing();
    Iterator<Quad> quadIter = dataset.find(Node.ANY, Node.ANY, Node.ANY, Node.ANY);
    for (; quadIter.hasNext(); ) {
        Quad quad = quadIter.next();
        context.index(quad.getGraph(), quad.getSubject(), quad.getPredicate(), quad.getObject());
        progressMonitor.progressByOne();
    }
    spatialIndex.finishIndexing();
    progressMonitor.close();
}
Also used : Quad(org.apache.jena.sparql.core.Quad)

Aggregations

Quad (org.apache.jena.sparql.core.Quad)161 Test (org.junit.Test)91 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)49 Node (org.apache.jena.graph.Node)36 BaseTest (org.apache.jena.atlas.junit.BaseTest)32 Triple (org.apache.jena.graph.Triple)25 UpdateBuilder (org.apache.jena.arq.querybuilder.UpdateBuilder)14 Update (org.apache.jena.update.Update)14 QuadWritable (org.apache.jena.hadoop.rdf.types.QuadWritable)12 ResultSet (java.sql.ResultSet)8 ArrayList (java.util.ArrayList)8 TripleWritable (org.apache.jena.hadoop.rdf.types.TripleWritable)7 Var (org.apache.jena.sparql.core.Var)7 LongWritable (org.apache.hadoop.io.LongWritable)6 UpdateDataDelete (org.apache.jena.sparql.modify.request.UpdateDataDelete)6 UpdateDataInsert (org.apache.jena.sparql.modify.request.UpdateDataInsert)6 Element (org.apache.jena.sparql.syntax.Element)6 Graph (org.apache.jena.graph.Graph)5 BasicPattern (org.apache.jena.sparql.core.BasicPattern)4 IOException (java.io.IOException)3