Graph API

Node n = graph.getResource("http://example.org/James");
Node p = graph.getResource("http://xmlns.com/foaf/0.1/name");

// one edge where n is node 0
Entity ent = graph.getEdge(p, n, 0);

// all edges where n is node 0
for (Entity ent : graph.getEdges(p, n, 0)){
   
}
Node g = graph.addGraph("http://example.org/test");
Node s = graph.addBlank("_:b");
Node p = graph.addProperty("http://example.org/age");
Node o = graph.addLiteral(24);
Node q = graph.addProperty("http://example.org/knows");
Node r = graph.addResource("http://example.org/Jack");

Edge e1 = graph.addEdge(g, s, p, o);
Edge e2 = graph.addEdge(s, q, r);