Excel SPARQL OLE DB Provider

The SPARQL OLE DB Provider allows Excel users to query Semantic Web data using SPARQL. All four types of query are supported, and either SPARQL Results or triples are returned to the spreadsheet through standard OLE DB connection. Up to 16 columns of data may be returned, with up to 255 characters per column.

Queries are entered either using the Data Connection Wizard, or by opening a pre-existing Office Data Connection (.ODC) file (see examples below). When you have opened the query and displayed the data, then you can edit the query by right clicking on the table produced, and selecting Table->Edit Query. If you edit the query, you will need to refresh the query afterwards.

This query executed on the DBpedia SPARQL endpoint…

PREFIX owl: <>
PREFIX xsd: <>
PREFIX rdfs: <>
PREFIX rdf: <>
PREFIX foaf: <>
PREFIX dc: <>
PREFIX dbpedia2: <>
PREFIX dbpedia: <>
PREFIX skos: <>
SELECT DISTINCT ?co ?marketCap ?netIncome ?operatingIncome ?revenue
?co dbpedia2:marketCap ?marketCap;
dbpedia2:netIncome ?netIncome;
dbpedia2:operatingIncome ?operatingIncome;
dbpedia2:revenue ?revenue }

…produces this table of results in Excel…


Defining a query

The provider takes two parameters for query

1. Data Source to be queried –

2. The SPARQL query text

Parameter: Data Source

Entered in the OLE DB Data Source name field

General format is <source type>:<source name>


For remote SPARQL queries

sparql-http:<URI of sparql endpoint>

For queries executed on RDF files located on the WWW

url:<URI of RDF file>

For queries executed on local files, in the specified format

xml:<local filename>
n3: <local filename>
ntriples: <local filename>

For queries executed on triples stored in

sqlserver:<table>:<MySQL database connection string>
sqlite: <table>:<MySQL database connection string>
postgresql: <table>:<MySQL database connection string>
mysql: <table>:<MySQL database connection string>

Note: the SemWeb utility “rdfstorage.exe” for loading SQL databases in the necessary format is provided in the application directory

Parameter: SPARQL query

Query text is entered into the OLE DB command field. ASK, CONSTRUCT, DESCRIBE, SELECT queries are all supported. The query is parsed locally to determine its type.

Query Examples

Here are some sample ODC files that query DBpedia

DBpedia 1

DBpedia 2

DBpedia 3

This spreadsheet makes a number of queries on Linked Movie Database and my FOAF file

Spreadsheet Example


You can download the installer here Download

The provider may require installation of .NET Framework 3.5 if not already installed on the target machine.

If you find any problems, or have any other feedback then please drop me a line at


The provider is currently offered for test and evaluation purposes only, without warranty of any kind. The provider is implemented on top of the SemWeb .NET library by Joshua Tauberer ( and subject to the relevant licences of that library.

© 2009 Sixhills Consulting Ltd