Package org.openjena.riot.ErrorHandlerTestLib

Examples of org.openjena.riot.ErrorHandlerTestLib.ErrorHandlerEx


    private long parseCount(String string)
    {
        Tokenizer tokenizer = tokenizer(string) ;
        SinkCounting<Triple> sink = new SinkCounting<Triple>() ;
        LangRDFJSON x = RiotReader.createParserRdfJson(tokenizer, sink) ;
        x.getProfile().setHandler(new ErrorHandlerEx()) ;
        x.parse() ;
        return sink.getCount() ;
    }
View Full Code Here


    private static void parse(Sink<Quad> sink, String... strings )
    {
        String string = StrUtils.strjoin("\n", strings) ;
        Tokenizer tokenizer = tokenizer(string) ;
        LangRIOT parser = RiotReader.createParserNQuads(tokenizer, sink) ;
        parser.getProfile().setHandler(new ErrorHandlerEx()) ;
        parser.parse() ;
        sink.flush();
    }
View Full Code Here

    {
        String string = StrUtils.strjoin("\n", strings) ;
        Tokenizer tokenizer = tokenizer(string) ;
        Sink<Quad> sink = new SinkNull<Quad>() ;
        LangRIOT parser = RiotReader.createParserNQuads(tokenizer, sink) ;
        parser.setProfile(RiotLib.profile(null, false, true, new ErrorHandlerEx())) ;
        parser.parse() ;
    }
View Full Code Here

    private long parseCount(String string)
    {
        Tokenizer tokenizer = tokenizer(string) ;
        SinkCounting<Triple> sink = new SinkCounting<Triple>() ;
        LangRDFJSON x = RiotReader.createParserRdfJson(tokenizer, sink) ;
        x.getProfile().setHandler(new ErrorHandlerEx()) ;
        x.parse() ;
        return sink.getCount() ;
    }
View Full Code Here

        String string = StrUtils.strjoin("\n", strings) ;
        DatasetGraph dsg = DatasetLib.createDatasetGraphMem() ;
        Sink<Quad> sink = RiotLoader.datasetSink(dsg) ;
        Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(string) ;
        LangTriG parser = RiotReader.createParserTriG(tokenizer, "http://base/", sink) ;
        parser.getProfile().setHandler(new ErrorHandlerEx()) ;
        try {
            parser.parse();
        } finally { sink.close() ; }
        return dsg ;
    }
View Full Code Here

    {
        String string = StrUtils.strjoin("\n", strings) ;
        Tokenizer tokenizer = tokenizer(string) ;
        SinkCounting<Triple> sink = new SinkCounting<Triple>() ;
        LangNTriples x = RiotReader.createParserNTriples(tokenizer, sink) ;
        x.getProfile().setHandler(new ErrorHandlerEx()) ;
        x.parse() ;
        return sink.getCount() ;
    }
View Full Code Here

    {
        String string = StrUtils.strjoin("\n", strings) ;
        Tokenizer tokenizer = tokenizer(string) ;
        SinkCounting<Triple> sink = new SinkCounting<Triple>() ;
        LangNTriples x = RiotReader.createParserNTriples(tokenizer, sink) ;
        x.setProfile(RiotLib.profile(null, false, true, new ErrorHandlerEx())) ;
        x.parse() ;
    }
View Full Code Here

       
        Graph graph = GraphFactory.createDefaultGraph() ;
        Sink<Triple> sink = RiotLoader.graphSink(graph) ;
       
        LangTurtle parser = RiotReader.createParserTurtle(tokenizer, "http://base/", sink) ;
        parser.getProfile().setHandler(new ErrorHandlerEx()) ;
        try {
            parser.parse() ;
        } finally { sink.close() ; }
        return graph ;
    }
View Full Code Here

TOP

Related Classes of org.openjena.riot.ErrorHandlerTestLib.ErrorHandlerEx

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.