Search in sources :

Example 66 with StatementImpl

use of org.openrdf.model.impl.StatementImpl in project blueprints by tinkerpop.

the class SailEdge method removeProperty.

public <T> T removeProperty(final String key) {
    if (key.equals(SailTokens.NAMED_GRAPH)) {
        try {
            Resource ng = this.rawEdge.getContext();
            SailHelper.removeStatement(this.rawEdge, this.graph.getSailConnection().get());
            this.rawEdge = new StatementImpl(this.rawEdge.getSubject(), this.rawEdge.getPredicate(), this.rawEdge.getObject());
            SailHelper.addStatement(this.rawEdge, this.graph.getSailConnection().get());
            return (T) ng;
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    } else {
        throw new IllegalArgumentException(NAMED_GRAPH_PROPERTY);
    }
}
Also used : StatementImpl(org.openrdf.model.impl.StatementImpl) ContextStatementImpl(org.openrdf.model.impl.ContextStatementImpl) Resource(org.openrdf.model.Resource)

Aggregations

StatementImpl (org.openrdf.model.impl.StatementImpl)66 Statement (org.openrdf.model.Statement)40 Test (org.junit.Test)34 URI (org.openrdf.model.URI)32 ValueFactory (org.openrdf.model.ValueFactory)27 ValueFactoryImpl (org.openrdf.model.impl.ValueFactoryImpl)26 Resource (org.openrdf.model.Resource)19 Value (org.openrdf.model.Value)19 URIImpl (org.openrdf.model.impl.URIImpl)19 HashSet (java.util.HashSet)16 LiteralImpl (org.openrdf.model.impl.LiteralImpl)16 NumericLiteralImpl (org.openrdf.model.impl.NumericLiteralImpl)15 ContextStatementImpl (org.openrdf.model.impl.ContextStatementImpl)14 BindingSet (org.openrdf.query.BindingSet)14 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)14 RdfToRyaConversions.convertStatement (org.apache.rya.api.resolver.RdfToRyaConversions.convertStatement)10 PcjTableNameFactory (org.apache.rya.indexing.pcj.storage.accumulo.PcjTableNameFactory)10 QueryBindingSet (org.openrdf.query.algebra.evaluation.QueryBindingSet)10 TupleQuery (org.openrdf.query.TupleQuery)7 RepositoryConnection (org.openrdf.repository.RepositoryConnection)7