Meta format

This section describes specifications of Meta WEB types and format basics.

Introduction

MetaWEB formats are JSON based files retreived by HTTP or local filesystem which replaces HTML as application platform for a web and mobile.

MetaWEB formats describes logical objects (documents) with meta-data so they can be displayed in UI and processed by machines. These meta-data provides information about document properties and actions. Actions just submits data to server in simmilar way as HTML forms.

Basic MetaWEB file

{
    "@doctype": "meta/resource"
    ...
}

Vendor specific type

{
    "@doctype": "cz.cryonix/net/dummy"
    ...
}

Overview

MetaWEB files are written in JSON format and has mime type application/x.meta+json.

Every Meta file must has document type specified as @doctype property.

MetaWEB is meant to be extensible so every standard type is prefixed by meta/ string.

Extended types should be in format <vendor>/[package/]<type>.

Vendor specific types should be used only in extreme cases where custom software extension is needed and there is no standard way how to achive desired functionality.

Two-layer principle

Two-layer principle is based on idea to separate data and meta-data.

MetaWEB types are descriptive so they are describing behaviour of resources but are not containing data.

Data are fetched from external resources but MetaWEB types are specifying where to find them and how to represent them.

Basic example

Imagine that we have database of customers. MetaWEB describes customer properties and actions (first layer) and it also specifies URL of data (second layer).

User requests MetaWEB resource and browser figures out where data are located. Browser then loads these data and displayes them as specified.

If datasource supports Web events then browser can listen to data changes and updates them in real-time.

String interpolation

Many MetaWEB types has properties which supports string interpolation.

String interpolation means possibility to specify dynamic part of string based on document model.

Interpolated variables are written in double-bracket format: Hello {{$name}}.

How to read documentation

In property tables:

  • * specifies if property is required
  • # specifies if string interpolation is supported