@Override public void visit(ElementFilter el) { throw new QueryParseException("Paths not permitted in data quad", -1, -1) ; }
@Override public void visit(ElementOptional el) { throw new QueryParseException("optional not permitted in data quad", -1, -1) ; }
@Override public void visit(ElementNotExists el) { throw new QueryParseException("not exists not permitted in data quad", -1, -1) ; }
@Override public void visit(ElementService el) { throw new QueryParseException("service not permitted in data quad", -1, -1) ; }
@Override public void visit(ElementAssign el) { throw new QueryParseException("element assignment not permitted in data quad", -1, -1) ; }
@Override public void visit(ElementBind el) { throw new QueryParseException("bind not permitted in data quad", -1, -1) ; }
public static void throwParseException(String msg) { throw new QueryParseException(msg, -1, -1) ; } }
@Override public void visit(ElementData el) { throw new QueryParseException("element data not permitted in data quad", -1, -1) ; }
@Override public void visit(ElementExists el) { throw new QueryParseException("exists not permitted in data quad", -1, -1) ; }
@Override public void visit(ElementMinus el) { throw new QueryParseException("minus not permitted in data quad", -1, -1) ; }
private static QueryParseException makeException(String msg, int line, int column) { return new QueryParseException(msg, line, column) ; }
@Override public void visit(ElementService el) { throw new QueryParseException("service not permitted in data quad", -1, -1) ; }
protected void finishDataBlockValueRow(int line, int col) { //if ( variables.size() != currentValueRow().size() ) if ( currentColumn+1 != variables.size() ) { String msg = String.format("Mismatch: %d variables but %d values",variables.size(), currentColumn+1) ; msg = QueryParseException.formatMessage(msg, line, col) ; throw new QueryParseException(msg, line , col) ; } }
private static void check(Collection<Var> scope, ElementBind el) { Var var = el.getVar() ; if ( scope.contains(var) ) throw new QueryParseException("BIND: Variable used when already in-scope: "+var+" in "+el, -1 , -1) ; checkAssignment(scope, el.getExpr(), var) ; }
private Quad check(Quad q) { if (Var.isVar(q.getGraph())) throw new QueryParseException("Variables not permitted in data quad", -1, -1); if (Var.isVar(q.getSubject()) || Var.isVar(q.getPredicate()) || Var.isVar(q.getObject())) throw new QueryParseException("Variables not permitted in data quad", -1, -1); if (q.getSubject().isLiteral()) throw new QueryParseException("Literals not allowed as subjects in data", -1, -1); return q; }
@Override protected void check(Triple t) { if ( Var.isVar(getGraph()) ) throw new QueryParseException("Variables not permitted in data quad", -1, -1) ; if ( Var.isVar(t.getSubject()) || Var.isVar(t.getPredicate()) || Var.isVar(t.getObject())) throw new QueryParseException("Variables not permitted in data quad", -1, -1) ; if ( t.getSubject().isLiteral() ) throw new QueryParseException("Literals not allowed as subjects in data", -1, -1) ; }
private Quad check(Quad q) { if (Var.isVar(q.getGraph())) throw new QueryParseException("Variables not permitted in data quad", -1, -1); if (Var.isVar(q.getSubject()) || Var.isVar(q.getPredicate()) || Var.isVar(q.getObject())) throw new QueryParseException("Variables not permitted in data quad", -1, -1); if (q.getSubject().isLiteral()) throw new QueryParseException("Literals not allowed as subjects in data", -1, -1); return q; }
private static void check(Collection<Var> scope, ElementService el) { if ( ARQ.isStrictMode() && el.getServiceNode().isVariable() ) { Var var = Var.alloc(el.getServiceNode()) ; if ( ! scope.contains(var) ) throw new QueryParseException("SERVICE: Variable not already in-scope: "+var+" in "+el, -1 , -1) ; } } }
@Override protected void check(Quad quad) { if ( Var.isVar(quad.getGraph()) || Var.isVar(quad.getSubject()) || Var.isVar(quad.getPredicate()) || Var.isVar(quad.getObject())) throw new QueryParseException("Variables not permitted in data quad", -1, -1) ; if ( quad.getSubject().isLiteral() ) throw new QueryParseException("Literals not allowed as subjects in quad data", -1, -1) ; } }
@Override public void visit(ElementPathBlock el) { for (final TriplePath pth : el.getPattern().getList()) { if ( ! pth.isTriple()) { throw new QueryParseException("Paths not permitted in data quad", -1, -1) ; } } iter = iter.andThen( WrappedIterator.create(el.getPattern().getList().iterator()) .mapWith( pth -> pth.asTriple() ) .mapWith( MAP )); }