Luis Galárraga
Luis Galárraga

Reputation: 117

User-defined SPARQL aggregation functions in Virtuoso

I want to implement a user-defined boolean aggregation function in SPARQL and I am checking whether how easy/feasible is this in different SPARQL engines. In regards to Virtuoso, is it possible? If so, where could I find further information about it? By googling I found how to do it for SQL but not for SPARQL: http://docs.openlinksw.com/virtuoso/aggregates/

Thanks your attention and help, Luis

Upvotes: 3

Views: 206

Answers (1)

TallTed
TallTed

Reputation: 9434

You're more than halfway there.

Virtuoso lets you use SQL functions, both built-in (bif:) and user-defined (sql:), within SPARQL queries, as discussed in the documentation:

A SPARQL expression can contain calls to Virtuoso/PL functions and built-in SQL functions in both the WHERE clause and in the result set. Two namespace prefixes, bif and sql are reserved for these purposes. When a function name starts with the bif: namespace prefix, the rest of the name is treated as the name of a SQL BIF (Built-In Function). When a function name starts with the sql: namespace prefix, the rest of the name is treated as the name of a Virtuoso/PL function owned by DBA with database qualifier DB, e.g., sql:example(...) is converted into DB.DBA."example"(...).

ObDisclaimer: OpenLink Software produces Virtuoso, and employs me.

Upvotes: 3

Related Questions