Pierre, In order to access to SQL data via SPARQL you should create RDF Views first, then query mapped data as if they're usual RDF quads. There's no other way. Probably, we will never add an ability of calling SQL from SPARQL because that will cause problems similar to inlining of assembler fragments into C++.
In some case you can write the query by placing SPARQL inside SQL instead of placing SQL inside SPARQL. Best Regards, Ivan Mikhailov OpenLink Software. On Wed, 2008-02-06 at 18:48 +0100, Pierre De Wilde wrote: > OK, so it's possible to invoke SQL from SPARQL. Great. > But how to get the result back to SPARQL? > > > For example, I want to fetch the list of registered namespaces (SELECT > * from RDF_PREFIX). > How can I get this list back to a SPARQL endpoint? Thanks beforehand. > > > Pierre > > > 2008/2/6, Tim Haynes <tim.hay...@openlinksw.co.uk>: > Pierre De Wilde wrote: > > Hi, > > It seems possible to call SQL from SPARQL as referenced in > doc 'Calling SQL > > from SPARQL' (ยง15.2.5). > > Have you some examples? Is it possible to call statements > > like backup_online('backup_#', 10000); from a SPARQL > endpoint? > > > > Well, I can give you a different example off the top of my > head: > > create procedure db.dba.removegraphsmatching (in pattern > varchar) { > declare r1, r2 integer; > r1:=(select count(*) from db.dba.rdf_quad where id_to_iri > (G) like pattern); > delete from db.dba.rdf_quad where id_to_iri (G) like > pattern; > r2:=(select count(*) from db.dba.rdf_quad where id_to_iri > (G) like pattern); > return r1-r2; > }; > > sparql select ?g ?s ?p ?o WHERE { > GRAPH ?g { ?s ?p ?o . } > filter sql:removegraphsmatching ( 'pattern%' ) }; > > The important thing to note is that the stored procedure in > question must > be in the db.dba schema/space. > > Shouldn't be hard to make the sp do something less > destructive :) > > HTH, > > ~Tim > -- > Tim Haynes > OpenLink Software > <http://www.openlinksw.com/> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ Virtuoso-users mailing list > Virtuoso-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/virtuoso-users