Commit 84e91efc authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Minor cleanup of FusekiTest.

Signed-off-by: default avatarJay Jay Billings <>
parent 2151c34f
......@@ -13,7 +13,7 @@ package;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.ResultSetFormatter;
import org.apache.jena.query.ReadWrite;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdfconnection.RDFConnectionFuseki;
import org.apache.jena.rdfconnection.RDFConnectionRemoteBuilder;
......@@ -30,19 +30,38 @@ public class FusekiTest {
public static void main(String args[]) {
// Create a connection builder for connecting to the Fuseki triple store.
String fusekiConnURI = "http://localhost:3030/dataset.html#query";
RDFConnectionRemoteBuilder connBuilder = RDFConnectionFuseki.create()
Query query = QueryFactory.create("SELECT * { BIND('Hello'as ?text) }");
// Create connection builders for connecting to the Fuseki triple store
String fusekiURI = "http://localhost:3030/bats-dataset";
String fusekiUploadURI = fusekiURI + "/data";
String fusekiGetURI = fusekiURI + "/get";
RDFConnectionRemoteBuilder uploadConnBuilder = RDFConnectionFuseki.create()
RDFConnectionRemoteBuilder getConnBuilder = RDFConnectionFuseki.create()
// In this variation, a connection is built each time.
try (RDFConnectionFuseki conn = (RDFConnectionFuseki) {
// Open a connection to upload the ICE ontology.
try (RDFConnectionFuseki uploadConn = (RDFConnectionFuseki) {
// Grab the file with the Jena FileManager.
Model model = FileManager.get().loadModel("data/ice-owl.ttl", null, "TURTLE");
// conn.queryResultSet(query, ResultSetFormatter::out);
// Note that transactions must proceed with begin(), some operation(), and
// commit().
} catch (Exception e) {
System.err.println("Unable to upload ICE ontology.");
// Pull down the full model and write it to System out. This should, in
// principle, only pull back the ICE model it uploaded. However, it is pulling
// back the entire 836 triple default RDF graph, because I am calling
// fetch(null).
try (RDFConnectionFuseki getConn = (RDFConnectionFuseki) {
Model model = getConn.fetch(null);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment