d2rq/d2rq — pull request #201 by devwout (2013-03-05 11:38:54+00:00)
Title: Free text search in PostgreSQL, Oracle and MySQL.

Usage: FILTER (?o, 'some words')

Semantics: given some tokenizer t, the filter matches iff
t('some words') is a subset of t(?o)
The exact tokenizer implementation depends on the database.

Note that it is also possible for a tokenizer to return zero tokens.
(when the text consists of only stopwords)

Design decisions
* Function namespace: analogous to jena ARQ function namespace

* Function name: analogous to SPARQL langMatches function name.
* Used a custom filter function to accomodate additional arguments
later, for example the text search configuration.

Limitations
* The first argument to the filter function must be a variable,
arbitrary expressions are not supported.
* The second argument to the filter must be a string,
expressions or variables are not supported.
* The variable argument must map to one or more database columns.
Mapping to constant values or sql expressions is currently not supported.
* When the variable maps to a pattern or a URI, only the values
in the actual SQL columns are searched and matched, not the full URI.
* No boolean expression syntax is supported, even when the underlying
database does. Reason is we wanted a common interface that works
similar on multiple databases.
* In PostgreSQL, we currently assume the text search configuration is
'english'. This could be easily made configurable, though.
* Oracle will only allow free text search on columns for which
an index of type CTXCAT exists. When no such index exists,
Oracle will signal an error and the query will not complete.
* MySQL will only allow free text search on columns for which
an index of type FULLTEXT exists. When no such index exists,
MySQL will signal an error and the query will not complete.