Package org.apache.jena.riot

Examples of org.apache.jena.riot.ReaderRIOT


            s = InfFactory.inf(s, setup) ;
       
        StreamRDFCounting sink = StreamRDFLib.count(s) ;
        s = null ;
       
        ReaderRIOT reader = RDFDataMgr.createReader(lang) ;
        try {
            if ( checking ) {
                if ( lang == RDFLanguages.NTRIPLES || lang == RDFLanguages.NQUADS )
                    reader.setParserProfile(RiotLib.profile(baseURI, false, true, errHandler)) ;
                else
                    reader.setParserProfile(RiotLib.profile(baseURI, true, true, errHandler)) ;
            } else
                reader.setParserProfile(RiotLib.profile(baseURI, false, false, errHandler)) ;

            if ( labelsAsGiven )
                reader.getParserProfile().setLabelToNode(LabelToNode.createUseLabelAsGiven()) ;
            modTime.startTimer() ;
            reader.read(in, baseURI, ct, sink, null) ;
        } catch (RiotException ex) {
            // Should have handled the exception and logged a message by now.
            // System.err.println("++++"+ex.getMessage());

            if ( modLangParse.stopOnBadTerm() )
View Full Code Here


   
    // @@ Move to SPARQL_ServletBase
    // Check for all RiotReader
    public static void parse(HttpAction action, StreamRDF dest, InputStream input, Lang lang, String base) {
        try {
            ReaderRIOT r = RDFDataMgr.createReader(lang) ;
            if ( r == null )
                errorBadRequest("No parser for language '"+lang.getName()+"'") ;
            r.setErrorHandler(errorHandler);
            r.read(input, base, null, dest, null) ;
        }
        catch (RiotException ex) { errorBadRequest("Parse error: "+ex.getMessage()) ; }
    }
View Full Code Here

        action.beginWrite() ;
        try {
            String name = action.request.getRequestURL().toString() ;
            DatasetGraph dsg = action.getActiveDSG() ;
            StreamRDF dest = StreamRDFLib.dataset(dsg) ;
            ReaderRIOT reader = RDFDataMgr.createReader(lang) ;
            reader.read(action.request.getInputStream(), name, null, dest, null);
            action.commit();
            success(action) ;
        } catch (IOException ex) { action.abort() ; }
        finally { action.endWrite() ; }
    }
View Full Code Here

            // This should not be anythign other than the datasets name via this route. 
            String name = action.request.getRequestURL().toString() ;
            //log.info(format("[%d] ** Content-length: %d", action.id, action.request.getContentLength())) ; 
            Graph g = dsg.getDefaultGraph() ;
            StreamRDF dest = StreamRDFLib.graph(g) ;
            ReaderRIOT reader = RDFDataMgr.createReader(lang) ;
            reader.read(action.request.getInputStream(), name, null, dest, null);
            action.commit();
            success(action) ;
        } catch (IOException ex) { action.abort() ; }
        finally { action.endWrite() ; }
    }
View Full Code Here

                name = name+ "/"  ;
            name = name+(++counter) ;
            Node gn = NodeFactory.createURI(name) ;
            Graph g = dsg.getGraph(gn) ;
            StreamRDF dest = StreamRDFLib.graph(g) ;
            ReaderRIOT reader = RDFDataMgr.createReader(lang) ;
            reader.read(action.request.getInputStream(), name, null, dest, null);
            log.info(format("[%d] Location: %s", action.id, name)) ;
            action.response.setHeader("Location",  name) ;
            action.commit();
            successCreated(action) ;
        } catch (IOException ex) { action.abort() ; }
View Full Code Here

TOP

Related Classes of org.apache.jena.riot.ReaderRIOT

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.