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