Shared publicly  - 
How to get data into a Google Spreadsheet via SPARQL. Note, you can't pull this off via ODBC, JDBC, ADO.NET etc.. Exactly why Linked Data is an utterly superior option for real Open Data Access.

1. -- SPARQL Protocol URL (Results) in CSV format

2. -- SPARQL Protocol URL (Actual Query Editor with Query)

3. -- Google Spreadsheet with data loaded directly from DBpedia via SPARQL Protocol URL.

The formula used in my Google Spreadsheet:


Live specimen that you can paste into any Google Spreadsheet cell:



1. -- post by +Danny Ayers that triggered this incarnation of the SPARQL to Google Spreadsheet demo .

2. -- earlier post about Linked Data and why it trumps ODBC, JDBC, ADO.NET, JDO, OLE-DB etc..

3. -- circa. 2008 post about the same matter via +Dan Brickley post .

#SPARQL #LinkedData #SemanticWeb #NoSQL #CoRelational #CoSQL #SPARQL
Michael Hausenblas's profile photoOnyx Liton's profile photoDan Brickley's profile photoM. Scott Marshall's profile photo
Funny you should mention. I recently did the same thing from Google spreadsheet side, using App Script to integrate results from any SPARQL endpoint. Submitted it to gallery but I think their approval system is borken ;) ... just glad that I gisted it at /CC: +Danny Ayers 
+Michael Hausenblas -- so do you have an extension for Google Spreadsheet itself? Right now, I am simply using an existing Import function to process SPARQL URLs which is much more flexible than anything I could achieve via ODBC and Excel, many moons ago.

My current pattern is 100% cut and paste, zero programming :-)
Yes, +Kingsley Idehen it is a Google Apps Script [1] that can be directly called from any Google spreadsheet. Just got to Tools -> Script Editor and paste in stuff. As I said, unfortunately their script gallery thing is either sloooooow or borken, otherwise I could just point you to the respective published spreadsheet and you could test it live w/o hacking ;)

+Kingsley Idehen ... are you using HTML tables importer? I found that worked well with desktop tools. Seems like every SPARQL endpoint ought to offer HTML tables 'standard' output, alongside the other expected flavours...
+Dan Brickley -- Yes. Just click on the first cell of my published spreadsheets to see the formula in use.
this (of course) also works in libre office :
1. choose a table cell
2. from the menu choose "insert" => "link to external data"
3. in the popup paste the dbpedia-sparql-url from above and hit "enter"
4. take a sip of coffee (optional)
5. choose a language from the popup
6. from available tables/ranges choose "HTML_tables"
7. click "ok"
8. finish coffee (optional)
+juergen jakobitsch -- yes, anything that can process an HTTP URL :-) This is why URIs are the ultimate Data Source Names (DSNs). They take us from Open Database Connectivity (ODBC, JDBC etc..) to Open Data Connectivity.

My focus on Google Spreadsheet boils down to the fact that they offer a Webby Spreadsheet. Microsoft, on the other hand, still doesn't quite get the Webby stuff and its application to office. Once they do, it will be tough for Google since Microsoft already understand ODBC + Productivity Tools :-)
+Michael Hausenblas -- Doesn't Google Spreadsheet API let you work with Named Cell Ranges? I've checked their API and don't see such a method. Anyway, since you are more familiar with this, could you have your script work with Named Cells instead of Cell Addresses? You end up with the same reference fidelity oriented benefits of Linked Data albeit within the confines of a spreadsheet. This will enable users named cells for :

2. SPARQL Endpoint
3. SPARQL Results.

Of course, if you can't setCellRangeName none of this is feasible. Thus, my fingers are crossed as we get yet another two-fer here:

1. Cleaner handling of SPARQL integration

2. Tutorial material re. Linked Data concepts via easy showcase for implications of Cell Names and Cell Addresses re. referencing spreadsheet data.

The above == httpRange14 in a spreadsheet cell :-)
Sure, will look into that and try to realise it on upcoming GAS hackday next Tue 13 Mar and will keep you posted. Very good direction, thanks!
Add a comment...