[Activerdf] How do I test for class?

Knud Hinnerk Möller knud.moeller at deri.org
Thu Oct 12 16:39:17 IST 2006


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.deri.org/pipermail/activerdf/attachments/20061012/84944ee1/attachment.htm


More information about the Activerdf mailing list