Results 1 to 4 of 4

Thread: Installing Weft-QDA on Ubuntu 10.04 Lucid

  1. #1
    Join Date
    Sep 2009
    Beans
    72

    Installing Weft-QDA on Ubuntu 10.04 Lucid

    Hi all,

    I haven't worked much with CAQDAS (Computer Assisted Qualitative Data Analysis Software) software, but I may have to - so I looked a bit into open variants, and heard about Weft QDA - a free, open-source tool for qualitative data analysis from:


    So I decided I give it a try, but since the installation wasn't really straightforward (see for instance their RubyForge: Weft QDA: Tracker - it is possible this software is no longer actively maintained), here's my writeup.

    First of all, I'm not much into ruby, there seem to be several versions in Lucid, and it's not exactly clear which one is needed for weft_qda; apparently, 1.8 does it just fine. And that I can say, because I tried the following combination that does not work:
    Code:
    sudo apt-get install ruby1.9.1 libzlib-ruby irb1.9.1 rubygems1.9.1 libsqlite3-ruby1.9.1 libonig2 libsqlite3-dev libonig-dev ruby1.9.1-dev # oniguruma fails
    and this one as well, which also fails:
    Code:
    sudo apt-get install ruby1.9 libzlib-ruby irb1.9 rubygems1.9 libsqlite3-ruby1.9.1 libonig2 libsqlite3-dev libonig-dev ruby1.9-dev # oniguruma fails
    So, what ended up working for me, is more or less the Debian installation instructions posted on "Christophe Lejeune - Weft QDA under Linux Debian Lenny" (note that Ubuntu Lucid seems to install ruby1.8 by default, with the below commands):
    Code:
    sudo apt-get install ruby libzlib-ruby irb rubygems
    sudo apt-get install libsqlite3-ruby libsqlite3-0 libonig2 
    sudo apt-get install libwxgtk2.8-0
    # dev packages are needed for some of the next installs! 
    sudo apt-get install libsqlite3-dev libonig-dev ruby-dev make
    
    sudo gem install wxruby
    sudo gem install wx_sugar
    sudo gem install oniguruma
    sudo gem install sqlite3-ruby
    sudo gem install diff-lcs
    sudo gem install gettext
    
    wget http://rubyforge.org/frs/download.php/35714/weft_qda-1.9.0.tar.gz
    tar xvzf weft_qda-1.9.0.tar.gz
    
    cd weft_qda-1.9.0/
    ruby -rubygems weft-qda.rb
    So far so good - because you should be able to see a window start; however, opening a new project will fail with:
    Code:
    /usr/lib/ruby/1.8/sqlite3/errors.rb:62:in `check': near "END": syntax error (SQLite3::SQLException)
    Now, this is not a package error or anything - this is a SQL syntax problem (which is why I suspect it is not maintained - this looks like incompatibility with later versions of SQLite?). After a bit of debugging, I found that the problematic SQL chunk is:
    Code:
    CREATE TRIGGER insert_doc
      AFTER INSERT ON document
      BEGIN
    END;
    
    CREATE TRIGGER delete_doc 
      AFTER DELETE ON document
    BEGIN
      DELETE FROM document_attr_value WHERE docid = old.docid;
      DELETE FROM code WHERE docid = old.docid;
      DELETE FROM annotation WHERE docid = old.docid;
    END;
    and after a bit more debugging, it turns out that an empty trigger in SQLite 3 raises a syntax error, that is - the problem is:
    Code:
    CREATE TRIGGER insert_doc
      AFTER INSERT ON document
      BEGIN
    END;
    Now, this statement occurs two places in the source code:
    Code:
    weft_qda-1.9.0$ grep -r 'TRIGGER insert_doc' .
    ...
    ./lib/weft/backend/sqlite/schema.rb:CREATE TRIGGER insert_doc
    ...
    ./share/schema.sql:CREATE TRIGGER insert_doc
    ...
    And it is, in fact, the one in './share/schema.sql' that we need to change. Unfortunately, Sqlite3 seems quite picky about what sentences go into an insert trigger; see:


    For instance, trying to 'fake' some dummy commands will also raise a syntax error, as in:
    Code:
    CREATE TRIGGER insert_doc
      AFTER INSERT ON document
    BEGIN
      CREATE TEMPORARY TABLE dummy; <= syntax error CREATE
      DROP TEMPORARY TABLE dummy;
    END;
    ... so finally, what seems to work, is to use the following sentence in './share/schema.sql' (and possibly in './lib/weft/backend/sqlite/schema.rb', if you want to make sure):
    Code:
    CREATE TRIGGER insert_doc
      AFTER INSERT ON document
      BEGIN
      UPDATE document SET created_date = DATETIME('NOW'),modified_date = DATETIME('NOW') where rowid = new.rowid;
    END;
    If after that you run the program with 'ruby -rubygems weft-qda.rb', you should now be able to start it, and create and save a new project.



    Then, you can click on "Import" when the 'Documents' dropdown is selected, choose the 'README' as an example, click on 'New' and establish categories (note: the first category node will be root node, and only one root node seems possible) - and then you can doubleclick on 'README' to start the viewer.

    With the viewer started, you can click on category nodes, and then mark a text selection, and then click on "Mark" - this will be shown in yellow afterwards; when you click on individual category nodes, only the respective selections are shown.

    You can also select a text region, and click on "Note" - which will open a small textbox that will allow you to enter a note, and will add a small reference hyperlink next to the text.

    Note however, that even after this, I managed to get some crashes by random (say, by right-clicking on an empty document window), so it seems this software may need a bit more work (if still actively maintained). And finally note that the .qdp file that Weft-QDA saves in, is nothing but a SQLite3 database file - which can be opened directly in SQLite Database Browser (sudo apt-get install sqlitebrowser).

    Also: note that if you use Unicode characters in your textfiles, you may get a truncated view of the text (missing text) in Mark mode (apparently, something to do with counting how many bytes come per Unicode character for multi-byte chars); in this case, you may want to convert your text files to plain ASCII characters first.

    In the end - I'm not yet sure what is the exact intended use of this software; but I sure hope this helps someone

    Cheers!
    Last edited by sdaau; September 28th, 2010 at 03:36 PM.

  2. #2
    Join Date
    Nov 2007
    Location
    Montevideo, Uruguay
    Beans
    8

    Re: Installing Weft-QDA on Ubuntu 10.04 Lucid

    Yes is very useful. But to difficult to install and still have lot of busgs.

  3. #3
    Join Date
    Jul 2007
    Location
    Tempe
    Beans
    94
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Installing Weft-QDA on Ubuntu 10.04 Lucid

    Thanks, I believe these instructions will come in handy.

  4. #4
    Join Date
    Dec 2010
    Beans
    2
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Installing Weft-QDA on Ubuntu 10.04 Lucid

    I'm trying with ubuntu 12.04 LTS, but is not working.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •