Interface GraphPattern
- All Superinterfaces:
QueryElement
- All Known Subinterfaces:
TriplePattern
- All Known Implementing Classes:
Bind
,GraphPatternNotTriples
,SubSelect
Denotes a SPARQL Graph Pattern
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault GraphPattern
and
(GraphPattern... patterns) Convert this graph pattern into a group graph pattern, combining this graph pattern with the given patterns:default GraphPattern
filter
(Expression<?> constraint) Convert this graph pattern into a group graph pattern and add a filter:default GraphPattern
filterExists
(boolean exists, GraphPattern... patterns) Create anEXISTS
orNOT EXISTS
filter expression with the given patterns based on theexists
paramater and add it to this graph pattern (converting this to a group graph pattern in the process)default GraphPattern
filterExists
(GraphPattern... patterns) Create anEXISTS{}
filter expression with the given graph patterns and add it to this graph pattern (converting this to a group graph pattern in the process):default GraphPattern
filterNotExists
(GraphPattern... patterns) Create aNOT EXISTS{}
filter expression with the given graph patterns and add it to this graph pattern (converting this to a group graph pattern in the process):default GraphPattern
Convert this graph pattern into a named group graph pattern:default boolean
isEmpty()
default GraphPattern
minus
(GraphPattern... patterns) Create aMINUS
graph pattern with the given graph patterns and add it to this graph pattern (converting this to a group graph pattern in the process):default GraphPattern
optional()
Convert this graph pattern into an optional group graph pattern:default GraphPattern
optional
(boolean isOptional) Specify if this graph pattern should be optional.default GraphPattern
union
(GraphPattern... patterns) Convert this graph pattern into an alternative graph pattern, combining this graph pattern with the given patterns:Methods inherited from interface org.eclipse.rdf4j.sparqlbuilder.core.QueryElement
getQueryString
-
Method Details
-
and
Convert this graph pattern into a group graph pattern, combining this graph pattern with the given patterns:
{ thisPattern . pattern1 . pattern2 . ... patternN }
- Parameters:
patterns
- the patterns to add- Returns:
- the new
GraphPattern
instance - See Also:
-
union
Convert this graph pattern into an alternative graph pattern, combining this graph pattern with the given patterns:
{ { thisPattern } UNION { pattern1 } UNION { pattern2 } UNION ... { patternN } }
- Parameters:
patterns
- the patterns to add- Returns:
- the new
GraphPattern
instance - See Also:
-
optional
Convert this graph pattern into an optional group graph pattern:
OPTIONAL {thisPattern}
- Returns:
- the new
GraphPattern
instance - See Also:
-
optional
Specify if this graph pattern should be optional.NOTE: This converts this graph pattern into a group graph pattern.
- Parameters:
isOptional
- if this graph pattern should be optional or not- Returns:
- the new
GraphPattern
instance - See Also:
-
filter
Convert this graph pattern into a group graph pattern and add a filter:
{ thisPattern FILTER { constraint } }
- Parameters:
constraint
- the filter constraint- Returns:
- the new
GraphPattern
instance - See Also:
-
filterExists
Create anEXISTS{}
filter expression with the given graph patterns and add it to this graph pattern (converting this to a group graph pattern in the process):
{ thisPattern FILTER EXISTS { patterns } }
- Parameters:
patterns
- the patterns to pass as arguments to theEXISTS
expression- Returns:
- the new
GraphPattern
instance - See Also:
-
filterNotExists
Create aNOT EXISTS{}
filter expression with the given graph patterns and add it to this graph pattern (converting this to a group graph pattern in the process):
{ thisPattern FILTER NOT EXISTS { patterns } }
- Parameters:
patterns
- the patterns to pass as arguments to theNOT EXISTS
expression- Returns:
- the new
GraphPattern
instance - See Also:
-
filterExists
Create anEXISTS
orNOT EXISTS
filter expression with the given patterns based on theexists
paramater and add it to this graph pattern (converting this to a group graph pattern in the process)- Parameters:
exists
- if the filter should ensure the patterns exist or notpatterns
- the patterns to pass to the filter- Returns:
- the new
GraphPattern
instance
-
minus
Create aMINUS
graph pattern with the given graph patterns and add it to this graph pattern (converting this to a group graph pattern in the process):
{ thisPattern MINUS { patterns } }
- Parameters:
patterns
- the patterns to construct theMINUS
graph pattern with- Returns:
- the new
GraphPattern
instance - See Also:
-
from
Convert this graph pattern into a named group graph pattern:
GRAPH graphName { thisPattern }
- Parameters:
name
- the name to specify- Returns:
- the new
GraphPattern
instance - See Also:
-
isEmpty
default boolean isEmpty()- Returns:
- if this pattern is a collection of GraphPatterns (ie., Group or Alternative patterns), returns if the collection contains any patterns
-