Group URLs should use group number, not group name
While working on changes to a group I intend to launch shortly, I realized that URLs, pointing to the group and its library, include the group name. This means, if the group name is changed all previous URLs to group home page or individual items are now broken. Further, groups with long names lead to long URLs, which is sometimes not desirable.
At the same time, each group also has a unique group number attached to it, which I believe does not change when you make changes to the group. Thus, it is unique and unchanging for the life of the group.
For example, given below are three URLs pointing to a group's home page, it's library home page, and individual item in the library.
https://www.zotero.org/groups/tee
https://www.zotero.org/groups/tee/items
https://www.zotero.org/groups/tee/items/itemKey/TD2DEPHD
The group name is "TEE" and this shows up in the URLs. This group also has a number assigned to it: "310273". You can substitute the "tee" in the URL with "310273" and the links work fine, but they get redirected with "tee" for second and third URL in above list.
For example, https://www.zotero.org/groups/310273/items
Wouldn't it be better to just use the group number and never promote group name in the URL?
At the same time, each group also has a unique group number attached to it, which I believe does not change when you make changes to the group. Thus, it is unique and unchanging for the life of the group.
For example, given below are three URLs pointing to a group's home page, it's library home page, and individual item in the library.
https://www.zotero.org/groups/tee
https://www.zotero.org/groups/tee/items
https://www.zotero.org/groups/tee/items/itemKey/TD2DEPHD
The group name is "TEE" and this shows up in the URLs. This group also has a number assigned to it: "310273". You can substitute the "tee" in the URL with "310273" and the links work fine, but they get redirected with "tee" for second and third URL in above list.
For example, https://www.zotero.org/groups/310273/items
Wouldn't it be better to just use the group number and never promote group name in the URL?
The above group in my example was called "Energy and Emissions". I wanted to name it "Transportation Energy and Emissions", but that was way too long for the URL. And when I changed it to "TEE", it broke all the past URLs, that were based on Energy and Emissions.
That is, this URL no longer works because I changed the group name:
https://www.zotero.org/groups/energy_and_emissions
I do feel that the human readable names in URLs provide value, and name changes should be the exception, not the rule.
As you noted though, the version of the URL with the group ID does work, so that could be used as a form of permalink.
I feel strongly about this and believe using group names is not the right way. In fact, it is frightening to know all your past URLs will become useless if you ever rename the group.
The primary and absolutely inviolable function of a URL is that it must work as long as the said item exists on the web. Everything else is secondary. If the URL does not convey the group name, that's not a big deal at all. People will know what group it is when they go to the page. But if they can't get to the page, then the URL is worthless. The URL is already using a cryptic (but unique) placeholder for individual items.
A shorter URL is also better than a longer, more descriptive, one. There's a reason why most services allow you to shorten the URL. I don't think people are looking to "learn" from a URL. They just want it to work and be short to type or fit on their screen and so on.
Nobody expects URLs to work for items that do not exist. It makes no sense :) So, yes, if someone deletes a group or an item and then re-creates the exact same thing, nobody is going to argue the previous URL should work.
Changes to group names might be rare, but not impossible and sometimes very justifiable. If a group grows (or shrinks) beyond the originally intended purpose, it is good to rename it to represent its true extent. Or, group members feel strongly that original name is not good.
Manually substituting group number for name is not going to work. If my group has dozens or hundreds of members, how many do I "teach" this rule? It's bound to fail. If not at that level, then for other people who click on the URL, which gets redirected to show group name and then copy-paste from the browser for their purpose.
If we wanted the URLs to be more stable, we could follow the practice of Facebook Groups or YouTube Channels & allow people to only set it once or twice, separately from the group name. Using cryptic numbers is not a good solution.
Thinking more widely -- I think Zotero should consider allowing people to generate DOIs for public groups. There are several groups now that are massive annotated scholarly collections, and I think it'd be very appropriate to give them DOIs.
DOIs are not human readable. And the current system is in any case using cryptic strings for individual items.
We are sacrificing a lot of flexibility and robustness and if I may say, elegance derived from having a short URL, for the meager benefit, if any, of human readable URL.
The best approach might be to do what Amazon and other sites do, which is to have an ID that determines the actual target and then have a more descriptive section after that doesn't actually matter:
https://www.zotero.org/groups/12345/transportation_energy_emissions_and_economics
Old URLs would then always work, and we could redirect to a URL with the current name.
(These forums do this too, actually, though without the redirecting.)
1. So, going forward, it does not matter how many times a group's name is changed? As long as the object exists (where object could be the group, or an individual item in the group), the URL to that object will work. Right?
2. How do I test this is working? I can think of changing my group's name and testing older URLs. What else can be done to test the update?
2. You can just test this with any group. Take
https://www.zotero.org/groups/684844/aglc_samples
the url still works as
https://www.zotero.org/groups/684844/whatever_I_dont_care
I think URLs to individual items might need some more work.
This
https://www.zotero.org/groups/684844/whatever/items/itemKey/UBKM7ANP
is not redirecting to the correct object:
https://www.zotero.org/groups/684844/aglc_samples/items/itemKey/UBKM7ANP
As adamsmith says, currently the logic is that the name is literally ignored as long as the ID is there first (you can see that happens with the 'whatever_I_dont_care' url as well as your individual item urls). That actually simplified handling of some things. I don't think there's a problem also doing the redirect you want though.
The redirect for individual items in a group seems broken to me.
Any url of the form
/groups/<groupID>/<possible group name but maybe not accurate>/...
ignores the name entirely and just relies on groupID.
urls with only the groupID or only the group name redirect.
https://www.zotero.org/groups/684844/whatever/items/itemKey/UBKM7ANP goes to the group library
https://www.zotero.org/groups/684844/aglc_samples/items/itemKey/UBKM7ANP goes to the UBKM7ANP item
I was only looking at the url and totally missed that the library was loading different views.
Thanks for the clarification.
I will report back if something looks amiss.