Package org.openjena.riot.system

Examples of org.openjena.riot.system.JenaReaderTurtle2


   
    @Override
    public void runTest()
    {
        Model model = ModelFactory.createDefaultModel() ;
        RDFReader t = new JenaReaderTurtle2() ;
        try {
            t.read(model, uri) ;
        } catch (RiotParseException ex)
        {
            throw ex ;   
        }
    }
View Full Code Here


   
    @Override
    public void runTest()
    {
        Model model = ModelFactory.createDefaultModel() ;
        RDFReader t = new JenaReaderTurtle2() ;
        try {
            if ( baseIRI != null )
            {
                InputStream in =  FileManager.get().open(input) ;
                Reader r = PeekReader.makeUTF8(in) ;
                t.read(model, r, 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);
View Full Code Here

   
    @Override
    public void runTest()
    {
        Model model = ModelFactory.createDefaultModel() ;
        RDFReader t = new JenaReaderTurtle2() ;
        try {
            t.read(model, uri) ;
        } catch (RiotParseException ex)
        {
            throw ex ;   
        }
    }
View Full Code Here

    {
        String s = "_:a <http://example/p> 'foo' . " ;
        StringReader r = new StringReader(s) ;
        Model m = ModelFactory.createDefaultModel() ;
       
        RDFReader reader = new JenaReaderTurtle2() ;
        readProtected(reader,m, r, null) ;
        assertEquals(1, m.size()) ;
       
        String x = m.listStatements().next().getSubject().getId().getLabelString() ;
        assertNotEquals(x, "a") ;

        // reset - reread - new bNode.
        r = new StringReader(s) ;
        reader.read(m, r, null) ;
        assertEquals(2, m.size()) ;
    }
View Full Code Here

    {
        // Duplicate.
        String s = "_:a <http://example/p> 'foo' . _:a <http://example/p> 'foo' ." ;
        StringReader r = new StringReader(s) ;
        Model m = ModelFactory.createDefaultModel() ;
        RDFReader reader = new JenaReaderTurtle2() ;
        readProtected(reader,m, r, null) ;
        assertEquals(1, m.size()) ;
    }
View Full Code Here

    }

   
    @Test public void updatePrefixMapping()
    {
        JenaReaderTurtle2 parser = new JenaReaderTurtle2() ;
        Model model = ModelFactory.createDefaultModel() ;
        Reader reader = new StringReader("@prefix x: <http://example/x>.") ;
        parser.read(model, reader, "http://example/base/") ;
        assertEquals(1, model.getNsPrefixMap().size()) ;
        assertEquals("http://example/x", model.getNsPrefixURI("x")) ;
    }
View Full Code Here

TOP

Related Classes of org.openjena.riot.system.JenaReaderTurtle2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.