org.eclipse.rdf4j.queryrender

## Class RenderUtils

- java.lang.Object
- - org.eclipse.rdf4j.queryrender.RenderUtils

-     public final class RenderUtils
      extends Object

  Utility methods for rendering (parts of) SeRQL and SPARQL query strings.
  Author:
    Michael Grove

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `escape(String theString)` Properly escape out any special characters in the query string.
    `static String` | `getSerqlQueryString(Value theValue)` Deprecated. Use {`toSeRQL(Value)` instead.
    `static String` | `getSPARQLQueryString(Value theValue)` Deprecated. Use `toSPARQL(Value)` instead.
    `static String` | `toSeRQL(Value theValue)` Return the query string rendering of the `Value`
    `static String` | `toSPARQL(Value theValue)` Return the SPARQL query string rendering of the `Value`
    `static StringBuilder` | `toSPARQL(Value value, StringBuilder builder)` Append the SPARQL query string rendering of the `Value` to the supplied `StringBuilder`.

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

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

- - ### Method Detail

    - #### getSPARQLQueryString

          @Deprecated
          public static String getSPARQLQueryString(Value theValue)

      Deprecated. Use `toSPARQL(Value)` instead.
      Return the query string rendering of the `Value`
      Parameters:
        `theValue` - the value to render
      Returns:
        the value rendered in its query string representation

    - #### toSPARQL

          public static String toSPARQL(Value theValue)

      Return the SPARQL query string rendering of the `Value`
      Parameters:
        `theValue` - the value to render
      Returns:
        the value rendered in its SPARQL query string representation

    - #### toSPARQL

          public static StringBuilder toSPARQL(Value value,
                                               StringBuilder builder)

      Append the SPARQL query string rendering of the `Value` to the supplied `StringBuilder`.
      Parameters:
        `value` - the value to render
        `builder` - the `StringBuilder` to append to
      Returns:
        the original `StringBuilder` with the value appended.

    - #### getSerqlQueryString

          @Deprecated
          public static String getSerqlQueryString(Value theValue)

      Deprecated. Use {`toSeRQL(Value)` instead.
      Return the query string rendering of the `Value`
      Parameters:
        `theValue` - the value to render
      Returns:
        the value rendered in its query string representation

    - #### toSeRQL

          public static String toSeRQL(Value theValue)

      Return the query string rendering of the `Value`
      Parameters:
        `theValue` - the value to render
      Returns:
        the value rendered in its query string representation

    - #### escape

          public static String escape(String theString)

      Properly escape out any special characters in the query string. Replaces unescaped double quotes with \" and replaces slashes '\' which are not a valid escape sequence such as \t or \n with a double slash '\\' so they are unescaped correctly by a SPARQL parser.
      Parameters:
        `theString` - the query string to escape chars in
      Returns:
        the escaped query string

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