/** * Returns a new instance of {@link NTriplesWriter}. */ public RDFWriter getWriter(Writer writer) { return new NTriplesWriter(writer); }
/** * Reads characters from reader until the first EOL has been read. The EOL character or -1 is returned. */ protected int skipToEndOfLine(int c) throws IOException { while (c != -1 && c != '\r' && c != '\n') { c = readCodePoint(); } return c; }
/** * Overrides {@link AbstractRDFParser#reportFatalError(String)}, adding line number information to the * error. */ @Override protected void reportFatalError(String msg) throws RDFParseException { reportFatalError(msg, lineNo, -1); }
/** * Checks whether the supplied character is valid character as per N-Triples specification. * See <a href="https://www.w3.org/TR/n-triples/#BNodes">https://www.w3.org/TR/n-triples/#BNodes</a>. * */ public static boolean isValidCharacterForBNodeLabel(int c) { return isLetterOrNumber(c) || isLiberalCharactersButNotDot(c) || isDot(c); }
/** * Returns a new instance of NTriplesParser. */ public RDFParser getParser() { return new NTriplesParser(); } }
/** * Overrides {@link AbstractRDFParser#reportError(String, RioSetting)}, adding line number information to * the error. */ @Override protected void reportError(String msg, RioSetting<Boolean> setting) throws RDFParseException { reportError(msg, lineNo, -1, setting); }
/** * Overrides {@link AbstractRDFParser#reportWarning(String)}, adding line number information to the error. */ @Override protected void reportWarning(String msg) { reportWarning(msg, lineNo, -1); }
/** * Checks whether the supplied character is in list of liberal characters according to the N-Triples specification except Dot. */ public static boolean isLiberalCharactersButNotDot(int c) { return isUnderscore(c) || c == 45 || c == 183 || (c >= 768 && c <= 879) || c == 8255 || c == 8256; }
@Override public RDFWriter getWriter(Writer writer, String baseURI) { return getWriter(writer); } }
private void writeIRI(IRI iri) throws IOException { NTriplesUtil.append(iri, writer); }
/** * Returns a new instance of {@link NTriplesWriter}. */ @Override public RDFWriter getWriter(OutputStream out) { return new NTriplesWriter(out); }
protected void reportError(Exception e, RioSetting<Boolean> setting) throws RDFParseException { reportError(e, lineNo, -1, setting); }
/** * Reads characters from reader until it finds a character that is not a space or tab, and returns this * last character code point. In case the end of the character stream has been reached, -1 is returned. */ protected int skipWhitespace(int c) throws IOException { while (c == ' ' || c == '\t') { c = readCodePoint(); } return c; }
/** * Overrides {@link AbstractRDFParser#reportFatalError(Exception)}, adding line number information to the * error. */ @Override protected void reportFatalError(Exception e) throws RDFParseException { reportFatalError(e, lineNo, -1); }
/** * Overrides {@link AbstractRDFParser#reportWarning(String)}, adding line number information to the error. */ @Override protected void reportWarning(String msg) { reportWarning(msg, lineNo, -1); }
/** * Returns a new instance of {@link NTriplesWriter}. */ @Override public RDFWriter getWriter(Writer writer) { return new NTriplesWriter(writer); }
/** * Overrides {@link AbstractRDFParser#reportError(String, RioSetting)}, adding line number information to * the error. */ @Override protected void reportError(String msg, RioSetting<Boolean> setting) throws RDFParseException { reportError(msg, lineNo, -1, setting); }
/** * Reads characters from reader until it finds a character that is not a space or tab, and returns this * last character code point. In case the end of the character stream has been reached, -1 is returned. */ protected int skipWhitespace(int c) throws IOException { while (c == ' ' || c == '\t') { c = readCodePoint(); } return c; }
@Override protected void reportError(Exception e, RioSetting<Boolean> setting) throws RDFParseException { reportError(e, lineNo, -1, setting); }