Skip to content

Instantly share code, notes, and snippets.

@timhodson
Created December 7, 2011 16:22
Show Gist options
  • Save timhodson/1443434 to your computer and use it in GitHub Desktop.
Save timhodson/1443434 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'kasabi'
require 'json'
require 'rdf'
require 'rdf/json'
#Demonstration api key
APIKEY = "YOUR_API_KEY"
dataset = Kasabi::Dataset.new("http://kasabi.com/dataset/nasa", :apikey => APIKEY )
#URI for a resource in this dataset
uri = "http://data.kasabi.com/dataset/nasa/spacecraft/1968-025A"
#Lookup a URI, returns an RDF graph
graph = dataset.lookup_api_client.lookup( uri )
#Output the name (foaf:name properties) of this resource
puts graph.first_literal( [ uri , RDF::FOAF.name ] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment