public static void write(Graph graph) { write(IndentedWriter.stdout, graph) ; IndentedWriter.stdout.flush() ; } public static void write(OutputStream out, Graph graph)
public static void write(Model model) { write(IndentedWriter.stdout, model) ; IndentedWriter.stdout.flush() ; } public static void write(OutputStream out, Model model)
public static void write(OutputStream out, Dataset dataset) { write(out, dataset.asDatasetGraph()) ; } public static void write(IndentedWriter out, Dataset dataset) { write(out, dataset.asDatasetGraph()) ; }
public static void write(IndentedWriter out, BasicPattern pattern) { write(IndentedWriter.stdout, pattern, null) ; IndentedWriter.stdout.flush() ; }
public static void write(Dataset dataset) { write(dataset.asDatasetGraph()) ; } public static void write(OutputStream out, Dataset dataset) { write(out, dataset.asDatasetGraph()) ; }
public static void write(IndentedWriter out, Dataset dataset) { write(out, dataset.asDatasetGraph()) ; }
public static void write(BasicPattern pattern) { write(IndentedWriter.stdout, pattern) ; IndentedWriter.stdout.flush() ; }
public static void write(OutputStream out, Node node) { IndentedWriter iOut = new IndentedWriter(out) ; write(iOut, node) ; iOut.flush(); } public static void write(IndentedWriter out, Node node)
public static void write(OutputStream out, DatasetGraph dataset) { IndentedWriter iOut = new IndentedWriter(out) ; write(iOut, dataset) ; iOut.flush(); }
public static void write(OutputStream out, Triple triple) { IndentedWriter iOut = new IndentedWriter(out) ; write(iOut, triple) ; iOut.flush(); } public static void write(IndentedWriter out, Triple triple)
public static void write(OutputStream out, Quad quad) { IndentedWriter iOut = new IndentedWriter(out) ; write(iOut, quad) ; iOut.flush(); } public static void write(IndentedWriter out, Quad quad)
public static void write(OutputStream out, Graph graph) { IndentedWriter iOut = new IndentedWriter(out) ; write(iOut, graph) ; iOut.flush(); }
public static void write(OutputStream out, Model model) { IndentedWriter iOut = new IndentedWriter(out) ; write(iOut, model) ; iOut.flush(); }
private void testDSG$(String s1, String s2, boolean iso) { s1 = "(dataset "+s1+")" ; s2 = "(dataset "+s2+")" ; DatasetGraph dsg1 = SSE.parseDatasetGraph(s1) ; DatasetGraph dsg2 = SSE.parseDatasetGraph(s2) ; boolean b = IsoMatcher.isomorphic(dsg1, dsg2) ; if ( b != iso ) { System.out.println("====") ; SSE.write(dsg1) ; System.out.println("----") ; SSE.write(dsg2) ; System.out.println("Expected: "+iso+" ; got: "+b) ; } assertEquals(iso, b) ; }
private void testGraph$(String s1, String s2, boolean iso) { s1 = "(graph "+s1+")" ; s2 = "(graph "+s2+")" ; Graph g1 = SSE.parseGraph(s1) ; Graph g2 = SSE.parseGraph(s2) ; boolean b = IsoMatcher.isomorphic(g1, g2) ; if ( b != iso ) { System.out.println("====") ; SSE.write(g1) ; System.out.println("----") ; SSE.write(g2) ; System.out.println("Expected: "+iso+" ; got: "+b) ; } assertEquals(iso, b) ; // Check with the other code. assertEquals(b, g1.isIsomorphicWith(g2)) ; }
SSE.write(graphStore) ; out.flush();
@Test public void special3() { JenaSystem.init(); Dataset ds = dataset() ; load1(ds.getDefaultModel()) ; load2(ds.getNamedModel("http://example/graph1")) ; load3(ds.getNamedModel("http://example/graph2")) ; Model m = ModelFactory.createDefaultModel() ; load2(m) ; load3(m) ; String qs = "CONSTRUCT {?s ?p ?o } WHERE { ?s ?p ?o }" ; Query q = QueryFactory.create(qs) ; QueryExecution qExec = QueryExecutionFactory.create(q, ds) ; qExec.getContext().set(TDB2.symUnionDefaultGraph, true) ; Model m2 = qExec.execConstruct() ; if ( ! m.isIsomorphicWith(m2) ) { System.out.println("---- ----") ; SSE.write(ds.asDatasetGraph()) ; System.out.println("-- Expected") ; m.write(System.out, "TTL") ; System.out.println("-- Actual") ; m2.write(System.out, "TTL") ; System.out.println("---- ----") ; } assertTrue(m.isIsomorphicWith(m2)) ; }
@Test public void special3() { Dataset ds = create() ; load1(ds.getDefaultModel()) ; load2(ds.getNamedModel("http://example/graph1")) ; load3(ds.getNamedModel("http://example/graph2")) ; Model m = ModelFactory.createDefaultModel() ; load2(m) ; load3(m) ; String qs = "CONSTRUCT {?s ?p ?o } WHERE { ?s ?p ?o }" ; Query q = QueryFactory.create(qs) ; QueryExecution qExec = QueryExecutionFactory.create(q, ds) ; qExec.getContext().set(TDB.symUnionDefaultGraph, true) ; Model m2 = qExec.execConstruct() ; if ( ! m.isIsomorphicWith(m2) ) { System.out.println("---- ----") ; SSE.write(ds.asDatasetGraph()) ; System.out.println("-- Expected") ; m.write(System.out, "TTL") ; System.out.println("-- Actual") ; m2.write(System.out, "TTL") ; System.out.println("---- ----") ; } assertTrue(m.isIsomorphicWith(m2)) ; }
@Test public void special3() { Dataset ds = create() ; load1(ds.getDefaultModel()) ; load2(ds.getNamedModel("http://example/graph1")) ; load3(ds.getNamedModel("http://example/graph2")) ; Model m = ModelFactory.createDefaultModel() ; load2(m) ; load3(m) ; String qs = "CONSTRUCT {?s ?p ?o } WHERE { ?s ?p ?o }" ; Query q = QueryFactory.create(qs) ; QueryExecution qExec = QueryExecutionFactory.create(q, ds) ; qExec.getContext().set(TDB.symUnionDefaultGraph, true) ; Model m2 = qExec.execConstruct() ; if ( ! m.isIsomorphicWith(m2) ) { System.out.println("---- ----") ; SSE.write(ds.asDatasetGraph()) ; System.out.println("-- Expected") ; m.write(System.out, "TTL") ; System.out.println("-- Actual") ; m2.write(System.out, "TTL") ; System.out.println("---- ----") ; } assertTrue(m.isIsomorphicWith(m2)) ; }