Showing posts with label Zotero. Show all posts
Showing posts with label Zotero. Show all posts

Monday, May 18, 2009

Dealing with Zotero collections

Zotero offers some nice API functions for collection management.

  • Zotero.Collections() return an array to all the collections in the current library. I am not sure how this will handle shared collections but it is worth investigation.
  • Zotero.Collection is an object that will handle everything related to a Zotero collection. 
To add a new collection, one can:
  • Add the row directly to the DB. A dirty solution that used to work for version 1.* until 1.5 beta. However, it stopped working with version 2.* (the beta version at least) because the key field in collections table can not be empty anymore.
  • Use Zotero.Collections.Add(__collection_name__) and reference the new object 
//
// Create a Zotero collection object
//
newCollection = new Zotero.Collection();

To add items to a collection, the direct DB query is still working but I would not advise you to use it as it will break the stability of the DB sometimes. So the better approch is to use Collection.addItem() or Collection.addItems() methods.
newCollection.addItem(duplicateItemID);

Saturday, May 16, 2009

Javascript Date Format

Just a small note, Javascript has two functions for the Date.Year. I needed to use the Full year function but unintentionally I have used getYear() function.

The correct method is getFullYear()

Zotero Database Abstraction

It should be noted that the database abstraction layer for Zotero is still not complete. The authors noted that
            // Until the native dataset methods work (or at least exist),
            // we build a multi-dimensional associative array manually


It took me a while to understand how I can get query results from Zotero.DB. It was mentioned in one of the functions comments but was not clarified in a document file. The query returns varies depending on the query type as per the following comments on the Zotero.DB.query() function
  * Run an SQL query
 *
 *  Optional _params_ is an array of bind parameters in the form
 *        [1,"hello",3] or [{'int':2},{'string':'foobar'}]
 *
 *     Returns:
 *       - Associative array (similar to mysql_fetch_assoc) for SELECT's
 *     - lastInsertId for INSERT's
 *     - TRUE for other successful queries
 *     - FALSE on error
You should notice in the first comment that the SELECT Query would return an associative array that is built by Zotero coders and not a native multidimentional javascript array.

The easiest way to parse such an array is to use a For Each loop or a while loop.
            for (duplicateItems in potentialDuplicateItems)
                {
                //
                // Get each row now
                //
                var oneRow = potentialDuplicateItems[duplicateItems];
                idsArray[duplicateItems] = oneRow['ID'];
                }

Make sure you use the correct index to read from each row or you might get a lot of undefined errors. Errors are not bad but when you are developing for a firefox extention and you have to restart your browser for each test or correction, it might become a hassle.

Zotero Extension Development

I beleive that Zotero is the future of Reference Management. This tool is free, nice, simple, and powerful.
I am developing some simple extenstions for it and I wanted to share this experience with other readers who might be interested in that.

The documentation on extension development for Zotero is still not adequare and I would love to help anyone who is looking for help.

Wednesday, December 31, 2008

Researh tools

I have noted earlier that going into academia is a long quest and require high levels of dedicaiton, perseverance and commitment. This is not enough, one needs a toolbox to proceed with.

I would put here a lot of the items that are extremly important for any research discsipline. I will follow with another list of tools that are needed for financial reaserch.

For any kind of research one needs:
  1. Strong exposure to research methodology, ethics, and norms
  2. Solid comprehension of statistics and statistical measures, tests and appropriate interpretation
  3. Clear style for reviewing the literature
  4. Access to academic scholary databases and libraries 
  5. Critical understanding and assessement of literature
  6. Ability to narrow down on a resaerch topic that is not too wide and not too narrow. 
  7. Ability to classify and organize readings on the go
The approaches I suggest to fulfil the above:
  1. Following a strong reaseach methodology course with an experiences professor. Unfortunately, I have seen so many methodology courses that fit anywhere but in a methodological paradigm. Students coming from different backgrounds into the Phd program, needs refined methodological courses that help them find their way into the academic research areana and fix their feets. I had to read a lot on my own to cover this gap in my studies. Yet, I can not claim that I mastered the methodology I should follow.

  2. Invest enough time to grasp all the required stastical concepts and know the ins and outs of the statistal package mostly used for that discsipline. It would save you tens of hours in modeling and debugging if you really know the tool you are using extremly well.

  3. Work with an experienced researcher on the literature review part in order to improve your skills and learn the tricks that others are following. This would be a great step to get you on track with something that is easier to collect, classify, digest and then reproduce from your resaerch point of view. There are a lot of tools that would help succeed in doing a great literature review. One of my supervisor advised me to get this book: "Fink, A. (1998). Conducting Research Literature Reviews: From Paper to the Internet. Sage Publications, Inc.". It is available on amazon but I have borrowed it from Concordia University library. There is another resource to hint on how to conduct your own review at this page:

    The Literature Review: A Few Tips On Conducting It

  4. The last point I woudl like to mention in this area is the access to a rich collection of books and electronic resources. Your unversity library should have a lot of what you are looking for. Do not let books sitting on cold dark shelves. Go on and use those books. We are paying a lot for these collections and more than 80% of it goes by unnoticed for many years. In the golden age of libraries, we used to find books with torn pages. Now, I get a lot of books untouched. Really brand new. I would like to note that Concordia Library has one of the richest collections I have even seen in a Library especially for some disciplines that students rearely goes into. We are very lucky in Montreal, if the book is not available in Concordia, McGill is there, HEC or even UQAM. A wealth of knowlege waiting for someone to dig and mine into its pages.
In addition to that, one needs real tools to get the job done. I will not talk about these tools in details now. I would just list them:
  • Fink's book
  • Statistical Packages (Matlab in my case)
  • Firefox and Zotero (For bibliographical referncing). I prefer Zotero over RefWorks or EndNotes.
  • mediaWiki (Really? Are you sure? Yes absolutely)