Class GraphPatterns
- java.lang.Object
-
- org.eclipse.rdf4j.sparqlbuilder.graphpattern.GraphPatterns
-
public class GraphPatterns extends Object
A class with static methods to create graph patterns.- See Also:
- SPARQL Graph Pattern
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GraphPatternNotTriples
and(GraphPattern... patterns)
Create a group graph pattern containing the given graph patternsstatic GraphPatternNotTriples
filterExists(boolean exists, GraphPattern... patterns)
static GraphPatternNotTriples
filterExists(GraphPattern... patterns)
static GraphPatternNotTriples
filterNotExists(GraphPattern... patterns)
static GraphPatternNotTriples
minus(GraphPattern... patterns)
static GraphPatternNotTriples
optional(GraphPattern... patterns)
Create an optional group graph pattern containing the given graph patterns:static SubSelect
select(Projectable... projectables)
Create a SPARQL subquery, including the given elements in its projection.static TriplePattern
tp(Resource subject, IRI predicate, Value... objects)
static TriplePattern
tp(Resource subject, IRI predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)static TriplePattern
tp(Resource subject, RdfPredicate predicate, Value... objects)
static TriplePattern
tp(Resource subject, RdfPredicate predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)static TriplePattern
tp(RdfBlankNode.PropertiesBlankNode bnode)
Create a triple pattern from a property-list blank nodestatic TriplePattern
tp(RdfSubject subject, Consumer<EmptyPropertyPathBuilder> propertyPathConfigurer, RdfObject... objects)
Create a triple pattern from a property path and a list of objects.static TriplePattern
tp(RdfSubject subject, IRI predicate, Value... objects)
static TriplePattern
tp(RdfSubject subject, IRI predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)static TriplePattern
tp(RdfSubject subject, RdfPredicateObjectList... lists)
Create a triple pattern with the given subject and predicate-object list(s)static TriplePattern
tp(RdfSubject subject, RdfPredicate predicate, Value... objects)
static TriplePattern
tp(RdfSubject subject, RdfPredicate predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)static GraphPatternNotTriples
union(GraphPattern... patterns)
Create an alternative graph pattern containing the union of the given graph patterns:
-
-
-
Method Detail
-
tp
public static TriplePattern tp(RdfSubject subject, RdfPredicate predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)- Parameters:
subject
-predicate
-objects
-- Returns:
- a new
TriplePattern
- See Also:
- Triple pattern syntax
-
tp
public static TriplePattern tp(RdfSubject subject, RdfPredicate predicate, Value... objects)
-
tp
public static TriplePattern tp(RdfSubject subject, IRI predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)- Parameters:
subject
- the triple pattern subjectpredicate
- the triple pattern predicate as aIRI
objects
- the triples pattern object(s)- Returns:
- a new
TriplePattern
- See Also:
- Triple pattern syntax
-
tp
public static TriplePattern tp(RdfSubject subject, IRI predicate, Value... objects)
-
tp
public static TriplePattern tp(Resource subject, RdfPredicate predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)- Parameters:
subject
- the triple pattern subjectpredicate
- the triple pattern predicate as aIRI
objects
- the triples pattern object(s)- Returns:
- a new
TriplePattern
- See Also:
- Triple pattern syntax
-
tp
public static TriplePattern tp(Resource subject, RdfPredicate predicate, Value... objects)
-
tp
public static TriplePattern tp(Resource subject, IRI predicate, RdfObject... objects)
Create a triple pattern with the given subject, predicate, and object(s)- Parameters:
subject
- the triple pattern subject as aResource
predicate
- the triple pattern predicate as aIRI
objects
- the triples pattern object(s)- Returns:
- a new
TriplePattern
- See Also:
- Triple pattern syntax
-
tp
public static TriplePattern tp(Resource subject, IRI predicate, Value... objects)
-
tp
public static TriplePattern tp(RdfSubject subject, RdfPredicateObjectList... lists)
Create a triple pattern with the given subject and predicate-object list(s)- Parameters:
subject
-lists
-- Returns:
- a new
TriplePattern
- See Also:
- Triple pattern syntax
-
tp
public static TriplePattern tp(RdfBlankNode.PropertiesBlankNode bnode)
Create a triple pattern from a property-list blank node- Parameters:
bnode
- the PropertiesBlankNode instance to convert to a triple pattern- Returns:
- the triple pattern represented by the expansion of this blank node
- See Also:
- blank node syntax
-
tp
public static TriplePattern tp(RdfSubject subject, Consumer<EmptyPropertyPathBuilder> propertyPathConfigurer, RdfObject... objects)
Create a triple pattern from a property path and a list of objects.- Parameters:
subject
- the subjectpropertyPathConfigurer
- an object that accepts anEmptyPropertyPathBuilder
and uses it to create a property pathobjects
- the object(s) of the triple(s)- Returns:
- the triple pattern
-
and
public static GraphPatternNotTriples and(GraphPattern... patterns)
Create a group graph pattern containing the given graph patterns- Parameters:
patterns
- the patterns to include in the group graph a pattern- Returns:
- a new group graph pattern
- See Also:
- SPARQL Group Graph Pattern
-
union
public static GraphPatternNotTriples union(GraphPattern... patterns)
Create an alternative graph pattern containing the union of the given graph patterns:
{ { pattern1 } UNION { pattern2 } UNION ... UNION { patternN } }
- Parameters:
patterns
- the patterns to include in the union- Returns:
- a new alternative graph pattern
- See Also:
- SPARQL Alternative Graph Patterns
-
optional
public static GraphPatternNotTriples optional(GraphPattern... patterns)
Create an optional group graph pattern containing the given graph patterns:
{ OPTIONAL { pattern1 . pattern2 . ... patternN } }
- Parameters:
patterns
- the patterns to include in the optional graph pattern- Returns:
- a new optional graph pattern
- See Also:
- SPARQL Optional Graph Patterns
-
filterExists
public static GraphPatternNotTriples filterExists(GraphPattern... patterns)
-
filterNotExists
public static GraphPatternNotTriples filterNotExists(GraphPattern... patterns)
-
minus
public static GraphPatternNotTriples minus(GraphPattern... patterns)
-
filterExists
public static GraphPatternNotTriples filterExists(boolean exists, GraphPattern... patterns)
-
select
public static SubSelect select(Projectable... projectables)
Create a SPARQL subquery, including the given elements in its projection.- Parameters:
projectables
- the elements to include in the projection of the subquery- Returns:
- a new subquery
- See Also:
- SPARQL Subquery
-
-