[pmwiki-users] hierarchical groups, revisited

Patrick R. Michaud pmichaud at pobox.com
Thu May 25 09:51:24 CDT 2006


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.

> > 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]].

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

> > 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]]

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.

Personally, I think that sort of subtle dissonance between url
syntax and PmWiki hierarchical page syntax could be hard for 
many to swallow.

> The root of the confusion is that the filesystem analogy breaks down at 
> this point. In a file system, a directory doesn't double as a file; in 
> PmWiki, a group doubles as a page.

Exactly.

> 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".

> 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.

> 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.

> Actually the semantics is easy. What's problematic is finding a syntax 
> that has all of these properties:
> 1) Easily understood (i.e. close to existing syntax),
> 2) can differentiate between sibling and child links,
> 3) offers display variants (absolute path vs. just the last component of 
> the path vs. path as given in the link), and
> 4) is backwards compatible with current wikilink syntax.
> 
> I don't think that (2) and (4) are compatible. I suspect that any syntax 
> that supports both would be too irregular and ugly to live.

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.

> (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.

Thanks,

Pm




More information about the pmwiki-users mailing list