Search in sources :

Example 1 with TurtleReader

use of org.apache.jena.n3.turtle.TurtleReader in project jena by apache.

the class TestTurtle method runTest.

@Override
public void runTest() {
    Model model = ModelFactory.createDefaultModel();
    RDFReader t = new TurtleReader();
    try {
        if (baseIRI != null)
            t.read(model, FileManager.get().open(input), baseIRI);
        else
            t.read(model, input);
        // "http://www.w3.org/2001/sw/DataAccess/df1/tests/rdfq-results.ttl"
        String syntax = FileUtils.guessLang(output, FileUtils.langNTriple);
        Model results = FileManager.get().loadModel(output, syntax);
        boolean b = model.isIsomorphicWith(results);
        if (!b)
            assertTrue("Models not isomorphic", b);
    } catch (TurtleParseException ex) {
        throw ex;
    }
}
Also used : TurtleParseException(org.apache.jena.n3.turtle.TurtleParseException) Model(org.apache.jena.rdf.model.Model) TurtleReader(org.apache.jena.n3.turtle.TurtleReader) RDFReader(org.apache.jena.rdf.model.RDFReader)

Aggregations

TurtleParseException (org.apache.jena.n3.turtle.TurtleParseException)1 TurtleReader (org.apache.jena.n3.turtle.TurtleReader)1 Model (org.apache.jena.rdf.model.Model)1 RDFReader (org.apache.jena.rdf.model.RDFReader)1