Schema

ENDPOINT /api/schema/data-model (GET only)

Each Haplo application has its own schema. There is a common schema, which is usually present, but the administrators of that system may have augmented it.

The returned schema has the format:

  • schema
    • qualifiers
      • qualifier * – represents a qualifier
        • ref – objref used to refer to this qualifier
        • name – ‘short name’ used to refer to this qualifier
        • display_name
          • TEXT – name displayed to the user
    • attributes
      • attribute * – represents an attribute
        • ref – objref used to refer to this attribute
        • name – ‘short name’ used to refer to this attribute
        • vtype – usual data type of the attribute (see below for list)
        • display_name
          • TEXT – name displayed to the user
        • allowed_qualifiers ? – qualifiers to be used on this attibute
          • null_qualifier ? – no qualifier is allowed
          • qualifier *
            • ref – reference of an allowed qualifier
    • aliased_attributes
      • aliased_attribute * – represents an aliased attribute
        • ref – objref used to refer to this aliased attribute
        • name – ‘short name’ used to refer to this aliased attribute
        • alias_of – objref of attribute this aliases
        • display_name
          • TEXT – name displayed to the user
    • types
      • type * – represents a type
        • ref – objref used to refer to this type
        • name – ‘short name’ used to refer to this type
        • root_type – ref of root type (equal to ref if this is a root type)
        • parent ? – ref of parent type if this is not a root type
        • display_name
          • TEXT – name displayed to the user
        • behaviours ? – list of labels applied to this type (see below)
          • behaviour +
            • ref – objref of behaviour
        • attributes ? – list of attributes + aliased attributes which the editor presents to the user (ROOT TYPE ONLY)
          • attribute *
            • ref – ref of this attribute OR aliased attribute

Aliased attributes

Aliased attributes are included in the schema “for information only”. Aliased attributes are applied in the user interface only. Stored objects use the underlying attributes, and when writing objects using this API, aliased attributes cannot be used.

Data types

  • 0 – Objref
  • 2 – Integer
  • 4 – Datetime
  • 5 – Boolean
  • 16 – Text
  • 24 – Paragraph text
  • 25 – Document text
  • 27 – File identifier
  • 28 – ISBN identifier
  • 29 – Email address identifier
  • 30 – URL identifier
  • 32 – Telephone number
  • 33 – Multiline text
  • 35 – Person’s name
  • 36 – Postal address

Type behaviours

  • 1z68 – type is a classification type
  • 1z69 – type represents a physical object

Example

<?xml version="1.0" encoding="UTF-8"?>
<schema>
  <qualifiers>
    <qualifier name="alternative" ref="3y8">
      <display_name>Alternative</display_name>
    </qualifier>
    ...
  </qualifiers>
  <attributes>
    <attribute vtype="0" name="type" ref="x2">
      <display_name>Type</display_name>
      <allowed_qualifiers>
        <null_qualifier/>
      </allowed_qualifiers>
    </attribute>
    <attribute vtype="16" name="title" ref="x3">
      <display_name>Title</display_name>
      <allowed_qualifiers>
        <null_qualifier/>
        <qualifier ref="3y8"/>
      </allowed_qualifiers>
    </attribute>
    ...
  </attributes>
  <aliased_attributes>
    <aliased_attribute alias_of="9w4" name="review" ref="325">
      <display_name>Review</display_name>
    </aliased_attribute>
    ...
  </aliased_attributes>
  <types>
    <type name="event" root_type="209y" ref="209y">
      <display_name>Event</display_name>
      <attributes>
        <attribute ref="x3"/>
        <attribute ref="x9"/>
        <attribute ref="x2"/>
        <attribute ref="25y"/>
        <attribute ref="263"/>
        <attribute ref="190"/>
        <attribute ref="262"/>
        <attribute ref="25q"/>
        <attribute ref="9w5"/>
        <attribute ref="325"/>
        <attribute ref="9w6"/>
        <attribute ref="x5"/>
      </attributes>
    </type>
    <type parent="209y" name="networking" root_type="209y" ref="20q0">
      <display_name>Networking</display_name>
    </type>
    ...
  </types>
</schema>