Hi Ivan, I've played around a bit with function calls within a SPARQL query. I have the following format:
select * from <http://mygraph> where { ?s ?p ?o filter(sql:myfunc(arg1, arg2, arg3)) } myfunc() does some processing on the arguments, calls another function and ultimately returns 1. I'll likely change it to a conditional to return true/false and test against this at a later stage. I'm running into the following problem: Virtuoso 37000 SR001: more than one resultset not supported in a procedure called from exec This is confusing me a little. The only result returned by myfunc is the value '1'. I found a post on the boards: http://boards.openlinksw.com/phpBB3/viewtopic.php?f=12&t=1603 which talks about a similar problem with result sets but I'm not sure how to apply the answers to a filter condition. The sparql select count(*) solution from the post still gives the result set error. Many thanks, Peter Secomb clearbluewater.com.au On 27 October 2011 11:12, Ivan Mikhailov <[email protected]> wrote: > Hello Peter, > > Unfortunately there's no good way to pass the parameters you need. You > may cheat and make your version of cartridge that will use > connection_get() [1] > to obtain connection variable assigned before by connection_set() [2], > but that's not universal and looks bad. > > You may also write your own Virtuoso/PL function that will try to load > data and either return 1 on success or 0/null/error on failure, then add > FILTER (sql:yor_loading_function (any constant arguments)) > to your SPARQL query. The function will be executed before first access > to table with quads because it does not depend from any selected > variables, so the data are in place when the rest of select is starting > its loops. > > [1] http://docs.openlinksw.com/virtuoso/fn_connection_get.html > [2] http://docs.openlinksw.com/virtuoso/fn_connection_set.html > > Best Regards, > > Ivan Mikhailov > OpenLink Software > http://virtuoso.openlinksw.com > > On Tue, 2011-10-25 at 12:51 +1100, Peter Secomb wrote: > > Hi everyone, > > > > I'm still trying to figure out how to supply parameters/options to a > > sparql select > > > > eg: sparql select * from <http://path/csv_file.csv> where > > { ?s ?p ?o } > > > > I can set options in the Sponger cartridge definition via Conductor > > but I really need a way to pass parameters eg to change the column > > delimiter depending on the file. (or to change key/password pairs on > > the fly) > > > > As a work around it's possible to directly update the sponger table to > > set the opts vector, then call the sponger via the sparql select but > > this is far from ideal. > > > > Is there any way to dynamically assign parameters to a sponger > > cartridge through a sparql select call? > > > > Cheers, > > Peter Secomb > > clearbluewater.com.au > > > > On 22 September 2011 16:41, Peter Secomb > > <[email protected]> wrote: > > Hi everyone, > > > > I'm trying to figure out how to supply the opts value (inout > > opts any, defined in sponger hook) as part of a sparql select. > > > > Without the options a sponger call (for instance to csv > > cartridge) can be made as: > > > > sparql select * from <https://some_location/some_file.csv> > > where {?o ?p ?s} > > > > The above works as expected and returns the triples. I've > > modified the csv sponger cartridge to allow non-standard > > delimiters to be specified from the Sponger Cartridge Options > > in the Virtuoso Conductor interface. > > > > How can I specify those options via the above sparl select > > query? > > > > Many thanks, > > Peter > > > > > ------------------------------------------------------------------------------ > > The demand for IT networking professionals continues to grow, and the > > demand for specialized networking skills is growing even more rapidly. > > Take a complimentary Learning@Cisco Self-Assessment and learn > > about Cisco certifications, training, and career opportunities. > > http://p.sf.net/sfu/cisco-dev2dev > > _______________________________________________ Virtuoso-users mailing > list [email protected] > https://lists.sourceforge.net/lists/listinfo/virtuoso-users > > >
