Some MgdSchema notes

Here are quick notes from today's MgdSchema discussions with Piotras.

  • The idea is to define Midgard objects in XML the same way as Repligard does
  • Current status of MgdSchema is an app that parses the schema and displays it as debug info
  • The object definitions will be reloaded every time Midgard is started
  • MgdSchema will provide the object types as GObjects
  • The GObjects are stored using the Gnome-DB abstraction layer
  • When mgd_get_article() is called, the PHP binding will get the GObject from Midgard core instead of making its own queries

On the database backend, the object would be split to three or five tables. GUIDs will be used for linking same record between tables:

schema's own table (based on the XML file, same name as schema) with all the properties from the schema.

abcCool newsBlah blah blah...

metadata table with Midgard ownership and metadata info:


membership table for tree structures and ownerships:


record_extension table (parameter API)


localization table (for MultiLangable fields)


The way forward:

  1. Schema loading/parsing
  2. GObjectization of the schema
  3. Object persistence through Gnome-DB
    • Query API (query and fetch)
    • Storage API (create and update)
    1.7 release
  4. PHP5 bindings for the object
  5. Object serialization
    • Repligard-like tool based on MgdSchema
  6. More complete database handling
    • Modification of database tables based on loaded schemas
  7. Complete "Classic Midgard" schemas
  8. 1.x compatibility API written in PHP (Midgard Lite like)

Updated 17:27: Since the gathering has been mostly on agenda, and my talking points are mostly handled, we can focus the main thing of any Midgard event:


Read more Midgard posts.