Skip to content

Instantly share code, notes, and snippets.

@bhuga
Created June 12, 2010 21:47
Show Gist options
  • Save bhuga/436118 to your computer and use it in GitHub Desktop.
Save bhuga/436118 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby1.9
#
$:.unshift('./lib')
require 'linkeddata/repository'
require 'spira'
repo = LinkedData::Repository.new
uri = RDF::URI('http://www.bbc.co.uk/programmes/b00jnwlc#programme')
Spira.add_repository(:default,repo)
module RDF
class PO < RDF::Vocabulary('http://purl.org/ontology/po/') ; end
end
class Brand
include Spira::Resource
type RDF::PO.brand
has_many :series, :predicate => RDF::PO.series, :type => RDF::URI
has_many :episodes, :predicate => RDF::PO.episodes, :type => RDF::URI
end
brand = uri.as(Brand)
puts brand.series.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment