/** Add a triple to the triple store. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples. */ @Override public void performAdd( Triple t ) { throw new AddDeniedException( "GraphBase::performAdd" ); }
@Override public void performAdd(Triple t) { throw new AddDeniedException("GraphUnionRead::performAdd - Read-only graph") ; }
/** Add a triple to the triple store. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples. */ @Override public void performAdd( Triple t ) { throw new AddDeniedException( "GraphBase::performAdd" ); }
@Override public void add(Triple t) throws AddDeniedException { throw new AddDeniedException("read-only graph") ; }
@Override public void performAdd(Triple t) throws AddDeniedException { throw new AddDeniedException("read-only graph") ; }
/** * check that the triple can be created in the securedModel., * * @throws AddDeniedException * on failure * @throws AuthenticationRequiredException * if user is not authenticated and is required to be. */ protected void checkCreate(final Triple t) throws AddDeniedException, AuthenticationRequiredException { if (!canCreate(t)) { throw new AddDeniedException( SecuredItem.Util.triplePermissionMsg(modelNode), t); } }
/** * check that create on the securedModel is allowed, * * @throws AddDeniedException * on failure * @throws AuthenticationRequiredException * if user is not authenticated and is required to be. */ protected void checkCreate() throws AddDeniedException, AuthenticationRequiredException { if (!canCreate()) { throw new AddDeniedException( SecuredItem.Util.modelPermissionMsg(modelNode)); } }
@Override public void performAdd( Triple t ) { Node g = graphNode(gn) ; if ( Quad.isUnionGraph(g) ) throw new AddDeniedException("Can't update the union graph of a dataset") ; Node s = t.getSubject() ; Node p = t.getPredicate() ; Node o = t.getObject() ; dsg.add(g, s, p, o) ; }
@Override public void performAdd(Triple t) { try { AGRepositoryConnection conn = maker.getRepositoryConnection(); AGValueFactory vf = conn.getValueFactory(); conn.add(vf.asResource(t.getSubject()), vf.asURI(t.getPredicate()), vf.asValue(t.getObject()), context); } catch (UnauthorizedException e) { throw new AddDeniedException(e.getMessage()); } catch (RepositoryException e) { throw new RuntimeException(e); } }