Discussion:
Altering ARQ query to accept non-executed pattern
Dan Davis
2018-11-29 17:51:39 UTC
Permalink
I have a Query Execution Service that returns a QueryExecution that is
within another triple-store, and that other triple store supports some
functions my other graphs do not. Specifically, it is virtuoso, and
supports bif:lower and bif:contains. My intuition is that I need to write
filter functions that allow ARQ to parse these, and then pass these down to
the lower level. However, maybe there is an easier way.

Can you guys please advice what is the easiest/best practice way to do this?

This is not a Virtuoso list, so I will spare you the EXPLAIN output that
convinces me that FILTER(CONTAINS(?something, "word")) never drives the
query, but FILTER(bif:contains(?something, "word")) will drive the query if
there is full text indexing.

Thanks,

-Dan Davis
Andy Seaborne
2018-11-29 18:15:41 UTC
Permalink
bif:contains uses a Virtuoso full text index.

SPARQL's CONTAINS looks for exact substring.
(it is the same as XQuery/XPath fn:contains)
https://www.w3.org/TR/sparql11-query/#func-contains

FILTER(CONTAINS((LCASE(?something), "word")))

or a regex

Andy
Post by Dan Davis
I have a Query Execution Service that returns a QueryExecution that is
within another triple-store, and that other triple store supports some
functions my other graphs do not. Specifically, it is virtuoso, and
supports bif:lower and bif:contains. My intuition is that I need to write
filter functions that allow ARQ to parse these, and then pass these down to
the lower level. However, maybe there is an easier way.
Can you guys please advice what is the easiest/best practice way to do this?
This is not a Virtuoso list, so I will spare you the EXPLAIN output that
convinces me that FILTER(CONTAINS(?something, "word")) never drives the
query, but FILTER(bif:contains(?something, "word")) will drive the query if
there is full text indexing.
Thanks,
-Dan Davis
Rob Vesse
2018-11-30 09:40:47 UTC
Permalink
Assuming you are accessing over HTTP you can create an instance of QueryEngineHTTP directly passing in the query as a string and ARQ won't attempt to parse the query e.g.

QueryExecution qe = new QueryEngineHTTP("http://someserver/query", yourQueryString);

Rob

On 29/11/2018, 17:52, "Dan Davis" <***@gmail.com> wrote:

I have a Query Execution Service that returns a QueryExecution that is
within another triple-store, and that other triple store supports some
functions my other graphs do not. Specifically, it is virtuoso, and
supports bif:lower and bif:contains. My intuition is that I need to write
filter functions that allow ARQ to parse these, and then pass these down to
the lower level. However, maybe there is an easier way.

Can you guys please advice what is the easiest/best practice way to do this?

This is not a Virtuoso list, so I will spare you the EXPLAIN output that
convinces me that FILTER(CONTAINS(?something, "word")) never drives the
query, but FILTER(bif:contains(?something, "word")) will drive the query if
there is full text indexing.

Thanks,

-Dan Davis
Lorenz B.
2018-11-30 11:25:05 UTC
Permalink
Just use angle brackets around the prefixed function, i.e.
 
FILTER(<bif:contains>(?something, "word"))

it should be processed correctly by Virtuoso.
Post by Rob Vesse
Assuming you are accessing over HTTP you can create an instance of QueryEngineHTTP directly passing in the query as a string and ARQ won't attempt to parse the query e.g.
QueryExecution qe = new QueryEngineHTTP("http://someserver/query", yourQueryString);
Rob
I have a Query Execution Service that returns a QueryExecution that is
within another triple-store, and that other triple store supports some
functions my other graphs do not. Specifically, it is virtuoso, and
supports bif:lower and bif:contains. My intuition is that I need to write
filter functions that allow ARQ to parse these, and then pass these down to
the lower level. However, maybe there is an easier way.
Can you guys please advice what is the easiest/best practice way to do this?
This is not a Virtuoso list, so I will spare you the EXPLAIN output that
convinces me that FILTER(CONTAINS(?something, "word")) never drives the
query, but FILTER(bif:contains(?something, "word")) will drive the query if
there is full text indexing.
Thanks,
-Dan Davis
--
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center
Loading...