Interface SailSink

  • All Superinterfaces:
    AutoCloseable, SailClosable
    All Known Implementing Classes:
    Changeset

    public interface SailSink
    extends SailClosable
    A mutable source of RDF graphs. The life cycle follows that of a write operation.
    Author:
    James Leigh
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      void approve​(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource ctx)
      Adds a statement to the store.
      default void approve​(org.eclipse.rdf4j.model.Statement statement)
      Adds a statement to the store.
      default void approveAll​(Set<org.eclipse.rdf4j.model.Statement> approved, Set<org.eclipse.rdf4j.model.Resource> approvedContexts)  
      void clear​(org.eclipse.rdf4j.model.Resource... contexts)
      Removes all statements from the specified/all contexts.
      void clearNamespaces()
      Removes all namespace declarations from this SailSource.
      default void deprecate​(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource ctx)
      Deprecated.
      void deprecate​(org.eclipse.rdf4j.model.Statement statement)
      Removes a statement.
      default void deprecateAll​(Set<org.eclipse.rdf4j.model.Statement> deprecated)  
      default boolean deprecateByQuery​(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource[] contexts)
      Removes all statements with the specified subject, predicate, object, and context.
      void flush()
      Once this method returns successfully, changes that were made to this SailSink will be visible to subsequent SailSource.dataset(IsolationLevel).
      default void observe​(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource context)
      Called to indicate matching statements have been observed and must not change their state until after this SailSink is committed, iff this was opened in an isolation level compatible with IsolationLevels.SERIALIZABLE.
      void observe​(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts)
      Called to indicate matching statements have been observed and must not change their state until after this SailSink is committed, iff this was opened in an isolation level compatible with IsolationLevels.SERIALIZABLE.
      default void observeAll​(Set<Changeset.SimpleStatementPattern> observed)  
      void prepare()
      Checks if this SailSink is consistent with the isolation level it was created with.
      void removeNamespace​(String prefix)
      Removes a namespace declaration by removing the association between a prefix and a namespace name.
      void setNamespace​(String prefix, String name)
      Sets the prefix for a namespace.
      default boolean supportsDeprecateByQuery()  
    • Method Detail

      • setNamespace

        void setNamespace​(String prefix,
                          String name)
                   throws SailException
        Sets the prefix for a namespace.
        Parameters:
        prefix - The new prefix, or an empty string in case of the default namespace.
        name - The namespace name that the prefix maps to.
        Throws:
        SailException - If the Sail object encountered an error or unexpected situation internally.
        NullPointerException - In case prefix or name is null.
      • removeNamespace

        void removeNamespace​(String prefix)
                      throws SailException
        Removes a namespace declaration by removing the association between a prefix and a namespace name.
        Parameters:
        prefix - The namespace prefix, or an empty string in case of the default namespace.
        Throws:
        SailException
        NullPointerException - In case prefix is null.
      • clear

        void clear​(org.eclipse.rdf4j.model.Resource... contexts)
            throws SailException
        Removes all statements from the specified/all contexts. If no contexts are specified the method operates on the entire repository.
        Parameters:
        contexts - The context(s) from which to remove the statements. Note that this parameter is a vararg and as such is optional. If no contexts are specified the method operates on the entire repository. A null value can be used to match context-less statements.
        Throws:
        SailException - If the statements could not be removed.
      • observe

        void observe​(org.eclipse.rdf4j.model.Resource subj,
                     org.eclipse.rdf4j.model.IRI pred,
                     org.eclipse.rdf4j.model.Value obj,
                     org.eclipse.rdf4j.model.Resource... contexts)
              throws SailException
        Called to indicate matching statements have been observed and must not change their state until after this SailSink is committed, iff this was opened in an isolation level compatible with IsolationLevels.SERIALIZABLE.
        Parameters:
        subj - A Resource specifying the subject, or null for a wildcard.
        pred - A IRI specifying the predicate, or null for a wildcard.
        obj - A Value specifying the object, or null for a wildcard.
        contexts - The context(s) of the observed statements. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on all contexts.
        Throws:
        SailException - If the triple source failed to observe these statements.
      • observe

        default void observe​(org.eclipse.rdf4j.model.Resource subj,
                             org.eclipse.rdf4j.model.IRI pred,
                             org.eclipse.rdf4j.model.Value obj,
                             org.eclipse.rdf4j.model.Resource context)
                      throws SailException
        Called to indicate matching statements have been observed and must not change their state until after this SailSink is committed, iff this was opened in an isolation level compatible with IsolationLevels.SERIALIZABLE.
        Parameters:
        subj - A Resource specifying the subject, or null for a wildcard.
        pred - A IRI specifying the predicate, or null for a wildcard.
        obj - A Value specifying the object, or null for a wildcard.
        context - The context of the observed statements.
        Throws:
        SailException - If the triple source failed to observe these statements.
      • approve

        void approve​(org.eclipse.rdf4j.model.Resource subj,
                     org.eclipse.rdf4j.model.IRI pred,
                     org.eclipse.rdf4j.model.Value obj,
                     org.eclipse.rdf4j.model.Resource ctx)
              throws SailException
        Adds a statement to the store.
        Parameters:
        subj - The subject of the statement to add.
        pred - The predicate of the statement to add.
        obj - The object of the statement to add.
        ctx - The context to add the statement to.
        Throws:
        SailException - If the statement could not be added, for example because no transaction is active.
      • approve

        default void approve​(org.eclipse.rdf4j.model.Statement statement)
                      throws SailException
        Adds a statement to the store.
        Parameters:
        statement - The statement to add.
        Throws:
        SailException - If the statement could not be added, for example because no transaction is active.
      • deprecate

        @Deprecated(since="3.1.0")
        default void deprecate​(org.eclipse.rdf4j.model.Resource subj,
                               org.eclipse.rdf4j.model.IRI pred,
                               org.eclipse.rdf4j.model.Value obj,
                               org.eclipse.rdf4j.model.Resource ctx)
                        throws SailException
        Deprecated.
        Removes a statement with the specified subject, predicate, object, and context. All four parameters may be non-null.
        Parameters:
        subj - The subject of the statement that should be removed
        pred - The predicate of the statement that should be removed
        obj - The object of the statement that should be removed
        ctx - The context from which to remove the statement
        Throws:
        SailException - If the statement could not be removed, for example because no transaction is active.
      • deprecate

        void deprecate​(org.eclipse.rdf4j.model.Statement statement)
                throws SailException
        Removes a statement.
        Parameters:
        statement - The statement that should be removed
        Throws:
        SailException - If the statement could not be removed, for example because no transaction is active.
      • deprecateByQuery

        default boolean deprecateByQuery​(org.eclipse.rdf4j.model.Resource subj,
                                         org.eclipse.rdf4j.model.IRI pred,
                                         org.eclipse.rdf4j.model.Value obj,
                                         org.eclipse.rdf4j.model.Resource[] contexts)
        Removes all statements with the specified subject, predicate, object, and context. All four parameters may be null.
        Throws:
        SailException - If statements could not be removed, for example because no transaction is active.
      • supportsDeprecateByQuery

        default boolean supportsDeprecateByQuery()
      • approveAll

        default void approveAll​(Set<org.eclipse.rdf4j.model.Statement> approved,
                                Set<org.eclipse.rdf4j.model.Resource> approvedContexts)
      • deprecateAll

        default void deprecateAll​(Set<org.eclipse.rdf4j.model.Statement> deprecated)