Class SimpleStatement

java.lang.Object
org.eclipse.rdf4j.model.base.AbstractStatement
org.eclipse.rdf4j.model.impl.SimpleStatement
All Implemented Interfaces:
Serializable, Statement
Direct Known Subclasses:
ContextStatement, ExtensibleStatementImpl

public class SimpleStatement extends AbstractStatement
A simple default implementation of the Statement interface for statements that don't have an associated context. For statements that do have an associated context, ContextStatement can be used.
See Also:
  • Constructor Details

    • SimpleStatement

      protected SimpleStatement(Resource subject, IRI predicate, Value object)
      Creates a new Statement with the supplied subject, predicate and object. *

      Note that creating SimpleStatement objects directly via this constructor is not the recommended approach. Instead, use a ValueFactory (obtained from your repository or by using SimpleValueFactory.getInstance()) to create new Statement objects.

      Parameters:
      subject - The statement's subject, must not be null.
      predicate - The statement's predicate, must not be null.
      object - The statement's object, must not be null.
      See Also:
  • Method Details

    • getSubject

      public Resource getSubject()
      Description copied from interface: Statement
      Gets the subject of this statement.
      Returns:
      The statement's subject.
    • getPredicate

      public IRI getPredicate()
      Description copied from interface: Statement
      Gets the predicate of this statement.
      Returns:
      The statement's predicate.
    • getObject

      public Value getObject()
      Description copied from interface: Statement
      Gets the object of this statement.
      Returns:
      The statement's object.
    • exactSameSubject

      public boolean exactSameSubject(Resource subject)
    • exactSamePredicate

      public boolean exactSamePredicate(IRI predicate)
    • exactSameObject

      public boolean exactSameObject(Value object)
    • getContext

      public Resource getContext()
      Description copied from interface: Statement
      Gets the context of this statement.
      Returns:
      The statement's context, or null in case of the null context or if not applicable.