Search in sources :

Example 26 with RDFReaderI

use of org.apache.jena.rdf.model.RDFReaderI in project jena by apache.

the class TestReaders method testGetNTripleReader.

/**
 * Test to ensure that the reader is set.
 */
public void testGetNTripleReader() {
    final RDFReaderI reader = model.getReader("N-TRIPLE");
    Assert.assertNotNull(reader);
}
Also used : RDFReaderI(org.apache.jena.rdf.model.RDFReaderI)

Example 27 with RDFReaderI

use of org.apache.jena.rdf.model.RDFReaderI in project jena by apache.

the class TestTurtleReader method test0.

public void test0() {
    RDFReaderI r = ModelFactory.createDefaultModel().getReader("Turtle");
    assertNotNull(r);
}
Also used : RDFReaderI(org.apache.jena.rdf.model.RDFReaderI)

Example 28 with RDFReaderI

use of org.apache.jena.rdf.model.RDFReaderI in project jena by apache.

the class TestTurtle method runTest.

@Override
public void runTest() {
    Model model = ModelFactory.createDefaultModel();
    RDFReaderI t = new TurtleReader();
    try {
        if (baseIRI != null)
            t.read(model, FileManager.getInternal().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);
        @SuppressWarnings("deprecation") Model results = FileManager.getInternal().loadModel(output, syntax);
        boolean b = model.isIsomorphicWith(results);
        if (!b)
            assertTrue("Models not isomorphic", b);
    } catch (TurtleParseException ex) {
        throw ex;
    }
}
Also used : RDFReaderI(org.apache.jena.rdf.model.RDFReaderI) Model(org.apache.jena.rdf.model.Model)

Aggregations

RDFReaderI (org.apache.jena.rdf.model.RDFReaderI)28 Model (org.apache.jena.rdf.model.Model)25 JenaException (org.apache.jena.shared.JenaException)7 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 StringReader (java.io.StringReader)1 IRIFactory (org.apache.jena.iri.IRIFactory)1 RDFWriterI (org.apache.jena.rdf.model.RDFWriterI)1 RecordingModelListener (org.apache.jena.rdf.model.test.helpers.RecordingModelListener)1 RDFEHArray (org.apache.jena.rdfxml.xmlinput.SAX2RDFTest.RDFEHArray)1 BadURIException (org.apache.jena.shared.BadURIException)1 InvalidPropertyURIException (org.apache.jena.shared.InvalidPropertyURIException)1 InputSource (org.xml.sax.InputSource)1 SAXParseException (org.xml.sax.SAXParseException)1 XMLReader (org.xml.sax.XMLReader)1