Search in sources :

Example 31 with InternalErrorException

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

the class ParserShExC method endValueSetValue.

protected void endValueSetValue() {
    if (valueSetRange == null)
        throw new InternalErrorException("valueSetRange range is null");
    accumulateValueSetRange(valueSetRange);
    valueSetRange = null;
}
Also used : InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 32 with InternalErrorException

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

the class ShaclCompactParser method finishPropertyOr.

protected void finishPropertyOr() {
    List<Node> elts = propertyShapeCollectors.pop();
    if (elts.isEmpty())
        throw new InternalErrorException("No elements in propertyOr");
    if (elts.size() == 1) {
        // Pull up one level.
        rewrite(currentTripleAcc(), elts.get(0), currentPropertyShape());
        return;
    }
    Node list = listToTriples(elts);
    triple(currentTripleAcc(), currentPropertyShape(), SHACL.or, list);
}
Also used : Node(org.apache.jena.graph.Node) InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 33 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 new Triple(sNode, pNode, oNode);
}
Also used : Triple(org.apache.jena.graph.Triple) Node(org.apache.jena.graph.Node) InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 34 with InternalErrorException

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

the class MapWithScope method get.

/**
 * Get a B object for an A object in scope S object
 */
public B get(S scope, A item) {
    if (item == null)
        throw new InternalErrorException("null in MapWithScope.get(,null)");
    Map<A, B> map = scopePolicy.getScope(scope);
    if (map == null)
        // No map - no item->allocation tracking.
        return allocator.alloc(scope, item);
    B mappedItem = map.get(item);
    if (mappedItem == null) {
        mappedItem = allocator.alloc(scope, item);
        map.put(item, mappedItem);
    }
    return mappedItem;
}
Also used : InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 35 with InternalErrorException

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

the class JSONMaker method finishPair.

@Override
public void finishPair(long currLine, long currCol) {
    if (value == null)
        throw new InternalErrorException("null for 'value' (bad finishPair() allignment)");
    String k = keys.pop();
    JsonObject obj = objects.peek();
    if (obj.hasKey(k))
        Log.warn("JSON", "Duplicate key '" + k + "' for object [" + currLine + "," + currCol + "]");
    obj.put(k, value);
    value = null;
}
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