private static String getStringValueFromRow ( QuerySolution resultRow , String variableName ) { // Check the input and exit immediately if null if ( resultRow == null ) { return null ; } String result = null ; Resource res = resultRow . getResource ( variableName ) ; if ( res != null && res . isLiteral ( ) ) { result = res . asLiteral ( ) . getString ( ) ; } return result ; }
Given a query result from a SPARQL query obtain the given variable value as a String