Class RenderUtils


  • public final class RenderUtils
    extends Object
    Utility methods for rendering (parts of) SPARQL query strings.
    Author:
    Michael Grove
    • Method Detail

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