HI Michael,

While requesting Virtuoso with SPARQL via odbc (with a PHP script), we have some problems with the received format of the resultset. Without defining a result-format and with the use of the procedure DB.DBA.SPARQL_EVAL we get a odbc_resultset, which isn't really usable for us. We can fetch it into a list of objects for instance, but literals are received without language or datatype definitions. (With defining the result-format as RDF/XML, these definitions are included, but this received data structure must be parsed and wrapped in an other adequate data structure). Is there another possibility to get a complex object like an RDF-Box, a table (with included datatype or language definitions) or something else?

We have added some extensions to our virtuoso ODBC driver to get this information using the SQLGetDescField function. We are currently in the process of writing some documentation and samples to show this in more details, but here are the defines in case you want to experiment.


/******************* Virtuoso ODBC Extensions *******************/

/*
 *  ODBC extensions for SQLGetDescField
 */
#define SQL_DESC_COL_DV_TYPE            1057L
#define SQL_DESC_COL_DT_DT_TYPE         1058L
#define SQL_DESC_COL_LITERAL_ATTR       1059L
#define SQL_DESC_COL_BOX_FLAGS          1060L
#define SQL_DESC_COL_LITERAL_LANG       1061L
#define SQL_DESC_COL_LITERAL_TYPE       1062L


/*
 *  Virtuoso - ODBC SQL_DESC_COL_DV_TYPE
 */
#define VIRTUOSO_DV_DATE                129
#define VIRTUOSO_DV_DATETIME            211
#define VIRTUOSO_DV_DOUBLE_FLOAT        191
#define VIRTUOSO_DV_IRI_ID              243
#define VIRTUOSO_DV_LONG_INT            189
#define VIRTUOSO_DV_NUMERIC             219
#define VIRTUOSO_DV_RDF                 246
#define VIRTUOSO_DV_SINGLE_FLOAT        190
#define VIRTUOSO_DV_STRING              182
#define VIRTUOSO_DV_TIME                210
#define VIRTUOSO_DV_TIMESTAMP           128
#define VIRTUOSO_DV_TIMESTAMP_OBJ       208


/*
 *  Virtuoso - ODBC SQL_DESC_COL_DT_DT_TYPE
 */
#define VIRTUOSO_DT_TYPE_DATETIME       1
#define VIRTUOSO_DT_TYPE_DATE           2
#define VIRTUOSO_DT_TYPE_TIME           3



Patrick

Reply via email to