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



Reply via email to