Search in sources :

Example 36 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class ExprTransformNodeElement method transform.

@Override
public Expr transform(ExprFunctionOp funcOp, ExprList args, Op opArg) {
    // Syntax phased only - ignore args and opArg
    Element elt = funcOp.getElement();
    Element elt1 = ElementTransformer.transform(elt, elementTransform, this, beforeVisitor, afterVisitor);
    if (elt == elt1)
        return funcOp;
    else {
        if (funcOp instanceof E_Exists)
            return new E_Exists(elt1);
        if (funcOp instanceof E_NotExists)
            return new E_NotExists(elt1);
        throw new InternalErrorException("Unknown ExprFunctionOp: " + funcOp.getFunctionSymbol());
    }
}
Also used : Element(org.apache.jena.sparql.syntax.Element) InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 37 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class TupleLib method triple.

private static Triple triple(NodeTable nodeTable, NodeId s, NodeId p, NodeId o) {
    if (!NodeId.isConcrete(s))
        throw new InternalErrorException("Invalid id for subject: " + fmt(s, p, o));
    if (!NodeId.isConcrete(p))
        throw new InternalErrorException("Invalid id for predicate: " + fmt(s, p, o));
    if (!NodeId.isConcrete(o))
        throw new InternalErrorException("Invalid id for object: " + fmt(s, p, o));
    Node sNode = nodeTable.getNodeForNodeId(s);
    if (sNode == null)
        throw new InternalErrorException("Invalid id node for subject (null node): " + fmt(s, p, o));
    Node pNode = nodeTable.getNodeForNodeId(p);
    if (pNode == null)
        throw new InternalErrorException("Invalid id node for predicate (null node): " + fmt(s, p, o));
    Node oNode = nodeTable.getNodeForNodeId(o);
    if (oNode == null)
        throw new InternalErrorException("Invalid id node for object (null node): " + fmt(s, p, o));
    return Triple.create(sNode, pNode, oNode);
}
Also used : Node(org.apache.jena.graph.Node) InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 38 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class AccessCtl_DenyUpdate method validate.

@Override
public void validate(HttpAction action) {
    DatasetGraph dsg = action.getDataset();
    if (DataAccessCtl.isAccessControlled(dsg)) {
        if (label == null)
            ServletOps.errorBadRequest("Not supported");
        ServletOps.errorBadRequest(label + " : not supported");
        throw new InternalErrorException("AccessCtl_DenyUpdate: " + "didn't reject request");
    }
    other.validate(action);
}
Also used : InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph)

Example 39 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class TransformElementLib method applyVar.

public static Var applyVar(Var v, ExprTransform exprTransform) {
    if (exprTransform == null)
        return v;
    ExprVar expr = new ExprVar(v);
    Expr e = exprTransform.transform(expr);
    if (e instanceof ExprVar)
        return ((ExprVar) e).asVar();
    throw new InternalErrorException("Managed to turn a variable " + v + " into " + e);
}
Also used : ExprVar(org.apache.jena.sparql.expr.ExprVar) Expr(org.apache.jena.sparql.expr.Expr) InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 40 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class DatasetGraphInMemory method _commit.

private void _commit() {
    withLock(systemLock, () -> {
        quadsIndex().commit();
        defaultGraph().commit();
        quadsIndex().end();
        defaultGraph().end();
        if (transactionMode().equals(WRITE)) {
            if (version.get() != generation.get())
                throw new InternalErrorException(String.format("Version=%d, Generation=%d", version.get(), generation.get()));
            generation.incrementAndGet();
        }
    });
}
Also used : InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Aggregations

InternalErrorException (org.apache.jena.atlas.lib.InternalErrorException)48 Node (org.apache.jena.graph.Node)14 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)4 AccessStep (org.apache.jena.dboe.trans.bplustree.AccessPath.AccessStep)3 Graph (org.apache.jena.graph.Graph)3 Triple (org.apache.jena.graph.Triple)3 Var (org.apache.jena.sparql.core.Var)3 StringReader (java.io.StringReader)2 DataAccessPoint (org.apache.jena.fuseki.server.DataAccessPoint)2 Dataset (org.apache.jena.query.Dataset)2 Model (org.apache.jena.rdf.model.Model)2 Lang (org.apache.jena.riot.Lang)2 RiotException (org.apache.jena.riot.RiotException)2 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)2 Table (org.apache.jena.sparql.algebra.Table)2 OpGraph (org.apache.jena.sparql.algebra.op.OpGraph)2 TableEmpty (org.apache.jena.sparql.algebra.table.TableEmpty)2 ExecutionContext (org.apache.jena.sparql.engine.ExecutionContext)2 QueryIterator (org.apache.jena.sparql.engine.QueryIterator)2 Binding (org.apache.jena.sparql.engine.binding.Binding)2