Rabbit BNF
From OWLED-Wiki
This page contains the BNF for Rabbit.
return to OWL/CNL
Contents |
Introduction
Editor's Note: I propose to use linguistic terms like 'noun', 'verb', 'phrase', etc. instead of DL terms 'concept', 'instance', etc. In general, we should use OWL terms ('class', 'individual') instead of DL terms. But these should show up in the semantics (mapping to OWL) doc, rather than here in the syntax doc.
General Structures
Basics:
char ::= <lowercase letter or digit> | - | : <lowercase letter or digit> ::= <lowercase letter> | <digit> <letter> ::= <uppercase letter> | <lowercase letter> <integer> ::= <digit> [<integer>] <noun> ::= <letter> [<noun body>] <noun body> ::= char [<noun body>] <noun or integer> ::= <noun> | <integer> <capitalised noun> ::= <uppercase letter> [<noun body>] <capitalised noun or integer> ::= <capitalised noun> | <integer> <lowercase noun> ::= <lowercase letter> [<noun body>]
Concepts:
<concept body> ::= <capitalised noun or integer> [<space> <concept body>] <concept candidate> ::= <capitalised noun> [<space> <concept body>] <concept> ::= <concept candidate> [(<concept candidate>)]
Instances:
<instance body> ::= <noun or integer> [<space> <instance body>] <instance candidate> ::= <noun or integer> [<space> <instance body>] <instance> ::= <instance candidate> [(<instance candidate>)]
Relationships:
<relationship name> ::= <lowercase noun> [<space> <lowercase noun>] <relationship> ::= <relationship name> | “<relationship name>”
Sentence Subjects and Sentence Objects
Basics required for Sentence Subject, Object or Relation phrase:
<lc indefinite article> ::= a | an <uc indefinite article> ::= A | An
Sentence subjects:
<universal subject> ::= Every <concept> <negated subject> ::= No <concept> <indefinite subject> ::= [<uc indefinite article>] <concept> <subject> ::= <universal subject> | <negated subject> | <indefinite subject>
Sentence Objects:
Basics for defining Sentence Objects
Editor's Note: In ACE, one cannot use 0 as a number in cardinality restrictions. The user is expected to phrase his/her sentence using negation in this case.
Editor's Note: Glen: I think this is reasonable and Rabbit could follow suit.
Editor's Note: ACE also supports 'more than <n>' and 'less than <n>'
<or> ::= or | , <preposition> :== of | by | for | from <preposition modifier> ::= <preposition> <concept> <named number> ::= one | two | three | four | five | six | seven | eight | nine | ten | eleven | twelve <n> ::= <Integer> | <named number> <number restriction> ::= exactly <n> | at least <n> | at most <n> <object prefix> ::= <number restriction> | <lc indefinite article>
Sentence Objects definition
<object> ::= [<object prefix>] <concept> [<preposition modifier>] <object list> ::= [<n> or more [of]] <object> <or> <object list body> <and list> ::= <object> and <and list body> <and list body> ::= <object> [and <object>] <object list body> ::= <object> [<or> object>] <compound object> ::= <object> | <object list> | <and list>
Relationship phrase:
<relationship phrase> ::= <relationship> <compound object>
Complex Sentence Object:
<complex object post-modifier> ::= <preposition modifier> | that <relationship phrase> <complex object> ::= [<object prefix>] <concept> [<complex object post-modifier>] <complex compound object> ::= <complex object> | <object list> | <and list>
Complex relationship phrase:
Editor's Note: This rule does not describe/constrain syntactic agreement, e.g. in an English text "John likes Mary. John does not like Mary.", in the first sentence the verb must be in singular, in the 2nd in infinitive. Is this a feature or a bug?
Editor's Note: Glen: This needs further investigation. What does ACE do?
Editor's Note: Kaarel: The ACE parser enforces agreement, e.g. singular subject must come with a singular verb, negated verb must be in infinitive. The lexicon that the ACE parser uses maps verb lemmas to three possible surface forms: singular (e.g. 'likes'), plural/infinitive ('like'), past participle ('liked'). The plural and infinitive forms overlap in English, that's why they are described in one form. See the ACE lexicon specification in: http://attempto.ifi.uzh.ch/site/docs/ace_lexicon.html
<complex relationship phrase> ::= <relationship> <complex compound object> <compound relationship> ::= <complex relationship phrase> [or <complex relationship phrase>] <negated compound relationship> :: = does not <compound relationship>
Concept Sentences
Concept Declaration:
Editor's Note: In ACE it is not possible to define plural, synonymous, etc. forms of content words. This is done in a lexicon (which is not written in ACE).
<plural concept> ::= plural <concept> <synonym> ::= <concept> [, <plural concept>] <synonym list> ::= <synonym> [, <synonym list>] <concept declaration> ::= <indefinite subject> is a [secondary] concept [, <plural concept>] [, synonym <synonym list>]
Concept assertions:
<subsumption phrase> ::= is a kind of <concept>
<definition relationship list> ::= <definition relationship phrase> [; <definition relationship list>]
<definition relationship phrase> ::= <compound relationship> | <negated compound relationship> | <subsumption phrase>
<all values assertion> ::= <universal subject> only <complex relationship phrase> or nothing
<closure assertion> ::= <universal subject> only <complex relationship phrase>
<concept definition> ::= <indefinite subject>is anything that: <definition relationship list>
<concept subsumption> ::= <universal subject> <subsumption phrase>
<mutual concept exclusion> ::= <concept> and <concept> are mutually exclusive
<negative assertion> ::= <negated subject> <compound relationship>
<positive assertion> ::= <universal subject> <compound relationship>
<probable assertion> ::= <indefinite subject> usually <compound relationship>
<value partition> ::= <indefinite subject> can only be <object list>
<concept assertion> ::= <all values assertion>
| <closure assertion>
| <concept definition>
| <concept subsumption>
| <mutual concept exclusion>
| <negative assertion>
| <positive assertion>
| <probable assertion>
| <value partition>
Role inclusion:
<complex concept inclusion> ::= Everything that <relationship> that <relationship> some <concept> will also <relationship> some <concept>
<general role inclusion> ::= Everything that <relationship> that <relationship> something will also <relationship> that thing
<role inclusion> ::= <general concept inclusion>
| <complex role inclusion>
Instance Sentences
Instance Declaration:
Editor's Note: Only named classes are allowed?
Editor's Note: yes
Editor's Note: 'an' is not allowed?
Editor's Note: yes, this was a mistake
<instance declaration> ::= <instance> is a <concept> | <instance is an <concept>
Instance assertions:
Editor's Note: In ACE, <same instances> would be expressed as "<instance1> is <instance2>".
Editor's Note: Rabbit counterpart for the DifferentIndividuals-axiom seems to be missing.
Editor's Note: accidentally omitted. Now added.
<instance assertion> ::= <same instances>
| <different instances>
| <positive instance assertion>
| <negative instance assertion>
<same instances> ::= <instance> and <instance> are the same thing
<different instances> ::= <instance> and <instance> are different
<positive instance assertion> ::= <instance> <compound relationship>
<negative instance assertion> ::= <instance> does not <compound relationship>
Relationships
Declaration:
<relationship declaration> ::= <relationship> is a relationship
Relationship assertions:
<literal modifier> ::= transitive | symmetric | asymmetric
<equivalence relationship assertion> ::= The relationships <relationship> and <relationship> are equivalent
<functional relationship assertion> ::= The relationship <relationship> can only have one object
<inverse functional relationship assertion> ::= The relationship <relationship> can only have one subject
<inverse relationship assertion> ::= The relationship <relationship> is the inverse of <relationship>
<irreflexive relationship assertion> ::= For the relationship <relationship> [,] nothing <relationship> itself
<literal relationship assertion> ::= The relationship <relationship> is <Literal modifier>
<mutual relationship exclusion assertion> ::= The relationships <relationship> and <relationship> are mutually exclusive
<reflexive relationship assertion> ::= For the relationship <relationship>[,] everything <relationship> itself
<relationship domain assertion> ::= The relationship <relationship> must have the subject <concept>
<relationship range assertion> ::= The relationship <relationship> must have the object <concept>
<relationship subsumption assertion> ::= The relationship <relationship> is a special type of the relationship <relationship>
<relationship assertion> ::= <literal relationship assertion>
| <functional relationship assertion>
| <inverse functional relationship assertion>
| <reflexive relationship assertion>
| <irreflexive relationship assertion>
| <relationship subsumption assertion>
| <equivalence relationship assertion>
| <mutual relationship exclusion assertion>
| <relationship domain assertion>
| <relationship range assertion>
| <inverse relationship assertion>
Imports
Import basics
<url> :: = ?? <label> ::= ‘[‘ <noun> ‘]’ <url ref> ::= <label> from <url>
Import sentences
<use single ontology sentence> ::= Use ontology: <url ref>
<use multiple ontologies sentence> ::= Use ontologies: <url ref> [; <url ref>]+
<reference concept sentence> ::= refer to <concept> <label> as [secondary] <concept>
<reference instance sentence> ::= refer to <instance> <label> as <instance>
<reference relationship sentence> ::= refer to <relationship> <label> as <relationship>
<import sentence> ::= <use single ontology sentence>
| <use multiple ontologies sentence>
| <reference concept sentence>
| <reference instance sentence>
| <reference relationship sentence>
Sentence Types
<sentence> ::= <sentence body> .
<sentence body> ::= <concept declaration>
| <concept assertion>
| <instance declaration>
| <instance assertion>
| <relationship declaration>
| <relationship modifier>
| <role inclusion>
| <import sentence>
return to OWL/CNL

