org.eclipse.rdf4j.sparqlbuilder.graphpattern

## 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 and Description
    --- | ---
    `static GraphPatternNotTriples` | `and(GraphPattern... patterns)` Create a group graph pattern containing the given graph patterns
    `static 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(RdfBlankNode.PropertiesBlankNode bnode)` Create a triple pattern from a property-list blank node
    `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, IRI predicate, Value... objects)`
    `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, RdfObject... objects)` Create a triple pattern with the given subject, predicate, and object(s)
    `static TriplePattern` | `tp(RdfSubject subject, RdfPredicate 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, IRI 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(Resource subject, RdfPredicate predicate, Value... objects)`
    `static GraphPatternNotTriples` | `union(GraphPattern... patterns)` Create an alternative graph pattern containing the union of the given graph patterns:

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 subject
        `predicate` - the triple pattern predicate as a `IRI`
        `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 subject
        `predicate` - the triple pattern predicate as a `IRI`
        `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 a `Resource`
        `predicate` - the triple pattern predicate as a `IRI`
        `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

    - #### 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

Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.