Class ServletUtils
java.lang.Object
se.liu.ida.hefquin.service.ServletUtils
Utility class for servlet-based integration of the HeFQUIN query engine.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.sparql.resultset.ResultsFormatConverts a MIME type string into a correspondingResultsFormatsupported by Jena's SPARQL result serialization.static org.apache.jena.atlas.json.JsonArraygetExceptions(List<Exception> exceptions) Converts a list of exceptions into a JSON array, including class name, message, and full stack trace for each exception.static org.apache.jena.atlas.json.JsonArraygetExceptions(QueryProcessingStatsAndExceptions statsAndExcs) Converts the exceptions of the given object into a JSON array, including class name, message, and full stack trace for each exception.
-
Constructor Details
-
ServletUtils
public ServletUtils()
-
-
Method Details
-
convert
Converts a MIME type string into a correspondingResultsFormatsupported by Jena's SPARQL result serialization. Recognized MIME types: - application/sparql-results+json - application/sparql-results+xml - text/csv - text/tab-separated-values If the MIME type is unrecognized or null,ResultsFormat.FMT_RS_CSVis returned by default.- Parameters:
mimeType- the MIME type string from the HTTP Accept header or elsewhere- Returns:
- the corresponding
ResultsFormat, or null if the input was null
-
getExceptions
public static org.apache.jena.atlas.json.JsonArray getExceptions(QueryProcessingStatsAndExceptions statsAndExcs) Converts the exceptions of the given object into a JSON array, including class name, message, and full stack trace for each exception.- Parameters:
statsAndExcs- object that contain a list of exceptions; may be null or empty- Returns:
- a JSON array where each entry is a string representation of an exception and its stack trace
-
getExceptions
Converts a list of exceptions into a JSON array, including class name, message, and full stack trace for each exception.- Parameters:
exceptions- the list of exceptions encountered during query processing; may be null or empty- Returns:
- a JSON array where each entry is a string representation of an exception and its stack trace
-