Custom SPARQL Aggregation Functions in Virtuoso
I want to implement a custom boolean aggregation function in SPARQL and I am checking how easy / possible it is in different SPARQL engines. As for Virtuoso, is it possible? If so, where can I find more information on this? By googling I found how to do this for SQL but not SPARQL: http://docs.openlinksw.com/virtuoso/aggregates/
Thanks for your attention and help, Luis
source to share
You're more than halfway there.
Virtuoso allows you to use SQL functions, both inline ( bif:
) and custom ( sql:
), in SPARQL queries, as discussed in the documentation :
A
SPARQL
expression can contain Virtuoso / PL function calls and built-in SQL functions in both the clauseWHERE
and the result set. There are two namespace prefixes reserved for this purpose,bif
andsql
. When a function name begins with a namespace prefixbif:
, the rest of the name is treated as a SQL BIF (Inline Function) name. When a function name begins with a namespace prefixsql:
, the rest of the name is treated as the name of a Virtuoso / PL function ownedDBA
with a database classifierDB
, for example,sql:example(...)
converted toDB.DBA."example"(...)
.
ObDisclaimer: OpenLink Software produces Virtuoso , and uses me.
source to share