[Activerdf] How do I test for class?

Eyal Oren eyal.oren at deri.org
Thu Oct 12 17:30:01 IST 2006


abd shorter than instance_of? is by the way:
a.is_a?  or
a.kind_of?

(first is an alias for instance_of, second also tests superclass
membership, see ruby api for ore info; both should work in activerdf)

greetz from france...

On 12/10/06, Knud Hinnerk Möller <knud.moeller at deri.org> wrote:
> Ok, thanks to Sebastian I found out that I can do:
>
> event.class.member?(ESWC::Talkevent) or
> event.instance_of?(ESWC::Talkevent)
>
> What doesn't work is:
>
> event.type == ESWC::Talkevent
> event.type.member?(ESWC::Talkevent)
> event.kind_of?(ESWC::Talkevent)
>
> Somehow it would be nice if I could simpy traverse the RDF-graph by asking
>
> event.type
>
> and get back an array.
>
> Cheers,
> Knud
>
>
> Am 12.10.2006 um 16:21 schrieb Knud Hinnerk Möller:
>
> Hi,
>
> how, in ActiveRDF, do I test if an object is an instance of a certain class?
> I have an object "event", and now I want to do something if event isa
> iswc:TalkEvent, and something else if it isn't. How do I do that?
>
> Cheers,
> Knud
>
> -------------------------------------------------
> Knud Möller, MA
> +353 - 91 - 495086
> Digital Enterprise Research Institute
>   National University of Ireland, Galway
> Institiúid Taighde na Fiontraíochta Digití
>   Ollscoil na hÉireann, Gaillimh
>
> _______________________________________________
> Activerdf mailing list
> Activerdf at lists.deri.org
> http://lists.deri.org/mailman/listinfo/activerdf
>
>
> -------------------------------------------------
>
> Knud Möller, MA
>
> +353 - 91 - 495086
>
> Digital Enterprise Research Institute
>
>   National University of Ireland, Galway
>
> Institiúid Taighde na Fiontraíochta Digití
>
>   Ollscoil na hÉireann, Gaillimh
>
>
> _______________________________________________
> Activerdf mailing list
> Activerdf at lists.deri.org
> http://lists.deri.org/mailman/listinfo/activerdf
>
>
>


More information about the Activerdf mailing list