Skip to content

Replace SPARQL filter

skomlaebri edited this page Mar 5, 2015 · 4 revisions

Ontop supports the replace SPARQL filter by translating into similar filter expressions in sql. As regular expression filtering is not part of standard SQL, the use of the replace filter in SPARQL expressions therefore depends on the underlying database. DB2, Mysql and SQL server do not support the use of regexp expression in replace. We do not support the use of flags.

  • H2: REGEXP_REPLACE('Hello World', ' +', ' '). Replaces each substring that matches a regular expression.

  • Postgres: regexp_replace(string text, pattern text, replacement text)

  • Oracle: REGEXP_REPLACE extends the functionality of the REPLACE function by letting you search a string for a regular expression pattern.

  • DB2 and SQL Server and Mysql: REPLACE (source-string, search-string ,replace-string) Replaces all occurrences of search-string in source-string with replace-string. No support for regular expressions.

Clone this wiki locally