@Override public Statement createStatement(final Resource subject, final URI predicate, final Value object, final Resource context) { return new ContextStatementImpl(subject, predicate, object, context); }
public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) { return new ContextStatementImpl(subject, predicate, object, context); } }
@Override public Statement createStatement(final Resource subject, final URI predicate, final Value object, final Resource context) { return new ContextStatementImpl(subject, predicate, object, context); }
private Statement stmt(Resource s, URI p, Value o, Resource c) { return new ContextStatementImpl(s, p, o, c); }
/** * Creates a new statement with the supplied subject, predicate and object * and associated context. * * @param subject The statement's subject. * @param predicate The statement's predicate. * @param object The statement's object. * @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); }
/** * Creates a new statement with the supplied subject, predicate and object * and associated context. * * @param subject The statement's subject. * @param predicate The statement's predicate. * @param object The statement's object. * @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); }
@SuppressWarnings("unchecked") public void add(Resource s, URI p, Value o, Resource c) { add((F)new ContextStatementImpl(s,p,o,c)); }
@SuppressWarnings("unchecked") public void add(Resource s, URI p, Value o, Resource c) { add((F)new ContextStatementImpl(s,p,o,c)); }
private Statement stmt(Resource s, URI p, Value o, Resource c) { return new ContextStatementImpl(s, p, o, c); }
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); }
private void writeObject(ObjectOutputStream s) throws IOException { // Write out any hidden serialization magic s.defaultWriteObject(); // Write in size s.writeInt(statements.size()); // Write in all elements for (ModelStatement st : statements) { Resource subj = st.getSubject(); URI pred = st.getPredicate(); Value obj = st.getObject(); Resource ctx = st.getContext(); s.writeObject(new ContextStatementImpl(subj, pred, obj, ctx)); } }
public Collection<Statement> getStatements() { Collection<Statement> statements = new ArrayList<Statement>(); if (getContexts() != null && getContexts().length > 1) { for (Resource contxt : getContexts()) { statements.add(new ContextStatementImpl(getSubject(), getPredicate(), getObject(), contxt)); } } else statements.add(this); return statements; }
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 { throw new IllegalArgumentException(NAMED_GRAPH_PROPERTY); } }
/** * Handles a statement. * * @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); } }
public static Statement readStatement(String subjectString, String predicateString, String objectString, String contextString) { Resource subject = createResource(subjectString); URI predicate = VALUE_FACTORY.createURI(predicateString); boolean isObjectLiteral = objectString.startsWith("\""); Value object = null; if (isObjectLiteral) { object = parseLiteral(objectString); } else { object = createResource(objectString); } if (contextString == null || contextString.isEmpty()) { return new StatementImpl(subject, predicate, object); } else { Resource context = VALUE_FACTORY.createURI(contextString); return new ContextStatementImpl(subject, predicate, object, context); } }
@Override public void handleStatement(Statement st) { Resource s = st.getSubject(); URI p = st.getPredicate(); Value o = st.getObject(); super .handleStatement(new ContextStatementImpl(s, p, o, uri)); }
/** * Handles a statement. * * @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); } }
@Override public void handleStatement(Statement st) { Resource s = st.getSubject(); URI p = st.getPredicate(); Value o = st.getObject(); super.handleStatement(new ContextStatementImpl(s, p, o, uri)); }
@Override protected Statement convert(Statement stmt) { Resource subject = convertSubject(stmt.getSubject()); URI predicate = stmt.getPredicate(); Value object = convertObject(stmt.getObject()); Resource context = stmt.getContext(); return new ContextStatementImpl(subject, predicate, object, context); }
public static Statement convertStatement(RyaStatement statement) { assert statement != null; if (statement.getContext() != null) { return new ContextStatementImpl(convertURI(statement.getSubject()), convertURI(statement.getPredicate()), convertValue(statement.getObject()), convertURI(statement.getContext())); } else { return new StatementImpl(convertURI(statement.getSubject()), convertURI(statement.getPredicate()), convertValue(statement.getObject())); } }