Hi, I''m using QDA Weft and I''m totally happy with it. Now I want to analyse my coding and compare it to what other coders in my team have done. As far as I know QDA Weft uses an embedded SQLite database. Can I access this database so that I can run ordinary SQL queries? Is there a database schema available so that I know how the different tables are related to each other? Thanks, Sebastian
Hi Sebastian Sebastian Stein wrote:> As far as I > know QDA Weft uses an embedded SQLite database. Can I access this database > so that I can run ordinary SQL queries?Yes. Weft QDA version 1.0 uses SQLite version 2.x. You can use the command-line database client available free from http://www.sqlite.org/download.html (under the section ''Historical Binaries and Source Code''). Other users have reported successful use of a free GUI program, SQLiteBrowser. I have tried it out and it seems to be excellently suited for exploring the database schema and contents. I''ve copied an email from another user below with a bit more information about using it to edit the text of documents in Weft 1 http://sourceforge.net/project/showfiles.php?group_id=87946&package_id=91778 Note that you must use version 1.1 of SQLite Browser, not the latest version.> Is there a database schema available > so that I know how the different tables are related to each other? >The schema used in v1.0 is set out here (within a ruby script file, but it should be pretty clear) http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/tags/weft_1-0-1/weft-qda/lib/weft/backend/sqlite/schema.rb?revision=517&root=weft-qda Two points of interest: - the category_structure table simply contains a cached representation of the whole category tree - it is not really of interest for analysis. - you''ll find a lot of categories with a single-word name and a parent -2 - these are search indices used to make the text search quick. Again, they can be ignored for analytic purposes Best wishes Alex __ Instructions for editing the content of a Weft QDA document using SQLiteBrowser 1.1 To edit a *.qdp document with it, one must follow theses instructions: ==========================1. Launch SqliteBrowser 2. File >> Open >> Choose the *.qdp file 3. Click on the Browse Data Tab to show the tables in the database 4. Select the Table named Document 5. On the left is the list (numbers) of your imported documents. To display the content of a particular document, double-click on the field called doctext 6. Scroll the content of the document. *** Important note *** In order to keep the integrity of the categorization done in WeftQDA, one must make sure that the number of characters does not change. If you want to edit 10 characters, you must replace it with 10 characters. You can add text at the end of the file without problem (as fas as I could test it). 7. Once done, click on the Apply changes Button then on the Close Button to return to the list of documents 8. To quit, click on File >> Save database the File >> Exit. ================================
Alex Fenton <alex at pressure.to> [070712 18:04]:> Other users have reported successful use of a free GUI program, > SQLiteBrowser. I have tried it out and it seems to be excellently suited > for exploring the database schema and contents. I''ve copied an email > from another user below with a bit more information about using it to > edit the text of documents in Weft 1 > > http://sourceforge.net/project/showfiles.php?group_id=87946&package_id=91778I found this one very useful. I tried before the command line tool but it was not so easy to get an overview from it.> Two points of interest: > - the category_structure table simply contains a cached representation > of the whole category tree - it is not really of interest for analysis.Ah, good to know.> - you''ll find a lot of categories with a single-word name and a parent > -2 - these are search indices used to make the text search quick. Again, > they can be ignored for analytic purposesHhm, doesn''t really look like a normalised database schema :-) Anyway, I managed to write a small Java program which can run any SQL queries supported by SQLite. If you are interested, I can share the program. Sebastian -- http://sebstein.hpfsc.de/
Sebastian Stein wrote:> Hhm, doesn''t really look like a normalised database schema :-)Hehe - both the category_structure table and the way text search indexes were done were misfeatures in version 1.0 - live and learn.> Anyway, I > managed to write a small Java program which can run any SQL queries > supported by SQLite. If you are interested, I can share the program. >Thanks. I don''t use Java myself, but others may well be interested. Since Java can now run Ruby (via JRuby), the language Weft is written in, you might also be able to use it to access the project documents and categories directly and inspect and manipulate them. For example, a simple script to fetch a document by title and print its length would look something like: require ''weft'' app = QDA::Application.new( QDA::Backend::SQLite ) app.start(:dbfile => ''my_project.qdp'') the_doc = app.get_document(''My title'') puts the_doc.text.length It would take some work to get set up, but if you''ve some Java experience, it might (or might not) be a more convenient way to carry out custom analyses, eg coding comparison alex
Alex Fenton <alex at pressure.to> [070712 21:15]:> Since Java can now run Ruby (via JRuby), the language Weft is written > in, you might also be able to use it to access the project documents and > categories directly and inspect and manipulate them. > > For example, a simple script to fetch a document by title and print its > length would look something like: > > require ''weft'' > > app = QDA::Application.new( QDA::Backend::SQLite ) > app.start(:dbfile => ''my_project.qdp'') > > the_doc = app.get_document(''My title'') > > puts the_doc.text.length > > It would take some work to get set up, but if you''ve some Java > experience, it might (or might not) be a more convenient way to carry > out custom analyses, eg coding comparisonRuby is a really strange language. I really have to get used to it, seems to be a totally different way of thinking. Sebastian -- http://www.halle-ist-schoen.de/ Bilddokumentation der schoensten Saalestadt