Moseycode Markup Language
(0.1 preview)

This document is not yet complete.

The Moseycode barcode system is based on storing information in chambers that are accessible through portals. The chamber information is stored in an open, platform independent, XML format. This document lays-out some of the details of its schema. A fuller specification will be published once the format has been developed more fully.

Note that this document assumes a good degree of familiarity with xml.

Overview

The key aim of this markup language is to provide an effective way for authors to control the appearance, content and operation of Moseycode portals. In addition to this, the language has been designed to:

Document Structure

<chamber> <authorship> <name> </name> <title> </title> <created timestamp=""> </created> <modified timestamp=""> </modified> <location lon="" lat="" ele=""> </location> <comments> </comments> <agents> <agent namespace=""> </agent> </agents> </authorship> <data> <tokens> <token name="" from="" to="" encoding=""/> </tokens> <lookups> <url name="" source=""/> </lookups> </data> <flavors> <direct/> <communicate/> <present/> <authenticate/> <interact/> </flavors> <content> <media rel=""> <title> </title> <description> </description> <image|movie|audio|model url="" width="" height="" size="" rate=""/> </media> <contact> <role organization=""> <fixed-tel> </fixed-tel> <mobile-tel> </mobile-tel> <email> </email> <webpage> </webpage> <job-title> </job-title> <address> </address> </role> </contact> <document url="" type=""> </document> </content> <display> <erasure type="" color=""> <loading type=""> <present-style type=""> </display> </chamber>

Chamber Document

A documents authored in the markup language described in below is typically referred to as a chamber document. All elements in a chamber document reside in the namespace:

http://www.moseycode.com/SCHEMA/chamber

At present this is a purely symbolic URL. In what follows, the namespace will be implicit in the stated element names. Though all elements reside in this namespace, no attributes names are namespaced.

The root element of all chamber documents is chamber. This element may contain at most one of any of the following elements in any order:

authorship
Records information about the author and their relationship to the chamber.
data
Specifies how the portal data should be processed.
flavors
A set of flavors that declare the portal's modes of user interaction.
content
Resources (such as media files) that support the presentation and operation of the portal.
display
Controlling the presentation of the portal.

The contents of these basic elements is detailed in the sections below.

authorship

In general, all of the information in this section of the document is at the complete discretion of the author. All of the information is optional and need only be as accurate as the author wishes it to be.

The authorship element may contain at most one of each of the following elements in any order:

name
The name of the author is recorded as character data within this element. This is the name that the author wishes to be known by for this portal; no restrictions are placed on the name.
title
The title of the portal is recorded as character data within this element. The title is completely upto the author of the document, there are no restrictions on it.
created
The date on which the portal was created is recorded as character data within this element, the format for this date is entirely unconstrained. An optional timestamp attribute provides a machine interpretable timestamp for the date. There is no requirement that these two representations are consistent and they are both optional.
modified
The date on which the portal last modified is recorded as character data within this element, the format for this date is entirely unconstrained. An optional timestamp attribute provides a machine interpretable timestamp for the date. There is no requirement that these two representations are consistent and they are both optional.
location
This element records the location at which the portal was created. It includes a human readable version (as contained character data) and geographic coordinates (as attributes). All attributes and character data is optional. The latitude is specified by the lat attribute in degrees in the range -90 to +90 (an optional S or N suffix may be used). The longitude is specified by the lon attribute in degrees in the range -180 to +180 (an optional E or W suffix may be used). The elevation is specified by the ele attribute in meters above sea level.
A reference coordinate system will be specified in future revisions of this document.
comments
The author's comments about the portal are recorded as character data within this element. These comments serve as a description of the portal.

data

The data element defines how the data associated with the portal modifies it. The element may have a revision attribute that specifies the URL of a second chamber document that augments the first. The augmenting document is not permitted to have a data element.

A precise definition of augments will be provided by future revisions of this document.

The data element contains two types of element, tokens which are grouped into a tokens element, and lookups which are grouped into a lookups element.

Each token converts a subset of the portal's data bits into a number. They are declared using a token element. The attributes of which are:

name
A name given to the token for the purpose of performing substitutions.
from
The index of the first data bit that forms part of the token. This has a default value of 0.
to
The (non-inclusive) index of the last data bit that forms part of the token. This has a default value of 48.
encoding
Specifies how the bits of the token are represented as a number. The possible values are: denary, hex and binary. All numeric representations are unsigned. This has a default value of denary.

Lookups convert portal data into textual data by performing requesting data from a remote server. A number of lookups are possible, but at present only one is supported: the url element converts the data associated with the portal into a URL obtained from the Moseycode lookup service (or an equivalently functioning service). The url element supports the following attributes:

name
A name given to the url for the purpose of performing substitutions.
source
Optionally, the address of a web service that will perform the translation from number to URL. By default this references the Moseycode lookup webservice.

flavors

The flavors element contains the flavors of interaction that the portal supports; these are contained as sub-elements, the order of these elements is potentially significant since some devices may not be capable of supporting multiple flavors and will only support the first declared flavor whereas other devices may choose to promote the first flavor. The possible flavor elements are:

direct
Directs a user to a document (typically an HTML page via a URL).
present
Presents media content (eg. pictures) to a user.
communicate
Provides a user with the option to communicate (eg. by phone or email), typically in the form of a person's contact details.
authenticate
Allows a user to be authenticated with a third-party service (eg. a website). Not yet supported.
interact
Allows a user to interact with the portal using associated scripts. Not yet supported.

content

The content element contains the references to the resources that support the portal's operation. In the case of contacts and documents, it may contain the resources directly. There are three types of resources, that are supported by the following elements:

media
Media elements store references to media resources (images, video, audio and models) and information about those resources.
document
Documents are used to embed textual information within a portal for presentation to the viewer. They are also used to provide the web addresses to which viewers may be directed.
contact
Contact information about individuals or organizations is stored directly within the document. Details stored here may be used for communication. They may be explicitly related to the author of the barcode.

All of the content elements listed above may feature a rel attribute which specifies how the content relates to the barcode. The valid relationships for an element vary depending on the type of the element. More details about each content type are given below.

media

A media element can have one of the following relationships to the portal:

Each media element may contain a title element which provides a short title for the media, and a description element which provides longer description. The element also contains one or more resource elements. These are links to resources that can be loaded over the network. In the case where more than one may be listed, the device will pick just one resource to load for that media. The choice will be based on the capabilities of the device; a memory constrained device might choose a smaller resource; a device on which audio has been muted might choose an audio resource to replace an image resource. The available resource elements are:

image
An image in a format supported by the device (typically JPG or PNG).
video
A video that can be played by the device. Not currently supported by the Moseycode application.
audio
An soundtrack that can be played by the device. Not currently supported by the Moseycode application.
model
A 3D model that can be rendered by the device. Not currently supported by the Moseycode application.

Each type of resource element can support a number of the following attributes. All of which are optional with the exception of the url.

url
The url from which the resource should be loaded
width
The width in pixels of the resource (not applicable to audio or model resources).
height
The height in pixels of the resource (not applicable to audio or model resources).
size
The size of the resource (as loaded over the network) in bytes.

document

The document element has an optional url attribute that links to the location of a document on the network. It also has an optional type attribute that specifies the content type of the document. In the absence of the document url (or if document is being presented and cannot be loaded), the textual content of the document element is used as the content of the document.

A document element can have one of the following relationships to the portal:

contact

A contact element stores the contact details of an individual. The element has a name attribute that gives the name of the contact. All other details are separated into role elements contained within the contact element. These role elements have an attribute called organization that records an organization with which the person is associated. Absence of an organization is taken to imply that the contact details are personal 'home' details. Each role can contain at most one of following elements:

fixed-tel
A landline telephone number.
mobile-tel
A mobile telephone number.
email
An email address.
webpage
The URL of a web page.
job-title
The job title in the organization.
address
The physical address associated with this role
Note that it is not presently possible to supply more than one detail of a given type in a single role. This will be addressed in a future version of the document.
In a future revision, the physical address will include (optional) geographic location attributes.

A contact element can have one of the following relationships to the portal:

display

This has not been documented yet.

Subsititution

This has not been documented yet.

Resolution

This has not been documented yet.

Miscellaneous