W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > September 2010

Re: spira modeling

From: Ben Lavender <blavender@gmail.com>
Date: Fri, 24 Sep 2010 17:12:03 -0500
Message-ID: <AANLkTiny=v12qDk2FmihujN3gu-ziY+7i2ZQmFLCOYmS@mail.gmail.com>
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

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


(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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:53:40 UTC