[pmwiki-users] hierarchical groups, revisited

Joachim Durchholz jo at durchholz.org
Thu May 25 15:41:51 CDT 2006


Patrick R. Michaud schrieb:
> On Thu, May 25, 2006 at 02:52:17PM +0200, Joachim Durchholz wrote:
>>> But let's go back to the original example of a "relative link" --
>>> [[Canine/StBernard]].  In fact, let's just look at a link called
>>> [[Canine]] from within the Animal.Canine.Beagle page.  If 
>>> we _strictly_ follow the pattern above, then [[Canine]] within
>>> the Animal.Canine.Beagle page ought to link to Animal.Canine.Canine.
>> So the link is wrong. Borrowing from filesystem path syntax, the link to 
>> the parent category would have to be written as [[..]].
> 
> "Parent category"?  Beagle is in the Animal.Canine group.  I'm
> trying to link to the "home of the current group".  Using [[..]]
> to mean "current group's home" seems totally wrong.

But it's totally correct, because Beagle is (potentially) a group page, too.

>>> And [[Canine/StBernard]] looks just like [[Terrier/Fox]] (which is 
>>> Fox within the Terrier subgroup of the current Animal.Canine group), 
>>> so that would indicate that [[Canine/StBernard]] is StBernard 
>>> within the Canine subgroup of the current group, or
>>> Animal.Canine.Canine.StBernard.  Oops.
>> Again, the link is wrong. It's using the relative link 
>> [[Canine/StBernard]] where an absolute link such as 
>> [[/Canine/StBernard]] was actually meant.
> 
> Er, the absolute link would actually be [[/Animal/Canine/StBernard]].

Correct. Somehow I had assumed that Canine is a toplevel group.

> How would I make a relative link from Animal.Canine.Beagle to
> Animal.Feline.Siamese?

[[../../Canine/StBernard]].

(Not that making such a link relative is a very good idea in general, 
neither in file systems nor in a wiki.)

>>> In other words, we have these pages:
>>>
>>>     Animal
>>>     Animal.Canine
>>>     Animal.Canine.Terrier
>>>     Animal.Canine.Bulldog
>>>
>>> Okay, follow carefully:
>>>    Q: What's the "home page" for canines?  
>>>    A: Animal.Canine
>>>
>>>    Q: What group is Animal.Canine in?
>>>    A: Animal
>>>
>>>    Q: How does one link from the home page for canines (Animal.Canine)
>>>       to one of the canine pages such as Terrier or Bulldog?
>> A: [[./Terrier]] and [[./Bulldog]].
>> (As you say, [[Terrier]] and [[Bulldog]] would be wrong, as these would 
>> refer to the "sibling pages" Animal.Terrier and Animal.Bulldog.)
> 
> To summarize what I think you're saying above:
> 
>  - sibling: to go from Animal.Canine.Beagle to Animal.Canine.Terrier, 
>    use [[Terrier]]
>  - parent: to go from Animal.Canine.Beagle to Animal.Canine, use [[..]]
>  - uncle: to go from Animal.Canine.Beagle to Animal.Feline, use [[../Feline]]
>  - child: to go from Animal.Canine to Animal.Canine.Terrier, use [[./Terrier]]

That's what I meant.

Actually the "correct" way for going from Animal.Canine to 
Animal.Canine.Terrier would be [[Canine/Terrier]]. Here are the 
analogies that hint in the direction:
Going from Animal.Canine to Animal.Feline: [[Feline]].
Going from Animal.Canine to Animal.Feline.Housecat: [[Feline.Housecat]].
Going from Animal.Canine to Animal.Canine.Terrier: [[Canine.Terrier]].

> Note that this last one is quite contradictory to what people
> expect from dealing with filesystems and urls.  For example, if
> I have a web page at "/foo/bar", and that page contains a link
> to "./xyz", then the link targets "/foo/xyz" and not "/foo/bar/xyz".
> In other words, in filesystems and urls, "./xyz" is a sibling link
> and not a child link.

Yes, but that's a consequence of a file being a directory at the same time.
The confusion is this: if an entity is both a directory and a file, 
what's it's "current directory"?
If it's the entity itself, then ./xyz is the xyz object one level down.
If it's the entity's parent directory, then ./xyz is a sibling object.

However, I have abused the ./xyz terminology for a slightly different 
purpose than what it's usually used for. So it's probably not a good syntax.

>> I'd suggest a format like this:
>>
>> Absolute link:   <example of an absolute link>
>> Link to parent:  <example for a link to the parent group page>
>> Link to sibling: <syntax for a link to a page in the same group>
>> Link to child:   <syntax for a link to a page in the subgroup>
> 
> I like this discussion format very much.  But if we're really
> discussing relative link syntax for hierarchical groups, we also 
> need "Link to uncle" (link to sibling of my parent) and 
> "Link to cousin" (link to child of a sibling of my parent).  
> Without a way to support relative links to uncle and cousin pages, 
> PmWiki's current "flat" scheme can be made to act equivalently
> to a hierarchical one.
> 
>> Let me start by rephrasing the proposals that I mentioned before:
>>
>> Absolute link:   [[/Animal/Canine]]
>> Link to parent:  [[..]]
>> Link to sibling: [[Feline]]
>> Link to child:   [[./Bulldog]]
>> Pros: Borrows heavily from well-known filesystem syntax.
>> Cons: The distinction between "link to sibling" and "link to child" 
>> seems artificial.
>> Also, the use of dots conflicts with "dot syntax" (where PmWiki simply 
>> displays the last element of the page's access path).
> 
> As mentioned above, the "pro" (borrows heavily from well-known
> filesystem syntax) may in fact be a "con", since it also
> differs in meaning from that well-known filesystem syntax
> with respect to "link to sibling" and "link to child".

Not really. The difference is that it's unclear to many what's the 
"current directory" of a file that's also a directory. I don't think 
it's easy to avoid that problem.

We could go for a different approach: A group name is never also a page. 
It has a fixed name (Group/HomePage, or Group/Group, or whatever). In 
this case the subtle differences vanish.
(The downside is that we keep that "what's the name of the home page of 
a group?" problem. Yes, it's a problem.)

>> Absolute link:   [[:Animal.Canine]]
>> Link to parent:  [[..]]
>> Link to sibling: [[Feline]]
>> Link to child:   [[.Bulldog]]
>> Pros: Very regular. Links that navigate across the hierarchy always 
>> contain a dot somewhere, purely local links don't.
>> Cons: The initial dot in "Link to child" is easily overlooked, but 
>> carries semantic relevance.
> 
> Con: not an obvious way to link to an uncle, cousin, or grandparent.

Uncle: ..Mineral (yes, that's fishy)
Cousin: ..Rock.Pyrite

>> Maybe we should collect syntax proposals on the PmWiki/HierarchicalGroups.
> 
> I'd prefer it in a PITS page.  Either that, or in 
> PmWiki/HierarchicalGroups-Proposals.  I'd like to keep 
> the existing HierarchicalGroups page more explanatory
> (why we don't have them) than exploratory.

OK. Good point.

I made a HierarchicalGroups-Proposals page. It's not a PITS issue in my 
eyes (yet) since it's unclear what (if anything) should be changed in 
PmWiki.

I haven't found the time to fill in many details, but I have set up a 
general structure that is (hopefully) useful.

> I think we should first figure out how things ought to work
> w/o backwards compatibility, and then we could potentially
> deal with migration issues.

Good plan.

>> (2) is difficult to reconcile with (1), simply because there's no 
>> precedent in filesystem syntax for this.
> 
> Exactly.  And I think filesystem syntax is too widespread and
> too far ingrained in the web itself for us to be able to dismiss it.

Then the / syntax should be the basis, probably.

Regards,
Jo




More information about the pmwiki-users mailing list