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());
}
}
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);
}
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);
}
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);
}
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();
}
});
}
Aggregations