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

literal As 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
!type Node must match the rules defined for type
!or OR between two or more blocks
!types Define 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 *


AltStyle によって変換されたページ (->オリジナル) /