[RDF] Usage with TT2
Jonas Liljegren
jonas@liljegren.org
20 Sep 2000 19:37:43 +0200
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>
--
/ Jonas - http://jonas.liljegren.org/myself/en/index.html