OML/CKML Grammar

~ Under Construction ~

Based upon the extremely tight coupling that is being developed between the core part of RDF/S and Simple OML, the full OML/CKML grammar will soon receive a major update.

Overview

Since CKML is an extension of OML, the CKML grammar is an extension of the OML grammar. The grammar for the OML subset is in blue. The CKML extension to OML is in red. The OML/CKML grammar may be the first time a framework using XML and equivalent to predicate logic has been placed on the Internet. For these reasons, at least three versions of OML are being considered; each one for a different purpose.

Step by Step from RDF to CKML
 
Standard OML
Using formal grammars is a more familiar way than DTDs to specify the syntax of a language. The section includes a preliminary grammar for Standard OML in Extended Backus-Naur Form (EBNF). We consider this to be the most natural version of OML.
Abbreviated OML
OML has an abbreviated form that, among other things, replaces lambda/quantifier brackets with lambda/quantifier attributes, eliminates function and argument elements, and replaces the function-star expressions in object type definitions by arbitrary expressions in the knowledge base catalogue of individuals. A grammar for Abbreviated OML is now under development. We will recommend to the conceptual graph community that the abbreviated form of OML serve as a base for the development of a Conceptual Graph Markup Language.
Simple OML
RDF/Schemas has the structure of a semantic network. It corresponds to simple conceptual graphs, which are conceptual graphs without negations, universal quantifiers and nested conceptual contexts. To support metadata interoperability, the part of OML that corresponds to RDF with Schemas (expressions with no negations, implications, conceptual contexts, or universal quantifiers) will be demarcated as Simple OML. A grammar for Simple OML has been developed and translations from Simple OML RDF/Schemas are being planned. We will develop Java Serialization using Simple OML, an easy port from our already developed code for Java Serialization using RDF with Schemas. We are investigating in what sense OML parsing & Java serialization are adjoint operations.

CKML Serialization Syntax (Grammar)

CKML uses the Extensible Markup Language (XML) encoding as its syntax. The syntax descriptions below use the Extended Backus-Naur Form notation, as defined in section 6, Notation of the XML specification, to describe the essential CKML syntax elements. The requirement, that the property and type names in end-tags exactly match the names in the corresponding start-tags, is implied by the XML rules. CKML does not require the XML namespace facility, currently under review by the XML Working Group, to associate the types in an ontology, by way of its URI, with the instances in a collection. Instead, CKML defines its own (more flexible, abstract and ontologically-oriented) namespace rules.

The CKML serialization syntax takes the following form. The grammar is semantically divided up into several collections of production rules: the outer CKML bracket starting with the 'ckml' nonterminal; the type rules starting with the 'ontology' nonterminal; the instance rules starting with the 'collection' nonterminal; the incidence rules (between instance (token) and type) starting with the 'localLogic' nonterminal; the logical expression rules starting with the 'expr' nonterminal; the attribute rules; and some basic XML rules.


ckml               ::= '<CKML>' ontology | collectionInstance | localLogicInstance '</CKML>'

ontology ::= '<Ontology' idAttr displayAttr? dateAttr? creatorAttr? versionAttr prefixAttr? '>' (comment? (extends | specification | axiom)*) '</Ontology>' extends ::= '<extends' ontologyTheoryAttr prefixAttr '/>' specification ::= assertion | object | relation | binrel | function | collection | constant | product | sum | theory | interpretation axiom ::= sequent | synonymous | subtype | disjoint | partition | transpose | inverse assertion ::= '<Assertion' idAttr? textAttr? '>' comment? expr '</Assertion>' object ::= objectAtomic | objectDefined objectAtomic ::= '<Object' declTypeAttr shortAttr? dateAttr? creatorAttr? '>' (comment? fnTail*) '</Object>' objectDefined ::= '<Object' declTypeAttr shortAttr? dateAttr? creatorAttr? varAttr genusAttr '>' (comment? expr) '</Object>' objectInterpreted ::= '<Object' referencedTypeAttr varAttr genusAttr '>' (comment? expr) '</Object>' product ::= '<Product' declTypeAttr firstAttr secondAttr (('>' comment '</Product>') | '/>') /* objects */ sum ::= '<Sum' declTypeAttr firstAttr secondAttr (('>' comment '</Sum>') | '/>') /* objects */ relation ::= relationAtomic | relationDefined relationAtomic ::= '<Relation' declTypeAttr shortAttr? dateAttr? creatorAttr? '>' (comment? fnTail*) '</Relation>' relationDefined ::= '<Relation' declTypeAttr shortAttr? dateAttr? creatorAttr? '>' (comment? functionLambda*) '</Relation>' collection ::= collectionAtomic | collectionDefined collectionAtomic ::= '<Collection' declTypeAttr genusAttr? (('>' comment '</Collection>') | '/>') collectionDefined ::= '<Collection' declTypeAttr? varAttr genusAttr '>' (comment? expr) '</Collection>' binrel ::= '<BinaryRelation' declTypeAttr srcTypeAttr tgtTypeAttr (('>' comment '</BinaryRelation>') | '/>') function ::= functionAtomic | functionDefined functionAtomic ::= '<Function' declTypeAttr srcTypeAttr tgtTypeAttr (('>' comment '</Function>') | '/>') functionDefined ::= '<Function' declTypeAttr varAttr srcTypeAttr '>' (comment? (collectionDefined | relationDefined)) '</Function>' fnTail ::= '<Function' declTypeAttr srctgtTypeAttr (('>' comment '</Function>') | '/>') functionLambda ::= '<Function' declTypeAttr varAttr tgtTypeAttr '>' (comment? (functionLambda | expr)) '</Function>' theory ::= ('<Theory' declTypeAttr genusAttr? '>' /* new theory */ (comment? extends* objectAtomic* (sequent | synonymous | subtype | disjoint | partition)* interpretation* theory* ) '</Theory>') | ('<Theory' declTypeAttr ontologyAttr genusAttr? /* embedded ontology */ | ('>' comment '</Theory>') | '/>') interpretation ::= '<Interpretation' declTypeAttr fnTypeAttr '>' (comment? objectInterpreted*) '</Interpretation>' localLogic ::= ('<LocalLogic declTypeAttr theoryAttr /* given theory */ (('>' comment '</LocalLogic>') | '/>')) | ('<LocalLogic declTypeAttr binrelTypeAttr theoryAttr /* direct scaling */ (('>' comment '</LocalLogic>') | '/>')) | ('<LocalLogic declTypeAttr interpretationAttr /* simple scaling */ (('>' comment '</LocalLogic>') | '/>')) | ('<LocalLogic declTypeAttr relTypeAttr '>' /* relational scaling */ (comment? argumentInterpreted*) '</LocalLogic>') argumentInterpreted ::= ('<Argument' referencedTypeAttr '>' '<Interpretation' referencedTypeAttr '>' '</Argument>') | ('<Argument' referencedTypeAttr interpretationAttr '/>') sequent ::= '<sequent>' (comment? ('<' typeNSname '>')* '<entails/>' ('<' typeNSname '>')* ) '</sequent>' synonymous ::= '<synonymous' firstAttr secondAttr? (('>' comment '</synonymous>') | '/>') subtype ::= '<subtype' specificAttr genericAttr? (('>' comment '</subtype>') | '/>') disjoint ::= '<disjoint>' comment? ('<' typeNSname '>')* '</disjoint>' partition ::= '<partition>' comment? ('<' typeNSname '>')* '</partition>' transpose ::= '<transpose' firstAttr secondAttr (('>' comment '</transpose>') | '/>') /* binary relations */ inverse ::= '<inverse' firstAttr secondAttr (('>' comment '</inverse>') | '/>') /* functions */
collectionInstance ::= '< typeNSname idAttr? ontologyAttr? '>' (comment? (objectInstance | relationInstance | binrelInstance | functionInstance | collectionInstance | localLogicInstance)*) '</ typeNSname >' localLogicInstance ::= '<' typeNSname idAttr '>' (comment? objectInstance* typ*) '</' typeNSname '>' typ ::= '<typ objAttr '>' ('<' typeNSname '/>')* '</typ>' objectInstance ::= '<' typeNSname idObjAttr? shortAttr? aboutAttr? displayAttr? '>' (comment? fnInstTail*) '</' typeNSname '>' | '<' typeNSname idObjAttr? shortAttr? aboutAttr? '/>' | '<' typeNSname idObjAttr? shortAttr? descriptionAttr '/>' | '<' typeNSname '/>' relationInstance ::= '<' typeNSname idObjAttr? shortAttr? binrelAttr '>' (comment? fnInstTail*) '</' typeNSname '>' binrelInstance ::= '<' typeNSname srcAttr tgtAttr (('>' comment '</' typeNSname '>') | '/>') functionInstance ::= '<' typeNSname ordAttr? srcAttr tgtAttr (('>' comment '</' typeNSname '>') | '/>') fnInstTail ::= ('<' typeNSname ordAttr? '>' value '</' typeNSname '>') | ('<' typeNSname ordAttr? srctgtAttr '/>') value ::= objectInstance | string displayAttr ::= textAttr? pictureAttr? soundAttr? comment ::= '<comment>' string '</comment>'
expr ::= relationInstance | binrelInstance | functionInstance | and | or | not | implies | equiv | exists | forall and ::= '<and' argcntAttr? '>' (comment? expr*) '</and>' or ::= '<or' argcntAttr? '>' (comment? expr*) '</or>' not ::= '<not>' (comment? expr) '</not>' implies ::= '<implies>' (comment? expr expr) '</implies>' equiv ::= '<equiv>' (comment? expr expr) '</equiv>' exists ::= '<Exists' varAttr referencedTypeAttr '>' (comment? expr) '</Exists>' forall ::= '<Forall' varAttr referencedTypeAttr '>' (comment? expr) '</Forall>'
dateAttr ::= 'date.created = "' date '"' creatorAttr ::= 'creator = "' agent '"' idObjAttr ::= idAttr | objAttr prefixAttr ::= 'prefix = "' name '"' /* prefix part of namespace name 'prefix:type#id' */ declTypeAttr ::= 'type = "' name '"' /* type part of namespace name 'prefix:type#id' */ idAttr ::= 'id = "' name '"' /* id part of namespace name 'prefix:type#id' */ shortAttr ::= 'short = "' name '"' /* short form of either type or id part of namespace name */ varAttr ::= 'var = "' name '"' objAttr ::= 'obj = "' instanceNSname '"' descriptionAttr ::= 'description = "' instanceNSname '"' ordAttr ::= 'order = "' order '"' srctgtAttr ::= srcAttr | tgtAttr srcAttr ::= 'src = "' instanceNSname '"' tgtAttr ::= 'tgt = "' instanceNSname '"' referencedTypeAttr ::= 'type = "' typeNSname '"' /* in collection, functionLambda, exists, forall */ srctgtTypeAttr ::= srcTypeAttr | tgtTypeAttr srcTypeAttr ::= 'srcType = "' typeNSname '"' /* in function, argument */ tgtTypeAttr ::= 'tgtType = "' typeNSname '"' /* in function, argument */ specificAttr ::= 'specific = "' typeNSname '"' genericAttr ::= 'generic = "' typeNSname '"' binrelAttr ::= 'binrel = "' typeNSname '"' ontologyTheoryAttr ::= ontologyAttr | theoryAttr genusAttr ::= 'genus = "' typeNSname '"' /* in theory */ firstAttr ::= 'first = "' typeNSname '"' secondAttr ::= 'second = "' typeNSname '"' theoryAttr ::= 'theory = "' typeNSname '"' /* in localLogic */ interpretationAttr ::= 'interpretation = "' typeNSname '"' /* in localLogic */ fnTypeAttr ::= 'fnType = "' typeNSname '"' /* in localLogic */ binrelType ::= 'binrelType = "' typeNSname '"' /* in localLogic */ relTypeAttr ::= 'relType = "' typeNSname '"' /* in localLogic */ versionAttr ::= 'version = "' versionNumber '"' indexAttr ::= 'index = "' number '"' argcntAttr ::= 'argcnt = "' number '"' textAttr ::= 'text = "' string '"' pictureAttr ::= 'picture = "' URI-reference '"' soundAttr ::= 'sound = "' URI-reference '"' aboutAttr ::= 'about = "' URI-reference '"' ontologyAttr ::= 'ontology = "' URI-reference '"'
URI-reference ::= string, interpreted per [URI] name ::= (any legal XML name symbol) versionNumber ::= (a version number following the XML specification) instanceNSname ::= [ typeNSname '#' ] name typeNSname ::= [ name ':' ] name date ::= (any legal CKML Date instance) agent ::= (any legal CKML Agent instance) number ::= (any legal XML number symbol) order ::= 'less' | 'lessEqual' | 'equal' | 'greater' | 'greaterEqual' string ::= (any XML text, with "<", ">", and "&" escaped)

 

Please send questions, comments and
suggestions about this page to:
Robert E. Kent rekent@eecs.wsu.edu

Last modification date: February 1999