Simple OML Grammar

Overview

We first define a grammar with no relations embedded in objects, whether types or instances. We will call that a relation-centric grammar. We try to be as close as possible to the Simple OML diagram. Although we have included function types and instances, we have not included the explicit specification of reification.

Relation-centric Grammar

oml bracket rule

 

 [1] oml            ::= ‘<OML>’ ontology | collection ‘</OML>’

 

ontology type rules

 

 [2] ontology   ::= ‘<Ontology>’ (ext | typ | axm)* ‘</Ontology>’

 [3] ext        ::= ‘<extends’ ontologyAttr prefixAttr ‘/>’

 [4] typ        ::= objType | binrelType | fnType

 [5] objType    ::= ‘<Type.Object’ declTypeAttr ‘/>’

 [6] binrelType ::= ‘<Type.BinaryRelation’ declTypeAttr srcTypeAttr tgtTypeAttr ‘/>’

 [7] fnType     ::= `<Type.Function’ declTypeAttr srcTypeAttr tgtTypeAttr '/>'

 [8] axm        ::= ‘<subtype’ specificAttr genericAttr? ‘/>’

 

collection instance rules

 

 [9] collection     ::= ‘<Collection’ idAttr? ontologyAttr? ‘>’ inst* ‘</Collection>’

[10] inst           ::= objInst | binrelInst | fnInst

[11] objInst        ::= ‘<Instance.Object’ idAttr? aboutAttr? ‘/>’

                          (classInst | binrelInst | fnInst)*

                        ‘</Instance.Object>’

[12] binrelInst     ::= ‘<Instance.BinaryRelation’ typAttr tgtInstAttr ‘/>’

[13] fnInst         ::= ‘<Instance.Function’ typAttr tgtInstAttr ‘/>’

[14] classInst      ::= ‘<classification’ typAttr ‘/>’

 

attribute rules

 

[15] ontologyAttr   ::=        ‘ontology = "’ URI-reference ‘"’

[16] prefixAttr     ::=          ‘prefix = "’ name ‘"’

[17] declTypeAttr   ::=            ‘name = "’ name ‘"’

[18] srcTypeAttr    ::=     ‘source.Type = "’ typeNSname ‘"’

[19] tgtTypeAttr    ::=     ‘target.Type = "’ typeNSname ‘"’

[20] specificAttr   ::=        ‘specific = "’ typeNSname ‘"’

[21] genericAttr    ::=         ‘generic = "’ typeNSname ‘"’

[22] typAttr        ::=            ‘type = "’ typeNSname ‘"’

[23] tgtInstAttr    ::= ‘target.Instance = "’ instanceNSname ‘"’

[24] idAttr         ::=              ‘id = "’ name ‘"’

[25] aboutAttr      ::=           ‘about = "’ URI-reference ‘"’

 

basic XML rules

 

[26] typeNSname     ::= [ name ':' ] name

[27] instanceNSname ::= [ typeNSname '#' ] name

[28] URI-reference  ::= string, interpreted per [URI]

[29] name           ::= (any legal XML name symbol)

[30] string         ::= (any XML text, with "<", ">", and "&" escaped)

 

Note

As indicated in the XML specification document an attribute name must be of the following form. In particular, the ‘.’ is appropriate inside attribute names.

 

 

NameChar ::= LetterDigit | ‘.’ | ‘-‘ | ‘_’ | ‘:’ | CombiningCharExtender       

Name     ::= (Letter | ‘_’ | ‘:’) (NameChar)*

 

 

é

Please send questions, comments and suggestions about this page to: Robert E. Kent rekent@ontologos.org

Copyright © 1999 TOC (The Ontology Consortium). All rights reserved.