throws RDFParseException return createLiteral(label, lang, datatype, parserConfig, errListener, valueFactory, -1, -1);
/** * Creates a {@link Literal} object with the supplied parameters. */ protected Literal createLiteral(String label, String lang, IRI datatype) throws RDFParseException { return RDFParserHelper.createLiteral(label, lang, datatype, getParserConfig(), getParseErrorListener(), valueFactory); }
/** * Creates a {@link Literal} object with the supplied parameters, using the * lineNo and columnNo to enhance error messages or exceptions that may be * generated during the creation of the literal. * * @since 2.7.4 * @see org.openrdf.rio.helpers.RDFParserHelper#createLiteral(String, String, * IRI, ParserConfig, ParseErrorListener, ValueFactory, long, long) */ protected Literal createLiteral(String label, String lang, IRI datatype, long lineNo, long columnNo) throws RDFParseException { return RDFParserHelper.createLiteral(label, lang, datatype, getParserConfig(), getParseErrorListener(), valueFactory, lineNo, columnNo); }
private void triple(String s, String p, String value, String datatype, String language, String graph) { if (s == null || p == null || value == null) { // TODO: i don't know what to do here!!!! return; } final Resource subject = createResource(s); final URI predicate = vf.createURI(p); final URI datatypeURI = datatype == null ? null : vf.createURI(datatype); Value object; try { object = RDFParserHelper.createLiteral(value, language, datatypeURI, getParserConfig(), getParserErrorListener(), getValueFactory()); } catch (final RDFParseException e) { throw new RuntimeException(e); } Statement result; if (graph == null) { result = vf.createStatement(subject, predicate, object); } else { result = vf.createStatement(subject, predicate, object, createResource(graph)); } if (handler != null) { try { handler.handleStatement(result); } catch (final RDFHandlerException e) { throw new RuntimeException(e); } } }