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
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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
context()
The name of the graph in which this statement appears.boolean
equals(java.lang.Object theObj)
int
hashCode()
static StatementPattern.Builder
newBuilder()
static StatementPattern
o(Value theObject)
Value
object()
The object of the statementstatic StatementPattern
p(IRI thePredicate)
static StatementPattern
po(IRI thePred, Value theObject)
IRI
predicate()
The predicate of the statementstatic 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 statementboolean
test(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:
test
in 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:
context
in 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_GRAPH
will be returned. - See Also:
- RDF Graphs
-
equals
public boolean equals(java.lang.Object theObj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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)
-
-