# style naming, id, link conventions

**URL:** <https://discourse.citationstyles.org/t/style-naming-id-link-conventions/177>\
**Category:** CSL Development\
**Created:** [August 5, 2006, 5:37pm UTC](https://discourse.citationstyles.org/t/style-naming-id-link-conventions/177 "2006-08-05T17:37:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 5, 2006, 5:37pm UTC](https://discourse.citationstyles.org/t/style-naming-id-link-conventions/177/1 "2006-08-05T17:37:36Z")

</div>

Alright, how about let’s make this specific?

An example:

 American Sociological Review http://purl.org/net/xbiblio/csl/styles/am\_sociol\_rev.csl http://purl.org/net/xbiblio/csl/styles/am\_sociol\_rev.csl
# Proposed guidelines (subject to radical revision if people think it sucks!)========================================================================

## Identifiers and URLs

Style naming and identification are important to properly manage  
styles, particularly in a distributed context. A style title provides a  
natural language description to a user, while ids, links and file names  
all provide information critical so that tools can properly access  
styles.

CSL metadata borrows its content model from Atom. As with Atom, the id  
element should contain a globally unique and stable identifier, encoded  
as a uri.

In many cases, the value for the link element will be the same as the  
id, but strictly speaking they need not be. An id provides for  
identification, while link for resolution. Ideally, they are  
coincident, but practically speaking, it is common that urls change.

Both of these are important because other aspects of the design are  
based on them. For example, styles may contain an optional "basedOn"  
element, which is a uri reference to the style from which it inherits.

The CSL namespace provides a convenient uri base for just this, and the  
site to which it points a convenient place to store the styles. But one  
can host a directory of styles anywhere, of course.

## Style Names

For purposes of constructing the id and link values, and thus the file  
name, you should abbreviate long titles, use underscores to replace  
spaces, and use the “csl” filename extension. For example, a style file  
for the “American Sociological Review” would be: am\_sociol\_rev.csl.  
Core styles alone – such as APA and MLA – use shorter acronyms for  
theiir file names and id and link values (apa.csl and mla.csl  
respectively).

Questions:

Versions?  
Variants?

Bruce

---

<div class="post-metadata">

**Author:** ![Johan\_Kool2](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@Johan\_Kool2](https://discourse.citationstyles.org/u/Johan_Kool2)\
**Post date:** [August 6, 2006, 12:12pm UTC](https://discourse.citationstyles.org/t/style-naming-id-link-conventions/177/2 "2006-08-06T12:12:00Z")

</div>

Sounds alright. I just hope that a shortened name won’t to often clash  
with another publication.

Johan

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 6, 2006, 1:51pm UTC](https://discourse.citationstyles.org/t/style-naming-id-link-conventions/177/3 "2006-08-06T13:51:37Z")

</div>

Yeah, I think we need to specify the abbreviation algorithm, maybe  
pointing to one of those that Simon mentioned.

Bruce

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 6, 2006, 2:00pm UTC](https://discourse.citationstyles.org/t/style-naming-id-link-conventions/177/4 "2006-08-06T14:00:31Z")

</div>

Actually, this one is good; ought to just be able to include the link:

[http://www.nlm.nih.gov/pubs/factsheets/constructitle.html](http://www.nlm.nih.gov/pubs/factsheets/constructitle.html)

It even specifies the algorithm; e.g.:

> Each word in the title proper is compared against a master list of  
> abbreviations issued by the ISSN International Centre. If the word or  
> word root is found in the master list, that abbreviation is used.
> 
> If a word is not found in the ISSN list, the word appears in the title  
> abbreviation as it appears in the title proper.
> 
> Articles, conjunctions, and prepositions are always omitted from title  
> abbreviations.

… etc.

I wonder if we could get access to that “master list”? Probably not,  
but OTOH, it probably be wouldn’t hard to construct one that cover a  
lot of common cases (journal, review, annals, etc.).

Bruce

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 6, 2006, 2:46pm UTC](https://discourse.citationstyles.org/t/style-naming-id-link-conventions/177/5 "2006-08-06T14:46:16Z")

</div>

A little Ruby script that does this:======================  
#! /usr/bin/env ruby

IGNORE = [“of”, “the”]

LOOKUP = {  
“Annals” =\> “An”,  
“Association” =\> “Assoc”,  
“American” =\> “Am”,  
“Geographers” =\> “Geog”  
}

def abbreviate(title, form=display)  
words = title.split(/\s/)  
abbreviated\_words = []  
words.each do |word|  
if IGNORE.find{|w| w == word} then nil  
elsif LOOKUP[word] then  
abbreviated\_words \<\< LOOKUP[word]  
else  
abbreviated\_words \<\< word  
end  
end  
if form == “filename” then  
return abbreviated\_words.join("\_").downcase + “.csl"  
else  
return abbreviated\_words.join(” ")  
end  
end

# title = "Annals of the Association of American Geographers" puts "title: " + title puts "short title: " + abbreviate(title) puts "file name: " + abbreviate(title, form=“filename”)

Output:

title: Annals of the Association of American Geographers  
mainshort title: An Assoc Am Geog  
file name: an\_assoc\_am\_geog.csl

Ahem, not sure why I have that spurious “main” bit there, the LOOKUP  
table would have to be pretty damned large, and I’m not sure how one  
sensibly deals with capitalization, but it otherwise works 🙂

Bruce
