/** * Returns a new instance of NQuadsParser. */ public RDFParser getParser() { return new NQuadsParser(); } }
protected int parseContext(int c) throws IOException, RDFParseException { StringBuilder sb = new StringBuilder(100); // subject is either an uriref (<foo://bar>) or a nodeID (_:node1) if (c == '<') { // subject is an uriref c = parseUriRef(c, sb); context = createURI(sb.toString()); } else if (c == '_') { // subject is a bNode c = parseNodeID(c, sb); context = createNode(sb.toString()); } else if (c == -1) { throwEOFException(); } else { reportFatalError("Expected '<' or '_', found: " + new String(Character.toChars(c))); } return c; }
c = parseSubject(c); c = skipWhitespace(c); c = parsePredicate(c); c = skipWhitespace(c); c = parseObject(c); c = skipWhitespace(c); c = parseContext(c); c = skipWhitespace(c); throwEOFException(); reportFatalError("Expected '.', found: " + new String(Character.toChars(c))); c = assertLineTerminates(c); if (getParserConfig().isNonFatalError(NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES)) { reportError(rdfpe, NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES); ignoredAnError = true; c = skipLine(c); Statement st = createStatement(subject, predicate, object, context); if (rdfHandler != null) {
throws IOException, RDFParseException, RDFHandlerException clear(); lineNo = 1; reportLocation(lineNo, 1); int c = readCodePoint(); c = skipWhitespace(c); c = skipLine(c); c = skipLine(c); c = parseQuad(c); c = skipWhitespace(c); clear();
@Override public synchronized void parse(final InputStream inputStream, final String baseURI) throws IOException, RDFParseException, RDFHandlerException { if (inputStream == null) { throw new IllegalArgumentException("Input stream can not be 'null'"); } // Note: baseURI will be checked in parse(Reader, String) try { parse(new InputStreamReader(new BOMInputStream(inputStream, false), StandardCharsets.UTF_8), baseURI); } catch (UnsupportedEncodingException e) { // Every platform should support the UTF-8 encoding... throw new RuntimeException(e); } }
c = parseSubject(c); c = skipWhitespace(c); c = parsePredicate(c); c = skipWhitespace(c); c = parseObject(c); c = skipWhitespace(c); c = parseContext(c); c = skipWhitespace(c); throwEOFException(); reportFatalError("Expected '.', found: " + new String(Character.toChars(c))); c = assertLineTerminates(c); if (getParserConfig().isNonFatalError(NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES)) { reportError(rdfpe, NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES); ignoredAnError = true; c = skipLine(c); Statement st = createStatement(subject, predicate, object, context); if (rdfHandler != null) {
throws IOException, RDFParseException, RDFHandlerException clear(); lineNo = 1; reportLocation(lineNo, 1); int c = readCodePoint(); c = skipWhitespace(c); c = skipLine(c); c = skipLine(c); c = parseQuad(c); c = skipWhitespace(c); clear();
@Override public synchronized void parse(final InputStream inputStream, final String baseURI) throws IOException, RDFParseException, RDFHandlerException { if (inputStream == null) { throw new IllegalArgumentException("Input stream can not be 'null'"); } // Note: baseURI will be checked in parse(Reader, String) try { parse(new InputStreamReader(new BOMInputStream(inputStream, false), StandardCharsets.UTF_8), baseURI); } catch (UnsupportedEncodingException e) { // Every platform should support the UTF-8 encoding... throw new RuntimeException(e); } }
protected int parseContext(int c) throws IOException, RDFParseException { StringBuilder sb = new StringBuilder(100); // subject is either an uriref (<foo://bar>) or a nodeID (_:node1) if (c == '<') { // subject is an uriref c = parseUriRef(c, sb); context = createURI(sb.toString()); } else if (c == '_') { // subject is a bNode c = parseNodeID(c, sb); context = createNode(sb.toString()); } else if (c == -1) { throwEOFException(); } else { reportFatalError("Expected '<' or '_', found: " + new String(Character.toChars(c))); } return c; }
/** * Returns a new instance of NQuadsParser. */ @Override public RDFParser getParser() { return new NQuadsParser(); } }