[RDF] Wraf and Perl6
Jonas Liljegren
jonas@rit.se
15 Feb 2001 12:06:44 +0100
I'm switching from swedish to english, because this should go to the
Wraf list..
About authenticating the modules used by Perl code:
If it exist in the path, it's trusted. and you have the taintcheck
mode and the seldome used "safe" mode.
You could overload the use() and/or require() to check for a signature
and verifying it. And then there should be some way to tell who you
trust. That is; the diffrence between authentication and
authorization. (As I learned from the Apache architecture.)
About a wrapper module:
That's easy. There is a fun module that automaticly loads a module
then a function is used, even if you didn't required that module. And
with the CPAN module, you could even download and install the missing
module. But then you would have to have a network connection. And
it's not all modules that have a fully automate3d installation. And I
think that some modules expects you to install as root.
Remote execution is another thing. I find some SOAP things:
http://www.soaplite.com/
I haven't decided on how Wraf will do it. But we can have many
interfaces and one of them cold be SOAP.
About abbrevations:
That's now part of the latest CVS version of Wraf.
http://uxn.nu/wraf/RDF-Service/doc/html/abbrevation.html
I used the word 'aliases' for stating that two URIs represent the same
thing.
With abbrevations, every session can set up it's own abbrevations,
that can be used in place of the full URI. This could be done by
importing models with defined namespaces using xmlns.
But for now, I'm using simple one-step declaration of abbrevations.
Example:
$session_res->set_abbrev(
{
fn =3D> NS_LD.'/Property#first_name',
ln =3D> NS_LD.'/Property#last_name',
agent =3D> NS_LS.'#agent',
updated =3D> NS_LS.'#updated',
});
And this allows the abbrevations to be used as method
names. Previously (in 0.0404) we had to write (using Template Toolkit)
for displaying the first and last name of a person:
[% person.arc_obj("${NS_LD}/Property#first_name").li.value %]
[% person.arc_obj("${NS_LD}/Property#last_name").li.value %]
The current (CVS) version has changed this to:
[% person.fn.li.value %]
[% person.ln.li.value %]
The li() part says that we want a single object (list item). And
value() says that we want the scalar (literal) value of that object.
This will later be condensed to:
[% person.fn.value %]
[% person.ln.value %]
I hesitated a bit about how to implement the abbrevations, because it
would introduce yet another step in the dispatching of a method. But
then I came to think that this actually saves the object lookup, that
otherwise would have to be done either by the calling program or in
the called method. Now we look up the abbrevated resource in
advance. (ie, translate the URI to a perl object reference)
And this lookup is only done on the API level (level 0). The internal
code uses the more direct notation.
I'm happy with this. It's a big step towards v0.05. :-)
I also have done some other things to the API. But more about that later.
--=20
jonas@rit.se RIT AB http://www.rit.se
Box 70, 428 21 K=E5llered Bes=F6k: G:a Riksv=E4gen 36
Tel: +46 (0)31 751 8600 Fax: +46 (0)31 751 8609