Search in sources :

Example 1 with ErrorHandlerEx

use of org.apache.jena.riot.ErrorHandlerTestLib.ErrorHandlerEx in project jena by apache.

the class TestLangNTuples method parseCount.

protected final long parseCount(CharSpace charSpace, String... strings) {
    String string = String.join("\n", strings);
    Tokenizer tokenizer = tokenizer(charSpace, string);
    StreamRDFCounting sink = StreamRDFLib.count();
    LangRIOT x = RiotParsers.createParserNTriples(tokenizer, sink, parserProfile(new ErrorHandlerEx()));
    x.parse();
    return sink.count();
}
Also used : ErrorHandlerEx(org.apache.jena.riot.ErrorHandlerTestLib.ErrorHandlerEx) Tokenizer(org.apache.jena.riot.tokens.Tokenizer)

Example 2 with ErrorHandlerEx

use of org.apache.jena.riot.ErrorHandlerTestLib.ErrorHandlerEx in project jena by apache.

the class TestLangNTuples method parseCheck.

protected final void parseCheck(String... strings) {
    String string = String.join("\n", strings);
    Tokenizer tokenizer = tokenizer(string);
    StreamRDFCounting sink = StreamRDFLib.count();
    LangRIOT x = RiotParsers.createParserNQuads(tokenizer, sink, parserProfile(new ErrorHandlerEx()));
    x.parse();
}
Also used : ErrorHandlerEx(org.apache.jena.riot.ErrorHandlerTestLib.ErrorHandlerEx) Tokenizer(org.apache.jena.riot.tokens.Tokenizer)

Example 3 with ErrorHandlerEx

use of org.apache.jena.riot.ErrorHandlerTestLib.ErrorHandlerEx in project jena by apache.

the class ParserTestBaseLib method parse.

/** Parse strings to destination (checking on, URI resolution off) - convert errors and warning to ErrorHandlerEx */
static void parse(Lang lang, StreamRDF dest, String... strings) {
    String string = String.join("\n", strings);
    String baseIRI = "http://base/";
    RDFParser.create().fromString(string).base(baseIRI).errorHandler(new ErrorHandlerEx()).lang(lang).parse(dest);
}
Also used : ErrorHandlerEx(org.apache.jena.riot.ErrorHandlerTestLib.ErrorHandlerEx)

Aggregations

ErrorHandlerEx (org.apache.jena.riot.ErrorHandlerTestLib.ErrorHandlerEx)3 Tokenizer (org.apache.jena.riot.tokens.Tokenizer)2