Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.ContextStatementImpl


  public Statement createStatement(Resource subject, URI predicate, Value object) {
    return new StatementImpl(subject, predicate, object);
  }

  public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) {
    return new ContextStatementImpl(subject, predicate, object, context);
  }
View Full Code Here


  public Statement createStatement(Resource subject, URI predicate, Value object) {
    return new StatementImpl(subject, predicate, object);
  }

  public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) {
    return new ContextStatementImpl(subject, predicate, object, context);
  }
View Full Code Here

    }

    protected static void addStatement(final Resource subject, final URI predicate, final Value object, final Resource context, final SailConnection sailConnection) {
        Statement statement;
        if (null != context) {
            statement = new ContextStatementImpl(subject, predicate, object, context);
        } else {
            statement = new StatementImpl(subject, predicate, object);
        }
        SailHelper.addStatement(statement, sailConnection);
    }
View Full Code Here

    public void setProperty(final String key, final Object value) {
        if (key.equals(SailTokens.NAMED_GRAPH)) {
            try {
                URI namedGraph = new URIImpl(this.graph.expandPrefix(value.toString()));
                SailHelper.removeStatement(this.rawEdge, this.graph.getSailConnection().get());
                this.rawEdge = new ContextStatementImpl(this.rawEdge.getSubject(), this.rawEdge.getPredicate(), this.rawEdge.getObject(), namedGraph);
                SailHelper.addStatement(this.rawEdge, this.graph.getSailConnection().get());
            } catch (Exception e) {
                throw new RuntimeException(e.getMessage(), e);
            }
        } else {
View Full Code Here

  public Statement createStatement(Resource subject, URI predicate, Value object) {
    return new StatementImpl(subject, predicate, object);
  }

  public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) {
    return new ContextStatementImpl(subject, predicate, object, context);
  }
View Full Code Here

  public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) {
    if (context == null) {
      return new StatementImpl(subject, predicate, object);
    }
    else {
      return new ContextStatementImpl(subject, predicate, object, context);
    }
  }
View Full Code Here

     * @param context   The statement's context.
     * @return The created statement.
     */
    @Override
    public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) {
        return new ContextStatementImpl(subject,predicate,object,context);
    }
View Full Code Here

            boolean hasContext = input.readBoolean();
            if(hasContext) {
                Resource context = (Resource) input.readObject();

                model.add(new ContextStatementImpl(subject,predicate,object,context));
            } else {
                model.add(new StatementImpl(subject,predicate,object));
            }
        }
View Full Code Here

     * @param st The statement.
     * @throws org.openrdf.rio.RDFHandlerException If the RDF handler has encountered an unrecoverable error.
     */
    @Override
    public void handleStatement(Statement st) throws RDFHandlerException {
        Statement wrapped = new ContextStatementImpl(st.getSubject(),st.getPredicate(),st.getObject(), context);

        super.handleStatement(wrapped);
    }
View Full Code Here

     * @param context   The statement's context.
     * @return The created statement.
     */
    @Override
    public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) {
        return new ContextStatementImpl(subject,predicate,object,context);
    }
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.ContextStatementImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.