use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method transaction_commit_read_01.
// Not all Transactional support abort.
@Test
public void transaction_commit_read_01() {
String testDataFile = DIR + "data.trig";
try (RDFConnection conn = connection()) {
conn.begin(ReadWrite.WRITE);
conn.loadDataset(dataset);
conn.commit();
conn.end();
conn.begin(ReadWrite.READ);
Model m = conn.fetch();
assertTrue(isomorphic(m, dataset.getDefaultModel()));
conn.end();
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class RDFConnectionExample3 method main.
public static void main(String... args) {
Query query = QueryFactory.create("SELECT * { <http://example.org/book/book1> ?p ?o }");
String queryService = "http://sparql.org/books/query";
// Query service, no update, no graph store protocol.
try (RDFConnection conn = RDFConnectionFactory.connect(queryService, null, null)) {
conn.queryResultSet(query, ResultSetFormatter::out);
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method graph_post_1.
@Test
public void graph_post_1() {
try (RDFConnection conn = connection()) {
conn.load(model1);
Model m = conn.fetch();
assertTrue("Models not isomorphic", isomorphic(m, model1));
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method dataset_put_2.
@Test
public void dataset_put_2() {
try (RDFConnection conn = connection()) {
conn.putDataset(dataset);
conn.putDataset(dataset2);
Dataset ds1 = conn.fetchDataset();
assertTrue("Datasets not isomorphic", isomorphic(dataset2, ds1));
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method named_graph_post_1.
@Test
public void named_graph_post_1() {
try (RDFConnection conn = connection()) {
conn.load(graphName, model1);
Model m = conn.fetch(graphName);
assertTrue("Models not isomorphic", isomorphic(m, model1));
}
}
Aggregations