protected int parsePredicate(int c) throws IOException, RDFParseException { StringBuilder sb = new StringBuilder(100); // predicate must be an uriref (<foo://bar>) if (c == '<') { // predicate is an uriref c = parseUriRef(c, sb); predicate = createURI(sb.toString()); } else if (c == -1) { throwEOFException(); } else { throw new RDFParseException("Expected '<', found: " + new String(Character.toChars(c)), lineNo, c); } return c; }
protected int parsePredicate(int c) throws IOException, RDFParseException { StringBuilder sb = new StringBuilder(100); // predicate must be an uriref (<foo://bar>) if (c == '<') { // predicate is an uriref c = parseUriRef(c, sb); predicate = createURI(sb.toString()); } else if (c == -1) { throwEOFException(); } else { throw new RDFParseException("Expected '<', found: " + new String(Character.toChars(c)), lineNo, c); } return c; }
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 int parseSubject(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); subject = createURI(sb.toString()); } else if (c == '_') { // subject is a bNode c = parseNodeID(c, sb); subject = createNode(sb.toString()); } else if (c == -1) { throwEOFException(); } else { throw new RDFParseException("Expected '<' or '_', found: " + new String(Character.toChars(c)), lineNo, c); } return c; }
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 int parseSubject(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); subject = createURI(sb.toString()); } else if (c == '_') { // subject is a bNode c = parseNodeID(c, sb); subject = createNode(sb.toString()); } else if (c == -1) { throwEOFException(); } else { throw new RDFParseException("Expected '<' or '_', found: " + new String(Character.toChars(c)), lineNo, c); } return c; }
object = createURI(sb.toString());
object = createURI(sb.toString());