Submitted by gregory on 2014/12/09 10:29

 

I am trying to reproduce the work done notably by LucasD some years ago when he successfully integrated InfoQube with the SQLite database which underlies the Zotero reference management system.

The problem which I wish to report is that when I attempt to synchronise my IQbase with that SQLite database, absolutely nothing happens. There is no error message but nor is any data imported.

1.      What follows is the story of my investigation so far.

2.      I have taken a copy of the Zotero SQLite database, and it is that which I am using in my investigations.

3.      I have installed both 64-bit and 32-bit SQLite ODBC drivers, as found at: http://www.ch-werner.de/sqliteodbc/. The reason I have installed both is that the operating system is 64-bit but I strongly suspect that the Jet engine underlying InfoQube is 32 bit. Firefox remains 32-bit for the time being – but see https://wiki.mozilla.org/Firefox/win64.

4.      Question: should I uninstall the 64-bit SQLite ODBC driver?

5.      From the InfoQube website, I have downloaded the sample SQLNotes issues tracking database and its associated SQLsync.xml file.

However, this is no longer useful. An error is reported when the IQbase is first loaded, stating that the format cannot be upgraded. This does not appear to cause problems, because the IQbase opens normally. I have then created a grid, called item, based upon item and deleted all items so as to have a clean IQbase and to be able to retry the SQLsynch.xml file using tools/database management/synch with external database. When I do so, I get an error message:

Cannot connect to server (application-defined or object-defined error).

No doubt this is because the Mantis database has either been moved or is no longer in use. Since the documentation continues to refer to this sample, I think it would be best if the sample were corrected to refer to a current MySQL database. (I also think that this has low priority as an issue.)

6.      I have wanted to reuse the work by LucasD with as little change as possible, at least initially while I am testing that the approach still works. So far as I can understand what is required from the rather limited documentation which is available, the changes necessary to integrate Zotero access into my test IQbase, phase1.SNDB, should be the following:

7.      Create fields in my IQbase which correspond to the field names mentioned in the script produced by LucasD. The following screenshot shows only the last page of Zotero field definitions:

[Once again, I cannot upload a perfectly-ordinary .png file! It is an attachment to this post.]

8.      I have made the assumption that all fields should be of type text. I have in fact tried both text and number for the field Zotero_ID, but this makes no difference to the problem I am reporting.

9.      I have then created a grid called bibliography which is based on the field Zotero_ID.

The text of the SQLSynch.xml file, which I am editing using the editor Notepad++, is as follows:

<ConnectionString>

Driver={SQLite3 ODBC Driver};

C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\a1iw9b2s.default\zotero\zotero - Copy.sqlite;

</ConnectionString>
<FieldMap>
[Citation]    item
[itemid]    zotero_id

[datemodified]    dateupdate

[Type]    z12_ItemType

[Title]    z4_Title

[Author(s)]    z1a_Authors

[Editor(s)]    z1b_Editors

[Year]    z3_Year

[Book Title]    z13_BookTitle

[Journal]    z15_Journal

[Volume]    z16_Volume

[Issue]    z17_Issue
[Notes]    z20_Notes

[Abstract]    z19_Abstract

[Thesis Type]    z18_Diss_type

[Place]    z22_Place

[Publisher]    z23_Publisher

[Pages]    z21_Pages
[Tags]    z27_Tags

[Collections]    z28_Collections

[parentCollectionID]    z29_collectionparentID

[Attachments]    z30_Attachments

[Related Sources]    z31_Related_Sources

[Related Notes]    z32_Related_Notes

IMPORT    IDImportType

1    Bibliography
</FieldMap>
<Source>
select items.itemid,
"<B>"||
group_concat(distinct
coalesce(

kingdata0a.lastname, kingdata0e.lastname, kingdata1a.lastname, kingdata1e.lastname, kingdata2a.lastname, kingdata2e.lastname, kingdata3a.lastname, kingdata3e.lastname," ")

)
||
coalesce(
standalonenotes.title," ")
||
", "||
substr(
coalesce(

kingdata0a.firstname, kingdata0e.firstname, kingdata1a.firstname, kingdata1e.firstname, kingdata2a.firstname, kingdata2e.firstname, kingdata3a.firstname, kingdata3e.firstname," ")

, 1, 1)
||
"</B>"
||
". "
||
substr(coalesce(yearvalues.value,"[ ]"), 1, 4)
||
". "
||
"<I>"
||coalesce(titlevalues.value," ")
||
"</I>"
||
coalesce(standalonenotes.note," ")
as Citation,
itemtypes.typename as Type,
titlevalues.value AS Title,
group_concat(
 AuthorMainCreatorData.lastname
||

(select ", " where authormaincreatordata.firstname is not null) ||

coalesce(
AuthorMainCreatorData.firstname
,""),"; ")
as [Author(s)],
group_concat(
(select distinct EditorMainCreatorData.lastname)
||

(select ", " where editormaincreatordata.firstname is not null) ||

coalesce(
EditorMainCreatorData.firstname
,""),"; ")
 as [Editor(s)],

substr(coalesce(yearvalues.value,"[ ]"), 1, 4) as Year,

booktitlevalues.value as [Book Title],
journaldatavalues.value as Journal,
journalvolumedatavalues.value as Volume,
journalissuedatavalues.value as Issue,
group_concat(itemnotes.note) as Notes,
abstractvalues.value as Abstract,
thesisvalues.value as [Thesis Type],
placedatavalues.value as Place,
publisherdatavalues.value as Publisher,
pagesdatavalues.value as Pages,
group_concat(distinct tags.name) as Tags,

group_concat(distinct collections.collectionName) as Collections,

collections.parentcollectionid,
group_concat(distinct itemAttachments.path) as Attachments,
group_concat(distinct
coalesce(
seealsooutTitledatavalues.value," "))
 ||
group_concat(distinct
coalesce(
seealsoinTitledatavalues.value," "))
as [Related Sources],
group_concat(distinct
coalesce(
outnotes.title," "))
||
group_concat(distinct
coalesce(
innotes.title," "))
as [Related Notes],
items.datemodified
FROM
items
left join itemtypes
on items.itemtypeid=itemtypes.itemtypeid
left join itemnotes
on items.itemid=itemnotes.sourceitemid
left join itemnotes as StandaloneNotes

on items.itemid=StandaloneNotes.itemid and StandaloneNotes.sourceitemid is null

left join itemcreators
on items.itemid=itemcreators.itemid
left join creators
on itemcreators.creatorid=creators.creatorid
left join creatordata
on creators.creatordataid=creatordata.creatordataid
left join creatordata as EditorMainCreatorData

on creators.creatordataid=EditorMainCreatorData.creatordataid and itemcreators.creatortypeid=3

left join creatordata as AuthorMainCreatorData

on creators.creatordataid=AuthorMainCreatorData.creatordataid and itemcreators.creatortypeid=1

left join itemcreators as itemcreators0

on items.itemid=itemcreators0.itemid and itemcreators0.orderindex=0

left join creators as creators0
on itemcreators0.creatorid=creators0.creatorid
left join creatordata as creatordata0
on creators0.creatordataid=creatordata0.creatordataid
left join itemcreators as itemcreators1

on items.itemid=itemcreators1.itemid and itemcreators1.orderindex=1

left join creators as creators1
on itemcreators1.creatorid=creators1.creatorid
left join creatordata as creatordata1
on creators1.creatordataid=creatordata1.creatordataid
left join itemcreators as itemcreators2

on items.itemid=itemcreators2.itemid and itemcreators2.orderindex=2

left join creators as creators2
on itemcreators2.creatorid=creators2.creatorid
left join creatordata as creatordata2
on creators2.creatordataid=creatordata2.creatordataid
left join itemcreators as itemcreators3

on items.itemid=itemcreators3.itemid and itemcreators3.orderindex=3

left join creators as creators3
on itemcreators3.creatorid=creators3.creatorid
left join creatordata as creatordata3
on creators3.creatordataid=creatordata3.creatordataid
left join creatordata as Kingdata0a
on

(creators0.creatordataid=Kingdata0a.creatordataid and itemcreators0.creatortypeid=1)

left join creatordata as Kingdata0e
on

(creators0.creatordataid=Kingdata0e.creatordataid and (itemcreators1.creatortypeid!=1 OR itemcreators1.creatortypeid is null) AND (itemcreators2.creatortypeid!=1 OR itemcreators2.creatortypeid is null) AND (itemcreators3.creatortypeid!=1 OR itemcreators3.creatortypeid is null) AND itemcreators0.creatortypeid=3)

left join creatordata as Kingdata1a
on

(creators1.creatordataid=Kingdata1a.creatordataid and itemcreators1.creatortypeid=1)

left join creatordata as Kingdata1e
on

(creators1.creatordataid=Kingdata1e.creatordataid and itemcreators0.creatortypeid!=1 AND itemcreators2.creatortypeid!=1 AND itemcreators3.creatortypeid!=1 AND itemcreators1.creatortypeid=3)

left join creatordata as Kingdata2a
on

(creators2.creatordataid=Kingdata2a.creatordataid and itemcreators2.creatortypeid=1)

left join creatordata as Kingdata2e
on

(creators2.creatordataid=Kingdata2e.creatordataid and itemcreators0.creatortypeid!=1 AND itemcreators1.creatortypeid!=1 AND itemcreators3.creatortypeid!=1 AND itemcreators2.creatortypeid=3)

left join creatordata as Kingdata3a
on

(creators3.creatordataid=Kingdata3a.creatordataid and itemcreators3.creatortypeid=1)

left join creatordata as Kingdata3e
on

(creators3.creatordataid=Kingdata3e.creatordataid and itemcreators0.creatortypeid!=1 AND itemcreators1.creatortypeid!=1 AND itemcreators2.creatortypeid!=1 AND itemcreators3.creatortypeid=3)

left join itemdata as abstractdata

on items.itemid=abstractdata.itemid and abstractdata.fieldid=90

left join itemdatavalues as abstractvalues
on abstractdata.valueid=abstractvalues.valueid
left join itemdata as booktitledata

on items.itemid=booktitledata.itemid and booktitledata.fieldid=115

left join itemdatavalues as booktitlevalues
on booktitledata.valueid=booktitlevalues.valueid
left join itemdata as yeardata
on items.itemid=yeardata.itemid and yeardata.fieldid=14
left join itemdatavalues as yearvalues
on yeardata.valueid=yearvalues.valueid
left join itemdata as titledata
on items.itemid=titledata.itemid and titledata.fieldid=110
left join itemdatavalues as titlevalues
on titledata.valueid=titlevalues.valueid
left join itemdata as thesisdata
on items.itemid=thesisdata.itemid and thesisdata.fieldid=69
left join itemdatavalues as thesisvalues
on thesisdata.valueid=thesisvalues.valueid
left join itemdata as journaldata

on items.itemid=journaldata.itemid and journaldata.fieldid=12

left join itemdatavalues as journaldatavalues
on journaldata.valueid=journaldatavalues.valueid
left join itemdata as journalvolumedata

on items.itemid=journalvolumedata.itemid and journalvolumedata.fieldid=4

left join itemdatavalues as journalvolumedatavalues

on journalvolumedata.valueid=journalvolumedatavalues.valueid

left join itemdata as journalissuedata

on items.itemid=journalissuedata.itemid and journalissuedata.fieldid=5

left join itemdatavalues as journalissuedatavalues
on journalissuedata.valueid=journalissuedatavalues.valueid
left join itemdata as placedata
on items.itemid=placedata.itemid and placedata.fieldid=7
left join itemdatavalues as placedatavalues
on placedata.valueid=placedatavalues.valueid
left join itemdata as publisherdata

on items.itemid=publisherdata.itemid and publisherdata.fieldid=8

left join itemdatavalues as publisherdatavalues
on publisherdata.valueid=publisherdatavalues.valueid
left join itemdata as pagesdata
on items.itemid=pagesdata.itemid and pagesdata.fieldid=10
left join itemdatavalues as pagesdatavalues
on pagesdata.valueid=pagesdatavalues.valueid
left join itemtags
on items.itemid=itemtags.itemid
left join tags
on itemtags.tagid=tags.tagid
left join collectionItems
on items.itemid=collectionItems.itemid
left join collections
on collectionItems.collectionID=collections.collectionID
left join itemattachments
on items.itemid=itemattachments.sourceitemid
left join itemseealso as SeeAlsoOut
on items.itemid=SeeAlsoOut.itemid
left join itemseealso as SeeAlsoIn
on items.itemid=SeeAlsoIn.linkeditemid
left join itemdata as seealsooutTitledata

on seealsoout.linkeditemid=seealsooutTitledata.itemid and seealsooutTitledata.fieldid=110

left join itemdata as seealsoinTitledata

on seealsoin.itemid=seealsoinTitledata.itemid and seealsoinTitledata.fieldid=110

left join itemdatavalues as seealsooutTitledatavalues

on seealsooutTitledata.valueid=seealsooutTitledatavalues.valueid

left join itemdatavalues as seealsoinTitledatavalues

on seealsoinTitledata.valueid=seealsoinTitledatavalues.valueid

left join itemnotes as outnotes
on seealsoout.linkeditemid=outnotes.itemid
left join itemnotes as innotes
on seealsoin.itemid=innotes.itemid
where items.itemtypeid!=14
group by items.itemid
;
</source>
<RecordIDField>zotero_id</RecordIDField>

<RecordStatus>IDimportType    ADD    update</RecordStatus>

<RecordDateField>dateupdate</RecordDateField>
<LastUpdate>2010-11-28 07:19:15</LastUpdate>
 
 

<edit> I should point out that I have tested the SQL using SQLite manager in Firefox, and it works fine. </edit>

10. Some questions which I have concerning this configuration file include:
What is the significance of the RecordStatus line towards the end of the configuration file; and is it correct?
What datatype should the field Zotero_ID have?

11. And then of course the really big question, what I done wrong and what can I do to fix it?

Thanks as always.

Comments

This is interesting as I recently had a discussion with Pierre about IQ & reference manager integration. Which basically means IQ/Zotero... since EndNote and others are mostly proprietary.
 
I was thinking about that this morning and came to the  conclusion that if IQ could  1- work with several DB at once, 2- read/write Zotero DB, it could become the perfect tool  for a researcher. IQ would bring flexibility to Zotero (possibility to add notes as children, links to other items etc.) and Zotero would bring the formatting capabilities, word plugins,  bibliographical meta data retrieval, etc.
 
Add to this IQ's future capability of editing multiple items t once in the HTML pane, with better styling capabilities and almost perfect MS Word import and... voilà!
 
 
-------------------------------------------------------
Windows 8.1
Sony Vaio S Series 13 (SVS131E21L)
Ram:8gb, CPU: Intel i5-3230M, 2.6ghz

gregory

2014/12/12 00:55

In reply to by Armando

Hi Armando.
 
Once again, I entirely agree with you. InfoQube is nearly "there", where "there" is that it has become the basis of a very useful personal information management system. I am not religiously committed to open source software, and frequently buy good proprietary software. I anticipate purchasing InfoQube when finally it reaches version 1 – it is the least I can do after the years of help that Pierre and you and the IQ community have provided to me. Zotero, which is open source software, is an extremely good reference manager. Among the things I particularly like about it are the fact that it is web based, rather than simply integrated with the web as earlier products such as EndNote and RefWorks. I have also found that the Zotero support is in practice excellent. But for me, a pragmatic reason for preferring Zotero to any other reference manager is the very fact that it uses a database and that it is possible to integrate that database with other information management products.

I have spent years looking for, and hoping for, a better relational database management system for individuals and small groups than Microsoft Access. I am deeply unimpressed by most of the alternative solutions that are on offer. Quite simply, they do not offer the combination of ease-of-use, power of UX and cost of ownership that Access does. I use Access for structured data and IQ for semistructured data and for information management where hierarchies and multiple parents are essential – Microsoft Access does these but only with great difficulty. At long last, Microsoft Access is web-accessible (version 2013). I shall persist in its usage for a little longer, and would love to be able to integrate Microsoft Access and InfoQube and Zotero/SQLite at one and the same time. With Pierre's active help, I anticipate getting the InfoQube and Zotero integration working well in the near future. I shall report on my experiences later, but I am already using InfoQube very well both for classification ("what kind of a thing is it? is it a bird, is it a plane, or is it just Superman" – mutually exclusive) and for categorisation / tagging - is it blue?, is it yellow, does it fly?, does it love journalists? (Superman has all of these properties, a canary has two of them, and I have none.) To be able to integrate Microsoft Access, and InfoQube, and SQLite at one and the same time would be great. I can for now survive with choosing which database – SQLite or Microsoft Access – to integrate with each time that I use the product.
 
Mark GREGORY, Redon, France - GMT +1/+2; EST +6

gregory

2015/01/16 05:26

In reply to by Armando

This is just an update to say that we are still actively working on getting this to work well. The SQL SELECT statement will not work in its present form because it depends upon SQL syntax (coalesce, group_concat) which works in SQLite but which is not supported by the JET database engine which underlies InfoQube.
 
Armando: I very much agree with you that the ability to work with more than one database at a time (in my case, SQLite and Microsoft Access), and improved interchange between the HTML pane and Microsoft Word: would be the icing on the cake, the cherry on the gateau. The cake, integration with the SQLite database underlying Zotero, is tantalisingly within reach… More soon.
 
Mark GREGORY, Redon, France - GMT +1/+2; EST +6

Armando

2015/01/16 11:07

In reply to by gregory

[quote=gregory]
 The cake, integration with the SQLite database underlying Zotero, is tantalisingly within reach… More soon.
[/quote]
 
Thanks for the update! If that works it would be great!
 
-------------------------------------------------------
Windows 8.1
Sony Vaio S Series 13 (SVS131E21L)
Ram:8gb, CPU: Intel i5-3230M, 2.6ghz

Update on this interesting avenue...
 
I've been working with IQUser gregory and have come up with an very nice and flexible setup, whereby MS Access is used as a easy to use bridge between IQ and SQLite.
We can now import Zotero citation information into IQ. Changes made in Zotero will update relevant IQ entries
 
We'll keep you all updated !
 
Pierre_Admin
 
 
 

Armando

2015/06/17 00:20

In reply to by Pierre_Admin

[quote=Pierre_Admin]
Update on this interesting avenue...
 
I've been working with IQUser gregory and have come up with an very nice and flexible setup, whereby MS Access is used as a easy to use bridge between IQ and SQLite.
We can now import Zotero citation information into IQ. Changes made in Zotero will update relevant IQ entries
 
We'll keep you all updated !
 
Pierre_Admin
 
[/quote]
 
That could be extremely useful. I'd have t modify my worfklow to use Zotero, though. I still need endnote for formatting and searching libraries.
 
-------------------------------------------------------
Windows 8.1
Sony Vaio S Series 13 (SVS131E21L)
Ram:8gb, CPU: Intel i5-3230M, 2.6ghz

gregory

2015/06/17 06:55

In reply to by Armando

Hi Armando. As Pierre has already stated, we have got this working effectively. I will write up our experiences and the best approach – but I dare not do this now, because I must complete my PhD thesis by the end of August.
 
Mark GREGORY, Redon, France - GMT +1/+2; EST +6

Armando

2015/06/17 13:15

In reply to by gregory

[quote=gregory]
Hi Armando. As Pierre has already stated, we have got this working effectively. I will write up our experiences and the best approach – but I dare not do this now, because I must complete my PhD thesis by the end of August.
 
Mark GREGORY, Redon, France - GMT +1/+2; EST +6
[/quote]
 
Wise decision... I have to complete some stuff for the end of June and July too. End of thesis maybe next year.
 
-------------------------------------------------------
Windows 8.1
Sony Vaio S Series 13 (SVS131E21L)
Ram:8gb, CPU: Intel i5-3230M, 2.6ghz

Bumping this thread to the TOP! :)
So will we finally get to know how to use Zotero with IQ?
-
IQ geek
Windows 8.1
CPU: Intel i5 2.6ghz