Package com.stardog.stark
Class StatementPattern
- java.lang.Object
-
- com.stardog.stark.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
Statementimplementation 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 classStatementPattern.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Resourcecontext()The name of the graph in which this statement appears.booleanequals(java.lang.Object theObj)inthashCode()static StatementPattern.BuildernewBuilder()static StatementPatterno(Value theObject)Valueobject()The object of the statementstatic StatementPatternp(IRI thePredicate)static StatementPatternpo(IRI thePred, Value theObject)IRIpredicate()The predicate of the statementstatic StatementPatterns(Resource theSubj)static StatementPatternsp(Resource theSubj, IRI thePred)static StatementPatternspo(Resource theSubj, IRI thePred, Value theObj)Resourcesubject()The subject of the statementbooleantest(Statement theStatement)Return whether or not this pattern matches the given Statement
-
-
-
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:
testin interfacejava.util.function.Predicate<Statement>- Parameters:
theStatement- the Statement- Returns:
- true if matches, false otherwise
-
subject
@Nonnull public Resource subject()
The subject of the statement
-
predicate
@Nonnull public IRI predicate()
The predicate of the statement
-
object
@Nonnull public Value object()
The object of the statement
-
context
@Nonnull public Resource context()
The name of the graph in which this statement appears.- Specified by:
contextin interfaceStatement- Returns:
- the name of the graph, within an RDF dataset, which contains this statement. if the `Statement`
is in the default graph,
Values.DEFAULT_GRAPHwill be returned. - See Also:
- RDF Graphs
-
equals
public boolean equals(java.lang.Object theObj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.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)
-
-