org.eclipse.rdf4j.federated.util

## Class FilterUtils

- java.lang.Object
- - org.eclipse.rdf4j.federated.util.FilterUtils

-     public class FilterUtils
      extends Object

  Various utility functions to handle filter expressions. NOTE: currently only implemented for `Compare`, other filter expressions need to be added. If an unexpected filter expression occurs, the filter evaluation is done locally.
  Author:
    Andreas Schwarte

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilterUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static void` | `append(Compare cmp, StringBuilder sb)`
    `protected static void` | `append(ValueConstant vc, StringBuilder sb)`
    `protected static void` | `append(ValueExpr expr, StringBuilder sb)`
    `protected static void` | `append(Var var, StringBuilder sb)`
    `protected static StringBuilder` | `appendLiteral(StringBuilder sb, Literal lit)`
    `protected static StringBuilder` | `appendURI(StringBuilder sb, IRI uri)`
    `protected static StringBuilder` | `appendValue(StringBuilder sb, Value value)`
    `static ValueExpr` | `toFilter(ConjunctiveFilterExpr filterExpr)`
    `static ValueExpr` | `toFilter(FilterExpr filterExpr)`
    `static ValueExpr` | `toFilter(FilterValueExpr filterExpr)`
    `static String` | `toSparqlString(ConjunctiveFilterExpr filterExpr)`
    `static String` | `toSparqlString(FilterExpr filterExpr)`
    `static String` | `toSparqlString(FilterValueExpr filterExpr)` Returns a SPARQL representation of the provided expression, e.g Compare(?v, "<", 3) is converted to "?v < '3'"

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

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

- - ### Constructor Detail

    - #### FilterUtils

          public FilterUtils()

  - ### Method Detail

    - #### toSparqlString

          public static String toSparqlString(FilterValueExpr filterExpr)
                                       throws FilterConversionException

      Returns a SPARQL representation of the provided expression, e.g Compare(?v, "<", 3) is converted to "?v < '3'"
      Parameters:
        `filterExpr` -
      Returns:
        the SPARQL string
      Throws:
        `FilterConversionException`

    - #### toSparqlString

          public static String toSparqlString(FilterExpr filterExpr)
                                       throws FilterConversionException

      Throws:
        `FilterConversionException`

    - #### toSparqlString

          public static String toSparqlString(ConjunctiveFilterExpr filterExpr)
                                       throws FilterConversionException

      Throws:
        `FilterConversionException`

    - #### toFilter

          public static ValueExpr toFilter(FilterValueExpr filterExpr)
                                    throws FilterConversionException

      Throws:
        `FilterConversionException`

    - #### toFilter

          public static ValueExpr toFilter(FilterExpr filterExpr)
                                    throws FilterConversionException

      Throws:
        `FilterConversionException`

    - #### toFilter

          public static ValueExpr toFilter(ConjunctiveFilterExpr filterExpr)
                                    throws FilterConversionException

      Throws:
        `FilterConversionException`

    - #### append

          protected static void append(ValueExpr expr,
                                       StringBuilder sb)
                                throws FilterConversionException

      Throws:
        `FilterConversionException`

    - #### append

          protected static void append(Compare cmp,
                                       StringBuilder sb)
                                throws FilterConversionException

      Throws:
        `FilterConversionException`

    - #### append

          protected static void append(Var var,
                                       StringBuilder sb)

    - #### append

          protected static void append(ValueConstant vc,
                                       StringBuilder sb)

    - #### appendValue

          protected static StringBuilder appendValue(StringBuilder sb,
                                                     Value value)

    - #### appendURI

          protected static StringBuilder appendURI(StringBuilder sb,
                                                   IRI uri)

    - #### appendLiteral

          protected static StringBuilder appendLiteral(StringBuilder sb,
                                                       Literal lit)

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