Created
June 12, 2010 21:47
-
-
Save bhuga/436118 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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