resource type mapping is confusing

I have finally been able to get my csl to output bibliographies just as I want them. In particular, I was having problems getting report numbers and conference details to be displayed. While fiddling around, I noticed the following:
Resources of type "Report" are handled by
type="book"
and resources of type "Conference Paper" are handled by
type="chapter"
This is non-intuitive and a bit confusing. I think it should be documented somewhere, so as to make it easier to adapt citation styles to one's needs (or perhaps it is documented, and I didn't find it?)
  • to be precise, they _default_ to the respective types. You can also address them separately ("<if type="report">)

    the csl documentation is still incomplete and you should feel free to contribute - it's in wiki format
    http://www.zotero.org/support/dev/csl_syntax_summary
  • This default behavior is going away in the future though.

    General rule: don't base formatting on types if you can avoid it.
  • <if type="report"> didn't work for me, probably because that block was located behind the <if type="chapter"> block in the csl file.
    where are the _default_ types defined?
  • As I said, forget about the types unless formatting is obviously wrong.
  • but to answer the question, it's here

    chrome://zotero/content/xpcom/csl.js
    Zotero.CSL.Item._fallbackTypeMap = {
    book:"book",
    bookSection:"chapter",
    journalArticle:"article",
    magazineArticle:"article",
    newspaperArticle:"article",
    thesis:"article",
    encyclopediaArticle:"chapter",
    dictionaryEntry:"chapter",
    conferencePaper:"chapter",
    letter:"article",
    manuscript:"article",
    interview:"article",
    film:"book",
    artwork:"book",
    webpage:"article",
    report:"book",
    bill:"book",
    case:"book",
    hearing:"book",
    patent:"article",
    statute:"book",
    email:"article",
    map:"article",
    blogPost:"article",
    instantMessage:"article",
    forumPost:"article",
    audioRecording:"book",
    presentation:"article",
    videoRecording:"book",
    tvBroadcast:"article",
    radioBroadcast:"article",
    podcast:"article",
    computerProgram:"book"


    And Bruce, while I understand what you are saying, you complain often enough about the craziness of citation style requirements for me to not have to tell you that many styles just aren't internally consistent enough to be able to forget about item types.
  • https://www.zotero.org/trac/browser/extension/trunk/chrome/content/zotero/xpcom/csl.js

    is the definitive mapping for both the Zotero type -> core CSL type mapping & the fallback mapping.

    bdarcus: do you have a link to plans to change this feature. Obviously, some styles will need to be modified if items no longer have fallbacks.
  • Am not saying don't use types; am saying don't privilege them. When people start with the types, they end up with more problems, I submit, than if they start without them. In the case of a report number, it's highly unlikely the formatting is going to be any different for any other document number (and so CSL "number" variable).
  • edited September 23, 2009
    In my case I have different types of resources that need to be formatted differently, so I can't do without distinguishing between the types.

    and concerning the default type mapping: if you want to override the default you have to make sure that you handle the type you want before you handle the one to which it defaults to, in other words the order in which you go through the types is important. I think doing away with these defaults is a good idea, in particular as it's not clear what the defaults are.

    EDIT: thanks for posting the list of fallback types
  • @noksagt: I don't have a link (it's on the xbib archive somewhere), but the decision is based on the fact that I introduced that behavior before we had the conditional flow control support, which makes it unnecessary. Not only is it unnecessary, but it adds complexity to both style authoring (witness the confusion here), and to the processor.

    Might be worth thinking if there's some way to automatically adjust styles that might need it.
  • I'd forgotten this myself. Here's a link to the discussion.
  • edited September 28, 2009
    one more followup to this:
    it gets even more confusing as I found out that in order to handle a "presentation", the _default_ mapping (Zotero.CSL.Item._fallbackTypeMap) to "article" does not work, but rather I have to use the type "speech", as is specified in Zotero.CSL.Item._optionalTypeMap.
    Hopefully this will become easier to comprehend once those defaults are no longer used.
Sign In or Register to comment.