-
Notifications
You must be signed in to change notification settings - Fork 173
Blueprints_API_remote_mode
Brad Bebee edited this page Feb 13, 2020
·
1 revision
A sample Java application demonstrates using Blazegraph™ in remote mode with Blueprints. See Using Blueprints with Blazegraph tutorial for more details. This project was created in Eclipse IDE with Maven. You need to have a NanoSparqlServer running (see Quick Start instructions). Endpoint http://localhost:9999/bigdata/ is used for remote repository connection in the application.
You can download the sample-blueprints-remote application here.
package sample.blueprints.remote;
import org.apache.log4j.Logger;
import com.bigdata.blueprints.BigdataGraph;
import com.bigdata.blueprints.BigdataGraphClient;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
public class SampleBlazegraphBlueprintsRemote {
protected static final Logger log = Logger.getLogger(SampleBlazegraphBlueprintsRemote.class);
public static void main(String[] args) throws Exception {
final BigdataGraph graph = new BigdataGraphClient("http://localhost:9999/bigdata");
try {
graph.loadGraphML(SampleBlazegraphBlueprintsRemote.class.getResource("/graph-example-1.xml").getFile());
for (Vertex v : graph.getVertices()) {
log.info(v);
}
for (Edge e : graph.getEdges()) {
log.info(e);
}
} finally {
graph.shutdown();
}
}
}
final BigdataGraph graph = new BigdataGraphClient("http://localhost:9999/bigdata");
graph.loadGraphML(SampleBlazegraphBlueprintsRemote.class.getResource("/graph-example-1.xml").getFile());
for (Vertex v : graph.getVertices()) {
log.info(v);
}
for (Edge e : graph.getEdges()) {
log.info(e);
}
New service class org.openrdf.query.resultio.sparqljson.SPARQLResultsJSONWriterFactory replaces existing service class com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactory
New service class org.openrdf.query.resultio.sparqljson.SPARQLResultsJSONParserFactory replaces existing service class com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONParserFactory
v[1]
v[2]
v[3]
v[4]
v[5]
v[6]
e[7][1->2]
e[8][1->4]
e[9][1->3]
e[10][4->5]
e[11][4->3]
e[12][6->3]