use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method query_ask_01.
@Test
public void query_ask_01() {
try (RDFConnection conn = connection()) {
Txn.executeRead(conn, () -> {
boolean b = conn.queryAsk("ASK{}");
assertTrue(b);
});
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method dataset_post_1.
@Test
public void dataset_post_1() {
try (RDFConnection conn = connection()) {
conn.loadDataset(dataset);
Dataset ds1 = conn.fetchDataset();
assertTrue("Datasets not isomorphic", isomorphic(dataset, ds1));
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method query_construct_01.
@Test
public void query_construct_01() {
try (RDFConnection conn = connection()) {
Txn.executeWrite(conn, () -> conn.loadDataset(DIR + "data.trig"));
Txn.executeRead(conn, () -> {
Model m = conn.queryConstruct("CONSTRUCT WHERE { ?s ?p ?o }");
assertEquals(2, m.size());
});
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method dataset_load_1.
@Test
public void dataset_load_1() {
String testDataFile = DIR + "data.trig";
try (RDFConnection conn = connection()) {
conn.loadDataset(testDataFile);
Dataset ds0 = RDFDataMgr.loadDataset(testDataFile);
Dataset ds = conn.fetchDataset();
assertTrue("Datasets not isomorphic", isomorphic(ds0, ds));
}
}
use of org.apache.jena.rdfconnection.RDFConnection in project jena by apache.
the class AbstractTestRDFConnection method graph_load_1.
// Default graph
@Test
public void graph_load_1() {
String testDataFile = DIR + "data.ttl";
Model m0 = RDFDataMgr.loadModel(testDataFile);
try (RDFConnection conn = connection()) {
conn.load(testDataFile);
Model m = conn.fetch();
assertTrue("Models not isomorphic", isomorphic(m0, m));
}
}
Aggregations