W3C home > Mailing lists > Public > public-lod@w3.org > September 2008

Re: Querying dbpedia from the command line?

From: Bob DuCharme <bob@snee.com>
Date: Wed, 17 Sep 2008 21:48:19 -0400
Message-ID: <48D1B363.9050208@snee.com>
To: Richard Cyganiak <richard@cyganiak.de>
CC: public-lod@w3.org

Richard Cyganiak wrote:
 > I'm not sure if it works on every SPARQL endpoint, but try this:
 >
 > curl -F 'query=SELECT * WHERE { ?s ?p ?o } LIMIT 3'
 > http://dbpedia.org/sparql
 >
 > The key is using curl's -F parameter (which takes a key-value pair and
 > urlencodes the value), and putting the 'query=...' part into quotes.

Bingo! As written, this query didn't work in Windows and did in Linux, 
but when I changed the the single quotes to double quotes, it worked in 
Windows both from the command line and from a batch file. It's also 
great because it's so much terser and more readable than all the escaped 
versions.

As a side note, I think this is going to be very big, because while 
Linked Data (and much of the semantic web) is theoretically about 
exposing data to programs instead of to eyeballs like the traditional 
web, most of the linked data and semantic web demos I see out there are 
about visual browsing of linked data--displaying it to eyeballs. When we 
can grab the results of a linked data SPARQL query with a script, then 
we can really start doing new and interesting things with it.

Bob
Received on Thursday, 18 September 2008 01:47:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:41:27 GMT