SV: [RDF] Usage with TT2

Stefan Andersson Stefan.Andersson@ullmans.com
Thu, 21 Sep 2000 08:31:01 +0200


Damn cool!
/Stefan

> I have started on a prototype program for implementing a simple person
> register using Template Toolkit 2.
> 
> This is TT2 code for listing all propertis/values for a specific
> resource. 
> 
> * "Desig" is a method to get the best availible designation of the
> resource. That would be the literal value, the label, the uri minus
> some specific namespace or just the whole uri.
> 
> * The "${NS_L}" thing is a reference to the local namespace.
> 
> * The s object is the "session" (Service) object.
> 
> 
> 
> [% subj = s.get_node("${NS_L}#S1") %]
> 
> <h1>And here is [% subj.desig %]</h1>
> 
> <ul>
> [% FOREACH prop = subj.get_props_list %]
>   <li>[% prop.desig %]: [% subj.get_objects_list(prop).0.desig %]
> [% END %]
> </ul>