Search in sources :

Example 1 with ReaderRIOT

use of org.apache.jena.riot.ReaderRIOT 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");
        }
    }
}
Also used : ReaderRIOT(org.apache.jena.riot.ReaderRIOT) InputStream(java.io.InputStream) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Aggregations

InputStream (java.io.InputStream)1 BaseTest (org.apache.jena.atlas.junit.BaseTest)1 ReaderRIOT (org.apache.jena.riot.ReaderRIOT)1 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)1 Test (org.junit.Test)1