use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestTriXReader method trix_direct.
@Test
public void trix_direct() {
ReaderRIOT r = new ReaderTriX(RiotLib.dftProfile(), ErrorHandlerFactory.errorHandlerNoWarnings);
InputStream in = IO.openFile(fInput);
DatasetGraph dsg = DatasetGraphFactory.create();
//StreamRDF stream = StreamRDFLib.writer(System.out) ;
StreamRDF stream = StreamRDFLib.dataset(dsg);
stream.start();
r.read(in, null, null, stream, null);
stream.finish();
if (fExpected != null) {
DatasetGraph dsg2 = RDFDataMgr.loadDatasetGraph(fExpected);
boolean b = IsoMatcher.isomorphic(dsg, dsg2);
if (!b) {
Assert.fail("Not isomorphic");
}
}
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestLangTrig method trig_11.
@Test
public void trig_11() {
DatasetGraph dsg = parse("@prefix ex: <http://example/> .", "{ ex:s ex:p 123 }");
assertEquals(1, dsg.getDefaultGraph().size());
Triple t = dsg.getDefaultGraph().find(null, null, null).next();
Triple t2 = SSE.parseTriple("(<http://example/s> <http://example/p> 123)");
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestLangTrig method trig_10.
// Need to check we get resolved URIs.
//{ parse("{ <x> <p> <q> }") ; }
@Test
public //{ parse("{ <x> <p> <q> }") ; }
void trig_10() {
DatasetGraph dsg = parse("{ <x> <p> <q> }");
assertEquals(1, dsg.getDefaultGraph().size());
Triple t = dsg.getDefaultGraph().find(null, null, null).next();
Triple t2 = SSE.parseTriple("(<http://base/x> <http://base/p> <http://base/q>)");
assertEquals(t2, t);
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractTestUpdateGraph method testUpdateScript6.
@Test
public void testUpdateScript6() {
DatasetGraph gStore = getEmptyDatasetGraph();
script(gStore, "data-3.ru");
assertTrue(graphContains(gStore.getGraph(graphIRI), new Triple(s, p, NodeFactoryExtra.parseNode("123"))));
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractTestUpdateGraphMgt method testCreateDrop2.
@Test
public void testCreateDrop2() {
DatasetGraph gStore = getEmptyDatasetGraph();
Update u = new UpdateCreate(graphIRI);
UpdateAction.execute(u, gStore);
u = new UpdateCreate(graphIRI, true);
UpdateAction.execute(u, gStore);
// JENA-1068
// assertTrue(gStore.containsGraph(graphIRI)) ;
assertTrue(graphEmpty(gStore.getGraph(graphIRI)));
u = new UpdateDrop(graphIRI);
UpdateAction.execute(u, gStore);
assertFalse(gStore.containsGraph(graphIRI));
u = new UpdateDrop(graphIRI, true);
UpdateAction.execute(u, gStore);
}
Aggregations