Home > SparqlTransmission

SparqlTransmission

SparqlTransmission is a project mainly written in Ruby, it's free.

Ruby class to wrap SPARQL request to a SPARQL end-point and handle the response in a nice, ruby fashion

h1. SparqlTransmission for Ruby

SparqlTransmission is a ruby library that handles the transmission of your SPARQL query to a SPARQL end-point, such as DBpedia (http://dbpedia.org/sparql), and format the response nicely so you can use it in your code.

h2. Installing

You can install the latest SparqlTransmission gem

gem install SparqlTransmission

h2. How to use

First, create a SparqlTransmission object with the URL of the end-point you'd like to query

require 'SparqlTransmission' st = SparqlTransmission.new('http://dbpedia.org/sparql')

Now enter your query

st.query = %[ SELECT ?subject ?predicat ?object WHERE { ?subject ?predicat ?object } ]

You can now iterate over your results and print them

st.execute_query.results.each do |res| puts res end

h2. Contribute

I'd be very happy to hear what you think about the library. Contact me at mikaa123 at gmail.com. Please feel free to fork the project and contribute. :-)

Michael

Previous:zen