use of org.apache.jena.shared.PropertyNotFoundException in project jena by apache.
the class SecuredResourceImpl method getRequiredProperty.
@Override
public SecuredStatement getRequiredProperty(Property p, String lang) throws PropertyNotFoundException, ReadDeniedException, AuthenticationRequiredException {
checkRead();
final ExtendedIterator<Statement> iter = holder.getBaseItem().listProperties(p, lang).filterKeep(new PermStatementFilter(Action.Read, this));
try {
if (iter.hasNext()) {
return org.apache.jena.permissions.model.impl.SecuredStatementImpl.getInstance(getModel(), iter.next());
} else {
throw new PropertyNotFoundException(p);
}
} finally {
iter.close();
}
}
use of org.apache.jena.shared.PropertyNotFoundException in project jena by apache.
the class RDFInput method buildBinding.
private Binding buildBinding(Resource soln) {
// foreach row
BindingMap rb = BindingFactory.create();
StmtIterator bindingIter = soln.listProperties(ResultSetGraphVocab.binding);
for (; bindingIter.hasNext(); ) {
Resource binding = bindingIter.nextStatement().getResource();
String var = binding.getRequiredProperty(ResultSetGraphVocab.variable).getString();
try {
RDFNode val = binding.getRequiredProperty(ResultSetGraphVocab.value).getObject();
rb.add(Var.alloc(var), val.asNode());
} catch (PropertyNotFoundException ex) {
Log.warn(this, "Failed to get value for ?" + var);
}
// We include the value even if it is the marker term "rs:undefined"
// if ( val.equals(ResultSetVocab.undefined))
// continue ;
// The ResultSetFormatter code equates null (not found) with
// rs:undefined. When Jena JUnit testing, it does not matter if the
// recorded result has the term absent or explicitly undefined.
}
bindingIter.close();
return rb;
}
Aggregations