- From: Ben Lavender <blavender@gmail.com>
- Date: Fri, 24 Sep 2010 17:12:03 -0500
- To: Dominic Sisneros <dsisnero@gmail.com>
- Cc: public-rdf-ruby@w3.org
You can see how to make types based on the existing ones in lib/spira/types. Basically, you need class methods .unserialize, that turns RDF into ruby, and. serialize, which turns ruby into RDF. See also the Yardocs for Spira::Type, which is a module you can include in any class to provide some helpers for registering type aliases and the like. You may not need to do anything, though. I have an open ticket and am working with arto to do some automagic with RDF::Literal for all of the XSD types. Further, the Spira::Types::Any type will just let RDF::Literal try to figure things out, and RDF::Literal already supports xsd dates. Try not specifying a type at all, and it may Just Work. Ben (please cc the list so google finds this stuff eventually) On Fri, Sep 24, 2010 at 5:05 PM, Dominic Sisneros <dsisnero@gmail.com> wrote: > > >> >> >> The only way I can produce this error is if you declare Person after >> Project, and add the following property to Person: >> >> property :assigned_to, :predicate => PM.assignedTo, :type => Project >> >> (declaring Person first, this will get you an 'unknown constant' error >> instead of the error you show). >> >> So your problem is not self-referencing. Try replacing any constants >> you have for referencing relation classes with symbols. >> >> A script demonstrating a self-referencing project is below. > > Thanks, > replacing constants with symbols as below worked. Can you explain more > about how to convert types to serialize and deserialize. I am going > to look at soap4r and try to get some of the xsd:date and xsd:datetime > working. > thanks >
Received on Friday, 24 September 2010 22:12:56 UTC