Base classes
All content in zena (pages, images, documents, etc) is a sub-class of the main class ‘Node’. The following diagram shows the inheritance diagram for the base classes:

The arrows mean “is a”. So the Image is a Document (behaves like a document) and the Document is a Node.
This means that when searching for Documents, you will find images as well and when searching for Pages, you will find sections and projects together with simple pages.
To identify the classes inside pseudo sql, we use the class path kpath. This is defined as the first letter of all classes in the inheritance hierarchy. For example:
Node: N
Document: ND
Image: NDI
TextDocument: NDT
Project: NPP
You can use this attribute in filters to load documents without images for example:
<r:documents where='kpath not like "NDI%"'>...</r:documents>
For the techie amongst you, we store all the data for nodes and sub-classes in a single table called nodes using single table inheritance.
Important attributes for nodes table
Attributes to secure access to the node (none can be directly used in zafu) :
site_id, rgroup_id, wgroup_id, pgroup_id, user_id
Attributes to locate the element in “space” and time :
name, fullpath, parent_id, position, project_id, section_id, event_at,
log_at, created_at, updated_at, publish_from, max_status
max_status is the maximal status of the node’s versions (published if any is already published, etc).
Other tables
The content itself is not stored in nodes but in another table called versions. The versions are used for each language of the site and to keep old redactions when new text is published. See versions for details.

Tables used for a Document with dynamic attributes.
The content of a document is not stored with versions because it would be silly to make an exact copy of an image just because the text describing it changes or because the text is translated.
Content in the versions is reached with the v_ prefix (v_title for example). Content inside the helper table (document_contents in this case) is reached with c_ prefix (c_size for example). See content tables for details.
Virtual classes
You can create your own classes which will be inserted inside this diagram. For example you might need a ‘List’ class for pages that should display nice lists of other pages:

Inheritance diagram for a virtual class.
In this example, the List objects will behave like pages. The kpath would be NPL. See virtual classes for details.