Package com.stardog.stark

# Class StatementPattern

java.lang.Object
com.stardog.stark.StatementPattern

All Implemented Interfaces:
  `Resource`, `Statement`, `Value`, `Serializable`, `Predicate<Statement>`

public final class StatementPattern extends Object implements Statement, Predicate<Statement>

A `Statement` implementation representing a Statement pattern, which is a Statement where some or all of the SPOC elements are a wildcard.

Given a pattern of `pattern(*, :p, *)` it would match `:s :p :o` and `:foo :p :bar` but not `:s :pred :o`.

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove
See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `StatementPattern.Builder`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final IRI`
  `WILDCARD`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Resource`
  `context()`
  The name of the graph in which this statement appears.
  `boolean`
  `equals(Object theObj)`
  `int`
  `hashCode()`
  `static StatementPattern.Builder`
  `newBuilder()`
  `static StatementPattern`
  `o(Value theObject)`
  `Value`
  `object()`
  The object of the statement
  `static StatementPattern`
  `p(IRI thePredicate)`
  `static StatementPattern`
  `po(IRI thePred, Value theObject)`
  `IRI`
  `predicate()`
  The predicate of the statement
  `static StatementPattern`
  `s(Resource theSubj)`
  `static StatementPattern`
  `sp(Resource theSubj, IRI thePred)`
  `static StatementPattern`
  `spo(Resource theSubj, IRI thePred, Value theObj)`
  `Resource`
  `subject()`
  The subject of the statement
  `boolean`
  `test(Statement theStatement)`
  Return whether or not this pattern matches the given Statement

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.function.Predicate

  `and, negate, or`

- ## Field Details

  - ### WILDCARD

    public static final IRI WILDCARD

- ## Method Details

  - ### test

    public boolean test(@Nonnull Statement theStatement)
    Return whether or not this pattern matches the given Statement
    Specified by:
      `test` in interface `Predicate<Statement>`
    Parameters:
      `theStatement` - the Statement
    Returns:
      true if matches, false otherwise

  - ### subject

    @Nonnull public Resource subject()
    The subject of the statement
    Specified by:
      `subject` in interface `Statement`
    Returns:
      the subject

  - ### predicate

    @Nonnull public IRI predicate()
    The predicate of the statement
    Specified by:
      `predicate` in interface `Statement`
    Returns:
      the predicate

  - ### object

    @Nonnull public Value object()
    The object of the statement
    Specified by:
      `object` in interface `Statement`
    Returns:
      the object

  - ### context

    @Nonnull public Resource context()
    The name of the graph in which this statement appears.
    Specified by:
      `context` in interface `Statement`
    Returns:
      the name of the graph, within an RDF dataset, which contains this statement. if the `Statement` is in the default graph, `Values.DEFAULT_GRAPH` will be returned.
    See Also:
      - RDF Graphs

  - ### equals

    public boolean equals(Object theObj)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### newBuilder

    @Nonnull public static StatementPattern.Builder newBuilder()

  - ### o

    @Nonnull public static StatementPattern o(@Nonnull Value theObject)

  - ### p

    @Nonnull public static StatementPattern p(@Nonnull IRI thePredicate)

  - ### s

    @Nonnull public static StatementPattern s(@Nonnull Resource theSubj)

  - ### sp

    @Nonnull public static StatementPattern sp(@Nonnull Resource theSubj, @Nonnull IRI thePred)

  - ### spo

    @Nonnull public static StatementPattern spo(@Nonnull Resource theSubj, @Nonnull IRI thePred, @Nonnull Value theObj)

  - ### po

    @Nonnull public static StatementPattern po(@Nonnull IRI thePred, @Nonnull Value theObject)