OGDL Schema Specification

Revision 2015.9, September 2015

1. Introduction

This specification defines a method of writing OGDL documents that act as schemas for other OGDL documents. A schema is a definition of a type. Some basic types are already defined, and schemas are just complex types.

This specification is far from finished. The use of schemas in the context of OGDL has yet to be proved useful.

2. Syntax

literalAs is
/regexp/Node must match the given regular expression
spec+One or more times
spec*Zero or more times
spec?Optional (zero or one time)
*Any node
**Any graph
!typeNode must match the rules defined for type
!orOR between two or more blocks
!typesDefine new types

3. Predefined types

boolean | bool     true | false
string             Unicode string 
int                Integer (unspecified size)
float              Floating point number (unspecified size) 
binary             Binary object

4. Example

!types
   email "/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$./"
   visa-card "/^4[0-9]{12}(?:[0-9]{3})?$/"
   string-100 
      !string max-length 100

contact*
    name  !string-100
    email !email
    id    !int
    visa  !visa-card
    notes *