Hi William,

If pyodbc is the interface being used then it would need to be extended to 
support these calls. 

The ODBC SQLGetInfo(SQL_DBMS_NAME,...) function can be used to determine the 
database being connected to is Virtuoso:

                                SQLGetInfo:
                                In:                             
ConnectionHandle = 0x003C1720, InfoType = SQL_DBMS_NAME=17, 
                                                                                
InfoValuePtr = 0x00169258, BufferLength = 300, StringLengthPtr = 0x00165790, 
                                                                                
Information Value Type = SQL_C_CHAR=1
                                Return: SQL_SUCCESS=0
                                Out:                    *InfoValuePtr = 
"OpenLink Virtuoso", *StringLengthPtr = 17

SPASQL is simply the ability to execute SPARQL queries via a SQL interface like 
ODBC, JDBC, ADO.Net etc. so once you have determine the database to be Virtuoso 
with the above call any SPARQL query passed prepended with the keyword "sparql" 
is SPASQL ...

Best Regards
Hugh Williams
Professional Services
OpenLink Software
Web: http://www.openlinksw.com
Support: http://support.openlinksw.com
Forums: http://boards.openlinksw.com/support
Twitter: http://twitter.com/OpenLink

On 18 Sep 2010, at 17:40, William Waites wrote:

> On 10-09-18 17:00, Hugh Williams wrote:
>> 
>> Have you looked at the Virtuoso ODBC extensions for SPASQL,
>> which enable applications to query meta information on SPASQL
>> queries, as detailed at:
> 
> Hi Hugh, that's helpful, thank you. Unfortunately not
> as straightforward as I would have liked - it looks
> like it would require extending pyodbc since it doesn't
> expose things like SQLGetDescField to python.
> 
> To complicate matters, when you have a row in Python
> it won't have any reference to the cursor (or statement
> handle), apparently this design decision was made so
> that you could keep a row around while the cursor
> was closed or reused for another query. So to do this,
> one would have to (1) check that the database is Virtuoso,
> (2) check that the query was SPASQL (3) pre-emptively
> go and collect type information before returning each
> row.
> 
> Is there a straightforward way to do (1) and (2) at all?
> 
> More C++ coding than I'd like (pyodbc is written in C++)
> but not the end of the world...
> 
> Cheers,
> -w
> -- 
> William Waites                       <[email protected]>
> Mob: +44 789 798 9965
> Fax: +44 131 464 4948
> CD70 0498 8AE4 36EA 1CD7  281C 427A 3F36 2130 E9F5
> 


Reply via email to