Class StatementPattern

  • All Implemented Interfaces:
    Resource, Statement, Value, java.io.Serializable, java.util.function.Predicate<Statement>

    public final class StatementPattern
    extends java.lang.Object
    implements Statement, java.util.function.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
    • Field Detail

      • WILDCARD

        public static final IRI WILDCARD
    • Method Detail

      • test

        public boolean test​(@Nonnull
                            Statement theStatement)
        Return whether or not this pattern matches the given Statement
        Specified by:
        test in interface java.util.function.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​(java.lang.Object theObj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object