Interface GraphPattern
- All Superinterfaces:
QueryElement
- All Known Subinterfaces:
TriplePattern
- All Known Implementing Classes:
Bind,GraphPatternNotTriples,SubSelect,Values
Denotes a SPARQL Graph Pattern
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault GraphPatternand(GraphPattern... patterns) Convert this graph pattern into a group graph pattern, combining this graph pattern with the given patterns:default GraphPatternfilter(Expression<?> constraint) Convert this graph pattern into a group graph pattern and add a filter:default GraphPatternfilterExists(boolean exists, GraphPattern... patterns) Create anEXISTSorNOT EXISTSfilter expression with the given patterns based on theexistsparamater and add it to this graph pattern (converting this to a group graph pattern in the process)default GraphPatternfilterExists(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 GraphPatternfilterNotExists(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 GraphPatternConvert this graph pattern into a named group graph pattern:default booleanisEmpty()default GraphPatternminus(GraphPattern... patterns) Create aMINUSgraph pattern with the given graph patterns and add it to this graph pattern (converting this to a group graph pattern in the process):default GraphPatternoptional()Convert this graph pattern into an optional group graph pattern:default GraphPatternoptional(boolean isOptional) Specify if this graph pattern should be optional.default GraphPatternunion(GraphPattern... patterns) Convert this graph pattern into an alternative graph pattern, combining this graph pattern with the given patterns:default GraphPatternvalues(Consumer<Values.VariablesBuilder> valuesConfigurer) 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
GraphPatterninstance - See Also:
-
values
-
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
GraphPatterninstance - See Also:
-
optional
Convert this graph pattern into an optional group graph pattern:
OPTIONAL {thisPattern}- Returns:
- the new
GraphPatterninstance - 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
GraphPatterninstance - 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
GraphPatterninstance - 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 theEXISTSexpression- Returns:
- the new
GraphPatterninstance - 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 EXISTSexpression- Returns:
- the new
GraphPatterninstance - See Also:
-
filterExists
Create anEXISTSorNOT EXISTSfilter expression with the given patterns based on theexistsparamater 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
GraphPatterninstance
-
minus
Create aMINUSgraph 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 theMINUSgraph pattern with- Returns:
- the new
GraphPatterninstance - 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
GraphPatterninstance - 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
-