/** Note a tuple not being output */ protected void skipOne(X object, String printForm, long line, long col) { errorHandler.warning("Skip: " + printForm, line, col); }
protected static boolean validateByDatatypeDateTime(String lexicalForm, RDFDatatype datatype, ErrorHandler handler, long line, long col) { if ( lexicalForm.contains(" ") ) { handler.warning("Whitespace in XSD date or time literal: '"+lexicalForm+"'", line, col) ; return false ; } if ( lexicalForm.contains("\n") ) { handler.warning("Newline in XSD date or time literal: '"+lexicalForm+"'", line, col) ; return false ; } if ( lexicalForm.contains("\r") ) { handler.warning("Newline in XSD date or time literal: '"+lexicalForm+"'", line, col) ; return false ; } //if ( ! StrictXSDLexicialForms ) // Jena is already strict. return validateByDatatypeJena(lexicalForm, datatype, handler, line, col) ; }
/** Note a tuple not being output */ protected void skipOne(X object, String printForm, long line, long col) { profile.getHandler().warning("Skip: "+printForm, line, col) ; }
protected static boolean checkWhitespace(String lexicalForm, RDFDatatype datatype, ErrorHandler handler, long line, long col) { if ( lexicalForm.contains(" ") ) { handler.warning("Whitespace in "+xsdDatatypeName(datatype)+" literal: '" + lexicalForm + "'", line, col) ; return false ; } if ( lexicalForm.contains("\n") ) { handler.warning("Newline in "+xsdDatatypeName(datatype)+" literal: '" + lexicalForm + "'", line, col) ; return false ; } if ( lexicalForm.contains("\r") ) { handler.warning("Newline in "+xsdDatatypeName(datatype)+" literal: '" + lexicalForm + "'", line, col) ; return false ; } return true ; }
private void warning(String message, Object... args) { String msg = String.format(message, args); errorHandler.warning(msg, reader.getLineNum(), reader.getColNum()); //exception(message, args); }
private void warning(String message, Object... args) { String msg = String.format(message, args); errorHandler.warning(msg, reader.getLineNum(), reader.getColNum()); //exception(message, args); }
private void warning(String message, Object... args) { String msg = String.format(message, args); errorHandler.warning(msg, reader.getLineNum(), reader.getColNum()); //exception(message, args); }
protected static boolean validateByDatatypeJena(String lexicalForm, RDFDatatype datatype, ErrorHandler handler, long line, long col) { if ( datatype.isValid(lexicalForm) ) return true ; handler.warning("Lexical form '" + lexicalForm + "' not valid for datatype " + xsdDatatypeName(datatype), line, col) ; return false ; }
protected static boolean validateByDatatypeJena(String lexicalForm, RDFDatatype datatype, ErrorHandler handler, long line, long col) { if ( datatype.isValid(lexicalForm) ) return true ; handler.warning("Lexical form '"+lexicalForm+"' not valid for datatype "+datatype.getURI(), line, col) ; return false ; }
@Override public IRI makeIRI(String uriStr, long line, long col) { IRI iri = resolver.resolveSilent(uriStr); // Some specific problems and specific error messages,. if ( uriStr.contains(" ") ) { // Specific check for spaces. errorHandler.warning("Bad IRI: <" + uriStr + "> Spaces are not legal in URIs/IRIs.", line, col); return iri; } if ( !checking ) return iri; // At this point, IRI "errors" are warnings. // A tuned set of checking. CheckerIRI.iriViolations(iri, errorHandler, line, col); return iri; }
@Override public void warning(Exception e) { Pair<Integer, Integer> p = getLineCol(e) ; errorHandler.warning(e.getMessage(), p.getLeft(), p.getRight()) ; }
@Override public void warning(Exception e) { Pair<Integer, Integer> p = getLineCol(e) ; errorHandler.warning(e.getMessage(), p.getLeft(), p.getRight()) ; }
public LangNQuadsSkipBad(TokenizerTextForgiving tokens, ParserProfile profile, StreamRDF dest) { try { base = new PeekIterator<>(new Wrapper(tokens, profile, dest)); } catch (RiotException e) { bad = e; profile.getErrorHandler().warning(e.getMessage(), -1, -1); } }
public LangNTriplesSkipBad(TokenizerTextForgiving tokens, ParserProfile profile, StreamRDF dest) { try { base = new PeekIterator<>(new Wrapper(tokens, profile, dest)); } catch (RiotException e) { bad = e; profile.getErrorHandler().warning(e.getMessage(), -1, -1); } }
public LangNQuadsSkipBad(TokenizerTextForgiving tokens, ParserProfile profile, StreamRDF dest) { try { base = new PeekIterator<>(new Wrapper(tokens, profile, dest)); } catch (RiotException e) { bad = e; profile.getErrorHandler().warning(e.getMessage(), -1, -1); } }
public LangNTriplesSkipBad(TokenizerTextForgiving tokens, ParserProfile profile, StreamRDF dest) { try { base = new PeekIterator<>(new Wrapper(tokens, profile, dest)); } catch (RiotException e) { bad = e; profile.getErrorHandler().warning(e.getMessage(), -1, -1); } }
@Override public void quad(Quad quad) { if ( quad.isTriple() || quad.isDefaultGraph() ) graph.add(quad.asTriple()) ; else { if ( ! warningIssued ) { //SysRIOT.getLogger().warn("Only triples or default graph data expected : named graph data ignored") ; // Not ideal - assumes the global default. ErrorHandlerFactory.getDefaultErrorHandler().warning("Only triples or default graph data expected : named graph data ignored", -1, -1) ; } warningIssued = true ; } //throw new IllegalStateException("Quad passed to graph parsing") ; }
@Override public void quad(Quad quad) { if ( quad.isTriple() || quad.isDefaultGraph() ) graph.add(quad.asTriple()) ; else { if ( ! warningIssued ) { //SysRIOT.getLogger().warn("Only triples or default graph data expected : named graph data ignored") ; // Not ideal - assumes the global default. ErrorHandlerFactory.getDefaultErrorHandler().warning("Only triples or default graph data expected : named graph data ignored", -1, -1) ; } warningIssued = true ; } //throw new IllegalStateException("Quad passed to graph parsing") ; }
public boolean check(Node node, long line, long col) { // NodeVisitor? if ( node.isURI() ) return checkIRI(node, line, col) ; else if ( node.isBlank() ) return checkBlank(node, line, col) ; else if ( node.isLiteral() ) return checkLiteral(node, line, col) ; else if ( node.isVariable() ) return checkVar(node, line, col) ; handler.warning("Not a recognized node: ", line, col) ; return false ; }
public boolean check(Node node, long line, long col) { // NodeVisitor? if ( node.isURI() ) return checkIRI(node, line, col) ; else if ( node.isBlank() ) return checkBlank(node, line, col) ; else if ( node.isLiteral() ) return checkLiteral(node, line, col) ; else if ( node.isVariable() ) return checkVar(node, line, col) ; handler.warning("Not a recognized node: ", line, col) ; return false ; }