Hi, Sören --

On Jul 14, 2010, at 07:55 AM, Sören Auer wrote:
> For some experiments we plan to run it would be very useful to
> embed an SQL query as a subquery inside a SPARQL query. We want
> to combine relational with RDF data for example in the following
> way:


While not exactly what you're asking for, this may be sufficient for
what you want to achieve --

   <http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsqlfromsparql>

> 16.2.10. Calling SQL from SPARQL
> 

> 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"(...).
> 
> In both cases, the function receives arguments in SQL format ('SQL
> valmode') and also returns the result in SQL format. The SPARQL 
> compiler will automatically add code for format conversion into
> the resulting SQL code so SQL functions can be used even if define 
> output:valmode 'LONG' forces the use of RDF representation in the 
> result set.



Be seeing you,

Ted


--
A: Yes.                      http://www.guckes.net/faq/attribution.html
| Q: Are you sure?
| | A: Because it reverses the logical flow of conversation.
| | | Q: Why is top posting frowned upon?

Ted Thibodeau, Jr.           //               voice +1-781-273-0900 x32
Evangelism & Support         //        mailto:[email protected]
                             //              http://twitter.com/TallTed
OpenLink Software, Inc.      //              http://www.openlinksw.com/
        10 Burlington Mall Road, Suite 265, Burlington MA 01803
                                 http://www.openlinksw.com/weblogs/uda/
OpenLink Blogs              http://www.openlinksw.com/weblogs/virtuoso/
                               http://www.openlinksw.com/blog/~kidehen/
    Universal Data Access and Virtual Database Technology Providers





Reply via email to