owl.ast 5.53 KB
Newer Older
1
// -*-Java-*-
2

Anders Nilsson's avatar
Anders Nilsson committed
3
 
4
// Copyright (C) 2006,2010  Anders Nilsson <anders.nilsson@control.lth.se>
Anders Nilsson's avatar
Anders Nilsson committed
5 6
//
// This file is part of OntologyCompiler.
7 8 9 10 11
//
// OntologyCompiler is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
Anders Nilsson's avatar
Anders Nilsson committed
12

13 14 15 16 17 18 19
// OntologyCompiler is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
 
// You should have received a copy of the GNU General Public License
// along with OntologyCompiler.  If not, see <http://www.gnu.org/licenses/>.
20

21 22
Start ::= Specification;

23
Specification ::= XmlHeader OntoDeclaration;
24

25 26
XmlHeader ::= Attribute*;

27 28
abstract Element;
abstract ComplexElement : Element ::= Attribute* Element*;
29 30 31 32 33 34 35 36 37

OntoDeclaration : ComplexElement;

// New ontology format elements
Annotation : ComplexElement;
AnnotationProperty : ComplexElement;
Clazz : ComplexElement;
ClassAssertion : ComplexElement;
DataProperty : ComplexElement;
Anders Nilsson's avatar
Sync  
Anders Nilsson committed
38
DataPropertyDomain : OwlProperty;
39 40 41 42 43 44 45 46 47 48
DataPropertyRange : ComplexElement;
Datatype : ComplexElement;
Declaration : ComplexElement;
Literal : ComplexElement;
NamedIndividual : ComplexElement;
ObjectExactCardinality : ComplexElement;
ObjectMinCardinality : ComplexElement;
ObjectSomeValuesFrom : ComplexElement;
ObjectProperty : ComplexElement;
ObjectPropertyAssertion : ComplexElement;
49
ObjectPropertyDomain : OwlProperty;
50 51 52 53
Ontology : OntoDeclaration;
Prefix : ComplexElement;
SubClassOf : ComplexElement;

Anders Nilsson's avatar
Anders Nilsson committed
54 55 56 57 58
// Synthetic classes from rewrites.
ClassDeclaration : Declaration;
IndividualDeclaration : Declaration;


59
// Compatibility with old format below
60 61 62 63
ListFirst : ComplexElement;
ListRest : ComplexElement;
ExprKIFCondition : ComplexElement;
ExprExpressionData : ComplexElement;
64 65 66 67
ExpressionCondition : ComplexElement;
ExpressionLogicLanguage : ComplexElement;
ExpressionRefURI : ComplexElement;
ObjectListList : ComplexElement;
68
RdfDeclaration : OntoDeclaration;
69
RdfDescription : ComplexElement;
70
RdfFirst : ComplexElement;
Anders Nilsson's avatar
Anders Nilsson committed
71
RdfProperty : ComplexElement;
72 73
RdfRest : ComplexElement;
RdfType : ComplexElement;
74
RdfsComment : ComplexElement;
75
RdfsDatatype : ComplexElement;
76
RdfsDomain : ComplexElement;
77
RdfsLabel : ComplexElement;
78
RdfsRange : ComplexElement;
79
RdfsSeeAlso : ComplexElement;
80 81
RdfsSubClassOf : ComplexElement;
RdfsSubPropertyOf : ComplexElement;
82
OwlOntology : ComplexElement;
83
OwlAllDifferent : ComplexElement;
84
OwlAllValuesFrom : OwlValuesFrom;
85
OwlCardinality : ComplexElement;
86 87
OwlClass : ComplexElement;
OwlDataRange : ComplexElement;
Anders Nilsson's avatar
Anders Nilsson committed
88
OwlDatatypeProperty : OwlProperty;
89
OwlDisjointWith : ComplexElement;
90
OwlDistinctMembers: ComplexElement;
91
OwlEquivalentClass : ComplexElement;
92
OwlEquivalentProperty : ComplexElement;
Anders Nilsson's avatar
Anders Nilsson committed
93
OwlFunctionalProperty : OwlProperty;
94
OwlHasValue : ComplexElement;
95 96
OwlImports : ComplexElement;
OwlIntersectionOf : ComplexElement;
97
OwlInverseOf : ComplexElement;
98
OwlMinCardinality : ComplexElement;
99
OwlMaxCardinality : ComplexElement;
100
OwlNamedIndividual : ComplexElement;
Anders Nilsson's avatar
Anders Nilsson committed
101
OwlObjectProperty : OwlProperty;
102 103
OwlOnClass : ComplexElement;
OwlOnDatatype : ComplexElement;
104
OwlOneOf : ComplexElement;
Anders Nilsson's avatar
Anders Nilsson committed
105
OwlOnProperty : OwlProperty;
106
OwlQualifiedCardinality : ComplexElement;
107
OwlRestriction : ComplexElement;
108 109
OwlSomeValuesFrom : OwlValuesFrom;
OwlTransitiveProperty : ComplexElement;
110
OwlUnionOf : ComplexElement;
111
OwlVersionInfo : ComplexElement;
112
OwlWithRestrictions : ComplexElement;
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
P1AnyOrder : ComplexElement;
P1Components : ComplexElement;
P1ComposedOf : ComplexElement;
P1ControlConstructBag : ComplexElement;
P1ControlConstructList : ComplexElement;
P1Else : ComplexElement;
P1HasInput : ComplexElement;
P1HasOutput : ComplexElement;
P1IfCondition : ComplexElement;
P1IfThenElse : ComplexElement;
P1Input : ComplexElement;
P1Output : ComplexElement;
P1ParameterType : ComplexElement;
P1Perform : ComplexElement;
P1Process : ComplexElement;
P1RepeatUntil : ComplexElement;
P1Sequence : ComplexElement;
P1Then : ComplexElement;
P1UntilProcess : ComplexElement;
P1UntilCondition : ComplexElement;
133 134
ProcessParticipant : ComplexElement;
ProcessPerform : ComplexElement;
135
XsdMinInclusive : ComplexElement;
136 137

abstract SimpleElement : Element;
138 139 140
StringElement : SimpleElement ::= <LITERAL>;
IntElement : SimpleElement ::= <LITERAL>;
FloatElement : SimpleElement ::= <LITERAL>;
141 142

abstract Attribute ::= Value;
143 144 145 146 147 148 149 150 151 152

// New ontology format attributes
AbbreviatedIRI : Attribute;
Cardinality : Attribute;
DatatypeIRI : Attribute;
OntologyIRI : Attribute;
IRI : Attribute;
Name : Attribute;


153 154
Version : Attribute;
RdfAbout : Attribute;
155
RdfDatatype : Attribute;
156
RdfId : Attribute;
157
RdfParseType : Attribute;
158 159 160
RdfResource : Attribute;
XmlBase : Attribute;
Xmlns : Attribute;
161
XmlnsXml : Attribute;
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
XmlnsXX : Attribute ::= <IDENTIFIER>;
// XmlnsDaml : Attribute;
// XmlnsDc : Attribute;
// XmlnsExpr : Attribute;
// XmlnsList : Attribute;
// XmlnsOwl : Attribute;
// XmlnsOwls : Attribute;
// XmlnsP1 : Attribute;
// XmlnsProtege : Attribute;
// XmlnsRdf : Attribute;
// XmlnsRdfs : Attribute;
// XmlnsSwrl : Attribute;
// XmlnsSwrlb : Attribute;
// XmlnsXsd : Attribute;
// XmlnsXsp : Attribute;
177

178
DiscardedElement : Element ::= Identifier Attribute* Element*;
179

180 181
Value ::= <STRING_LITERAL>;
Identifier ::= <IDENTIFIER>;
182

183
// Types used by rewrite rules
184
abstract OClass : Declaration ::= <Id:String>;
185 186
OwlClassDecl : OClass;
OwlClassUse : OClass;
187

188 189 190
abstract OwlValuesFrom: ComplexElement;


191
Properties ::= Property:Element*;
Anders Nilsson's avatar
Anders Nilsson committed
192
Restrictions ::= OwlRestriction*;
Anders Nilsson's avatar
Anders Nilsson committed
193

194
abstract OwlProperty : ComplexElement;