Package org.apache.jena.riot.lang

Examples of org.apache.jena.riot.lang.LangRIOT


    // Check for all RiotReader
    public static void parse(HttpAction action, StreamRDF dest, InputStream input, Lang lang, String base) {
        // Need to adjust the error handler.
//        try { RDFDataMgr.parse(dest, input, base, lang) ; }
//        catch (RiotException ex) { errorBadRequest("Parse error: "+ex.getMessage()) ; }
        LangRIOT parser = RiotReader.createParser(input, lang, base, dest) ;
        parser.getProfile().setHandler(errorHandler) ;
        try { parser.parse() ; }
        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) ;
            LangRIOT parser = RiotReader.createParser(action.request.getInputStream(), lang, name , dest) ;
            parser.parse() ;
            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) ;
            LangRIOT parser = RiotReader.createParser(action.request.getInputStream(), lang, name , dest) ;
            parser.parse() ;
            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) ;
            LangRIOT parser = RiotReader.createParser(action.request.getInputStream(), lang, name , dest) ;
            parser.parse() ;
            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

        public ReaderRIOT create(final Lang lang)
        {
            return new ReaderRIOT() {
                @Override
                public void read(InputStream in, String baseURI, ContentType ct, StreamRDF output, Context context) {
                    LangRIOT parser = RiotReader.createParser(in, lang, baseURI, output) ;
                    parser.parse() ;
                }
                @Override
                public void read(Reader in, String baseURI, ContentType ct, StreamRDF output, Context context) {
                    LangRIOT parser = RiotReader.createParser(in, lang, baseURI, output) ;
                    parser.parse() ;
                }
            } ;
        }
View Full Code Here

TOP

Related Classes of org.apache.jena.riot.lang.LangRIOT

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.