Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
dev:client_coding:direct_sqlite_database_access [2017/11/12 19:53]
127.0.0.1 external edit
dev:client_coding:direct_sqlite_database_access [2017/12/18 09:02] (current)
bwiernik Move data model information into this page
Line 14: Line 14:
  
 Also be aware that the SQLite database structure can change between Zotero releases. Also be aware that the SQLite database structure can change between Zotero releases.
 +
 +====== Zotero Client Data Model ======
 +
 +Each bibliographic record in Zotero has an "item type" (book, journal article, thesis...), a set of fields (author, title, date...), and field values. The selection of fields depends on the item; for instance, a thesis has a "​university"​ field which other items do not have.
 +
 +Item types and fields are defined in [[https://​www.zotero.org/​trac/​browser/​extension/​branches/​2.0/​system.sql|system.sql]] and translated in [[https://​www.zotero.org/​trac/​browser/​extension/​branches/​2.0/​chrome/​locale/​en-US/​zotero/​zotero.properties|zotero.properties]]. In theory you can change and add item types and fields, but this may make your installation of Zotero incompatible with other users and future releases---import routines and citation formats may not work anymore. If you need to add additional information to your records, you should use the "​extra"​ field that is available for all item types. Zotero can be used in many languages, but you should always refer to item types and fields with their internal name as defined in ''​system.sql''​ and used in ''​zotero.properties''​.
 +
 +In addition to the basic item types and fields, each item can have associated user data as defined in [[https://​www.zotero.org/​trac/​browser/​extension/​branches/​2.0/​userdata.sql|userdata.sql]]. This includes:
 +  * a set of notes
 +  * a set of attachments
 +  * a set of tags
 +  * a set of links to related items
 +
 +Attachments (PDFs, snapshots, etc.) are stored inside the [[:​zotero_data|Zotero data directory]],​ in separate subdirectories named after the ID of the item they belong to.
 +
 +For a comprehensive list of the internal names of fields, their English equivalents,​ and their CSL mappings, if applicable, see the [[http://​gsl-nagoya-u.net/​http/​pub/​csl-fields/​index.html|CSL/​Zotero Metadata Field Index]]. Similar mappings, and the creator roles available for each item type, can be [[dev:​web_api:​write_api#​item_typefield_requests|retrieved from the Zotero server API]].
 +
 +===== Schema Spy =====
 +
 +The comprehensive way of learning about Zotero'​s database structures is by digging into the [[https://​www.zotero.org/​trac/​browser/​extension/​branches/​2.0|.sql files]]. Here is, however, some automatically generated database documentation (created by [[http://​schemaspy.sourceforge.net/​|SchemaSpy]]):​
 +
 +  * for the [[http://​zomark.github.com/​zotero-marc/​schema/​trunk/​|trunk (2010-10-19)]]
 +  * for the [[http://​zomark.github.com/​zotero-marc/​schema/​multilingual/​|multilingual branch (2010-10-19)]]
dev/client_coding/direct_sqlite_database_access.txt ยท Last modified: 2017/12/18 09:02 by bwiernik