Package org.eclipse.rdf4j.queryrender
Class RenderUtils
- java.lang.Object
-
- org.eclipse.rdf4j.queryrender.RenderUtils
-
public final class RenderUtils extends java.lang.ObjectUtility methods for rendering (parts of) SPARQL query strings.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateRenderUtils()No instances
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringescape(java.lang.String theString)Properly escape out any special characters in the query string.static java.lang.StringtoSPARQL(Value theValue)Return the SPARQL query string rendering of theValuestatic java.lang.StringBuildertoSPARQL(Value value, java.lang.StringBuilder builder)Append the SPARQL query string rendering of theValueto the suppliedStringBuilder.
-
-
-
Method Detail
-
toSPARQL
public static java.lang.String toSPARQL(Value theValue)
Return the SPARQL query string rendering of theValue- Parameters:
theValue- the value to render- Returns:
- the value rendered in its SPARQL query string representation
-
toSPARQL
public static java.lang.StringBuilder toSPARQL(Value value, java.lang.StringBuilder builder)
Append the SPARQL query string rendering of theValueto the suppliedStringBuilder.- Parameters:
value- the value to renderbuilder- theStringBuilderto append to- Returns:
- the original
StringBuilderwith the value appended.
-
escape
public static java.lang.String escape(java.lang.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
-
-