cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: XLinks & LinkBase
Date Tue, 03 Oct 2000 14:13:05 GMT
Jeremy Quinn wrote:
> Hi All,
> A while ago some Belgian guys released an XLink Processor for C1.
> I have not actually made it work yet, it's based on Java 2 :(
> I have been looking at this recently, it could help solve a tricky set of
> problems I have with a new site I have in mind.
> The system basically allows you to have a "LinkBase" file which stores
> XLinks and XLink "arcs" which define all the links in your site, which is
> processed at runtime (caching in your session) placing all relevant links
> into your document, to be sorted out by XSL.
> What I'd like to know, is what future does this type of system have in
> Cocoon 2?

This is a very interesting question. XLink is clearly a heavy
specification and the way I used it for the CLI was nothing more than
catching all the locations so that the crawler knows where to go next.

The crawler doesn't need to know anything more... things like title,
action, role and such are made for the client side and for this reason
they are ignored.

What you are talking about here is something different, if I understand,
we might want to call it "link delegation": instead of having an
hardwired chain of links, you delegate the link creation at an external
source that reacts on enviornmente parameters.

This is a very interesting concept indeed.

But I'm afraid this might well be flexibility syndrome... let me explain

In a famous paper by Tim Berners-Lee, URIs are separated in two groups:
names and addresses. Some believe that URN are names and URL are
addresses, but this is not correct.

For example, is

a name or an address? it's an address, but what about

it's much more name, but still address.

TBL himself tells there is no clear distinction between addresses and
names, but a good decription of a good URI is 'the one that doesn't
change over time'.

So would you use "" as a
namespace URI? of course not, why?

 - it may change format (so the extension is *always* wrong in
 - it may change virtual host


 - it may change project name
 - it may change domain
 - it may change protocol 

but these are much less likely to happen...

interesting enough, the most stable part of the URI is "index" since
once decided it can remain there almost forever given the low amount of
interaction with the rest of the URI.

So, the best URI for the above resource is

but this can be used only for unrevisioned resources.

The W3C adopts a URI schema for their namespaces that uses dates.... I
personally believe this to be a mistake, but indeed a minor one compared
to other URI spaces I've seen.

For versioned resource, the URI should be something like[project]/[resource]/[version]

for example


which, can be used "both" as names and addresses (even if TBL is against
such a thing) I think this is useful because it allows, in case of
schemas, to obtain the schema from the URI directly... also, using the
version "latest" one should be able to obtain the latest version of the

Ok, now let's go back to "link delegation", this is more or less what
the W3C does with their URIs: what is the URI of XLink 1.0? If I don't
know the year of its creation, I have no clue... I have to look it up.

The above LinkBase enhances this: what is the address of the name
"/next-screen" if I'm resource "/login" and the user has logged in?

I honestly believe the above is very HARMFUL, this is why I don't like
Turbine and equivalent systems: their URI space is too delegated, it's
indeed flexible, but it's impossible for users to connect to a specific
resource without going to the portal and then go the appropriate

A web of turbines is a nightmare for search engines... it's the dead of
the (yet to be created) semantic web.

C2 uses a sitemap instead: link delegation is *never* done. Why? to
enforce SoC!

You need solid contracts to parallelize development... link delegation
breaks this... even W3C will face the need for such a link translation
in the future when people won't recall if the first XLink spec was 1999
or 2000... or why the 1999/xlink has actually a release date of 2000.

URI must be meaningful, consistent and guessable.

W3C should be the one that shows the way... but their URI space is yes,
meaningful, but inconsistent (look at the RDF namespace, please!) and
not guessable (how the hell do I know what year was used to create
version X.Y of the ZZZ spec?)

Link indirection appears cool at first because allows you to recompose
your web resources at will without having to touch anything, but this is
BAD! You should go thru the pains of hell to modify even a simple link
to your logo! so, forget about

 <img src="images/cocoon.gif"/>

but welcome

 <img src="images/logo"/>

which is future-compatible and portable for other projects!

Since it's hard to distinguish between names and addresses, the sitemap
forces you to think at names that are *both* good names and valid
addresses and gives you the flexibility to perform all this without
requiring anything else.

(yes, C2 with actions does replace Turbine functionality completely...
we just need a WebMacroGenerator (if you really care) and few Avalon
blocks underneath and we're done).

> By the look of Stefano's fantastic work on C2's CLI, XLinks are going to be
> heavily used in C2, will the concept of a LinkBase fit into this picture?

In theory, there is no technological limitation for link indirection....
you could easily write your LinkLookupTranslator that connectst to a
LinkBase to perform link translation... but would *highly* discouradge
anybody from using it.

Think about this: good programming practices cristallize into design
patterns.... are there any design patterns for URI spaces? No...
everybody reinvents the wheel every day. 

Here is even worse, you are giving them the ability to reinvent the
wheel without even having to touch the files: something like this is
like asking for broken links all over the place.

Consider Ant build files: they are free form, you can do almost anything
you want...but almost all projects that use Ant use more or less the
same design patterns for their build systems and the same target

I forecast the exact same thing for sitemaps.

Also, I'll make sure I write a big paper describing a bunch of design
patterns for URI spaces quoting all the relevant information from TBL
and Nielsen (of fame)

But I might be missing the picture entirely... who knows.. anyway, one
thing is for sure: having hard URIs does less harm than having soft

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message