use of org.apache.jena.graph.Triple in project jena by apache.
the class SecuredModelImpl method removeAllReifications.
@Override
public void removeAllReifications(final Statement s) throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException {
checkUpdate();
if (canDelete(new Triple(Node.ANY, RDF.subject.asNode(), wildCardNode(s.getSubject()))) && canDelete(new Triple(Node.ANY, RDF.predicate.asNode(), wildCardNode(s.getPredicate()))) && canDelete(new Triple(Node.ANY, RDF.object.asNode(), wildCardNode(s.getObject())))) {
holder.getBaseItem().removeAllReifications(s);
} else {
final RSIterator iter = holder.getBaseItem().listReifiedStatements(s);
try {
while (iter.hasNext()) {
final ReifiedStatement rs = iter.next();
checkDelete(new Triple(rs.asNode(), RDF.subject.asNode(), wildCardNode(s.getSubject())));
checkDelete(new Triple(rs.asNode(), RDF.predicate.asNode(), wildCardNode(s.getPredicate())));
checkDelete(new Triple(rs.asNode(), RDF.object.asNode(), wildCardNode(s.getObject())));
}
holder.getBaseItem().removeAllReifications(s);
} finally {
iter.close();
}
}
}
use of org.apache.jena.graph.Triple in project jena by apache.
the class SecuredModelImpl method createBag.
@Override
public SecuredBag createBag(final String uri) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
checkUpdate();
checkCreate(new Triple(NodeFactory.createURI(uri), RDF.type.asNode(), RDF.Bag.asNode()));
return SecuredBagImpl.getInstance(holder.getSecuredItem(), holder.getBaseItem().createBag(uri));
}
use of org.apache.jena.graph.Triple in project jena by apache.
the class SecuredModelImpl method getSeq.
@Override
public SecuredSeq getSeq(final String uri) throws ReadDeniedException, AuthenticationRequiredException {
checkRead();
checkRead(new Triple(NodeFactory.createURI(uri), RDF.type.asNode(), RDF.Seq.asNode()));
return SecuredSeqImpl.getInstance(holder.getSecuredItem(), holder.getBaseItem().getSeq(uri));
}
use of org.apache.jena.graph.Triple in project jena by apache.
the class SecuredModelImpl method createList.
@Override
public SecuredRDFList createList() throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
checkUpdate();
checkCreate(new Triple(SecurityEvaluator.FUTURE, RDF.first.asNode(), RDF.nil.asNode()));
return SecuredRDFListImpl.getInstance(holder.getSecuredItem(), holder.getBaseItem().createList());
}
use of org.apache.jena.graph.Triple in project jena by apache.
the class SecuredResourceImpl method hasLiteral.
/**
* Answer true iff this resource has the value <code>o</code> for property
* <code>p</code>. <code>o</code> is interpreted as a typed literal with the
* appropriate RDF type.
*
* @throws ReadDeniedException
* @throws AuthenticationRequiredException
*/
@Override
public boolean hasLiteral(final Property p, final boolean o) throws ReadDeniedException, AuthenticationRequiredException {
checkRead();
checkRead(new Triple(holder.getBaseItem().asNode(), p.asNode(), ResourceFactory.createTypedLiteral(o).asNode()));
return holder.getBaseItem().hasLiteral(p, o);
}
Aggregations