[Haskell-cafe] ANN: hsparql, a SPARQL query generator/DSL and client

I'm excited to announce the first version of hsparql. HSparql makes it easy to query SPARQL-compliant servers using a relatively intuitive DSL and very simple client. SPARQL is a SQL-ish query language for stores of RDF data. So, SPARQL lets you search the structured data in several big databases. I wrote it so that I could search DBpedia [1], a neat site that pulls structured data from Wikipedia's infoboxes, and also ties it to remote data services like MusicBrainz and US Census information. HSparql isn't tied to DBpedia in any way, though, and can search any server. The DSL looks something like this:
simple :: Query [Variable] simple = do resource <- prefix (iriRef "http://dbpedia.org/resource/") dbpprop <- prefix (iriRef "http://dbpedia.org/property/") foaf <- prefix (iriRef "http://xmlns.com/foaf/0.1/")
x <- var name <- var page <- var
triple x (dbpprop .:. "genre") (resource .:. "Web_browser")
triple x (foaf .:. "name") name triple x (foaf .:. "page") page
return [name, page]
It's currently available on Hackage [2], and at the moment the source is only available from the tarball hosted there. I'd greatly appreciate any feedback on this package. Thanks! Jeff Wheeler [1] http://dbpedia.org/ [2] http://hackage.haskell.org/package/hsparql

Excerpts from Jeff Wheeler's message of Thu Jul 09 00:27:51 +0200 2009:
I'm excited to announce the first version of hsparql. HSparql makes it easy to query SPARQL-compliant servers using a relatively intuitive DSL and very simple client.
I've looked at your DSL and it looks really neat. While reading I was wondering if GADTs could help having an even nicer query language. -- Nicolas Pouillard http://nicolaspouillard.fr

On Thu, Jul 9, 2009 at 4:34 AM, Nicolas
Pouillard
I've looked at your DSL and it looks really neat. While reading I was wondering if GADTs could help having an even nicer query language.
To be honest, I really only know the name GADT, I don't really know anything about them. I guess I have a good excuse to go learn them, though, now. :) Jeff Wheeler
participants (2)
-
Jeff Wheeler
-
Nicolas Pouillard