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:
  • 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:
    • 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)