     result := regexp_replace(result, '\x0C', '\\\\f'); -- form feed
     result := regexp_replace(result, '\x0D', '\\\\r'); -- carriage return
     result := regexp_replace(result, '\x1B', '\\\\e'); -- escape, not valid in quad store upload anyway
+    -- not a control char but " should be escaped as well.
+    result := regexp_replace(result, '\x22', '\\\\"'); -- escape double quotes
     return result;
 }
 ;

}
;

CREATE PROCEDURE vql_replace_control_chars(in str_ng any) {
    declare result any;
    result := regexp_replace(str_ng, '\x07', '\\\\a'); -- bell
    result := regexp_replace(result, '\x09', '\\\\t'); -- tab

    if (isiri_id(object)) {
        return vql_format_iri(object);
    } else {
        result := concat('"', vql_escape_chars(__ro2sq(object)), '"');
        -- result := concat('"', __ro2sq(object), '"');
        objectType := __ro2sq(DB.DBA.RDF_DATATYPE_OF_OBJ(object));
        languageTag := __ro2sq(DB.DBA.RDF_LANGUAGE_OF_OBJ(object));
