TempleScript: Subject Locator Patterns

Obviously I managed to send CatBert back into deep depression (he saw that coming, trust me).
While he sleeps in his favourite armchair, I can steal back my ideas and tuck them safely away into an academic paper. So maybe another RDFascist can entertain me with a negative review. As if a man with a vision would care.

Locator Patterns

Among the things I want to add to TempleScript are subject locator patterns. Here is the use case:

myapp isa web:application = http://my.app.com/

employee isa web:page
   = myapp:employee     # there the page is hosted
 return
     $id / *            # return all properties

According to CatBert I would have to invoke this web page (called a congregator in TempleScript) via

http://my.app.com/employee?$id=drrho

That is not wrong per se, but much prettier would be:

http://my.app.com/employee/drrho

http://my.app.com/employee/catbert

To achieve that, I simply allow to write

employee isa web:page
   = myapp:employee/(?<id>\w+)
 return
     $id / *

using captured buffers as in Perl 5.10 regular expressions. Analogous to Catalyst and many other MVC frameworks the controller employee now can intercept not only a single URL, but a whole family. A URI family as defined by the regular expression.

Virtual Ontology

This is not just a programming convenience; it makes it also clear that the totality of URIs I specify with these regular expression defines a new namespace of "things". A set of things which can be interpreted as ... topic map.

So in the above case

http://my.app.com/employee/drrho

http://my.app.com/employee/catbert

would both be subject identifiers standing for the subjects in question.

In this sense, every web:page, and consequently every web:application conveys a new topic map. A virtual one, of course.

Further I am entitled to assert:

web:application subclasses virtual-ontology,
      which subclasses ontology .

In this sense, a TempleScript web application is also a transformer: On the incoming side there are the subject locations for the web:pages, on the outgoing side the subject identifiers for the things generated.

And that has a couple of implications.

Posted In