@Override protected IRI createURI(String uri) throws RDFParseException { try { uri = NTriplesUtil.unescapeString(uri); } catch (IllegalArgumentException e) { reportError(e.getMessage(), NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES); } return super.createURI(uri); }
/** * Parses an N-Triples URI, creates an object for it using the supplied ValueFactory and returns this * object. * * @param nTriplesURI * The N-Triples URI to parse. * @param valueFactory * The ValueFactory to use for creating the object. * @return An object representing the parsed URI. * @throws IllegalArgumentException * If the supplied URI could not be parsed correctly. */ public static IRI parseURI(String nTriplesURI, ValueFactory valueFactory) throws IllegalArgumentException { if (nTriplesURI.startsWith("<") && nTriplesURI.endsWith(">")) { String uri = nTriplesURI.substring(1, nTriplesURI.length() - 1); uri = unescapeString(uri); return valueFactory.createIRI(uri); } else { throw new IllegalArgumentException("Not a legal N-Triples URI: " + nTriplesURI); } }
@Override protected IRI createURI(String uri) throws RDFParseException { try { uri = NTriplesUtil.unescapeString(uri); } catch (IllegalArgumentException e) { reportError(e.getMessage(), NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES); } return super.createURI(uri); }
/** * Parses an N-Triples URI, creates an object for it using the supplied ValueFactory and returns this * object. * * @param nTriplesURI * The N-Triples URI to parse. * @param valueFactory * The ValueFactory to use for creating the object. * @return An object representing the parsed URI. * @throws IllegalArgumentException * If the supplied URI could not be parsed correctly. */ public static IRI parseURI(String nTriplesURI, ValueFactory valueFactory) throws IllegalArgumentException { if (nTriplesURI.startsWith("<") && nTriplesURI.endsWith(">")) { String uri = nTriplesURI.substring(1, nTriplesURI.length() - 1); uri = unescapeString(uri); return valueFactory.createIRI(uri); } else { throw new IllegalArgumentException("Not a legal N-Triples URI: " + nTriplesURI); } }
protected Literal createLiteral(String label, String lang, String datatype) throws RDFParseException { try { label = NTriplesUtil.unescapeString(label); } catch (IllegalArgumentException e) { throw new RDFParseException(e, lineNo, -1); } if (lang.length() == 0) { lang = null; } if (datatype.length() == 0) { datatype = null; } IRI dtURI = null; if (datatype != null) { dtURI = createURI(datatype); } return super.createLiteral(label, lang, dtURI, lineNo, -1); }
protected Literal createLiteral(String label, String lang, String datatype) throws RDFParseException { try { label = NTriplesUtil.unescapeString(label); } catch (IllegalArgumentException e) { throw new RDFParseException(e, lineNo, -1); } if (lang.length() == 0) { lang = null; } if (datatype.length() == 0) { datatype = null; } IRI dtURI = null; if (datatype != null) { dtURI = createURI(datatype); } return super.createLiteral(label, lang, dtURI, lineNo, -1); }
label = unescapeString(label);
label = unescapeString(label);