W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > January 2011

Spira - Collections

From: Stephen Pope <stephen.pope@eduserv.org.uk>
Date: Thu, 6 Jan 2011 10:00:09 +0000
Message-ID: <4D2592A9.2080206@eduserv.org.uk>
To: <public-rdf-ruby@w3.org>
Hi all,

I am using Spira to process ordanance survey RDF data and I had a quick 
question about collections..

I have defined a simple class for my test .. but :touches has 4 
references .. currently this code just returns the first URI .. is there 
a way or concept of a collection within the Spira object so it would 
return all 4 URI's as an array ?

Hope that makes sense. This is a really great way for creating and 
processing RDF.

Regards

Stephen

-----------------------

class OsArea
   include Spira::Resource

   base_uri "http://data.ordnancesurvey.co.uk/id"

   property :id, :predicate =>  
RDF::URI("http://data.ordnancesurvey.co.uk/ontology/admingeo/hasUnitID"), :type 
=> Integer
   property :label, :predicate => RDFS.label, :type => String
   property :preflabel, :predicate => SKOS.prefLabel, :type => String
   property :touches, :predicate => 
RDF::URI("http://data.ordnancesurvey.co.uk/ontology/spatialrelations/touches"), 
:type => String

end

repo = 
RDF::Repository.load("http://data.ordnancesurvey.co.uk/doc/7000000000011103.rdf")
Spira.add_repository(:default, repo)

area = 
OsArea.for(RDF::URI.new('http://data.ordnancesurvey.co.uk/id/7000000000011103'))
puts area.id
puts area.label
puts area.preflabel
puts area.touches

-----------------------
Received on Thursday, 6 January 2011 11:42:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 6 January 2011 11:42:26 GMT