Commit b51432b5 authored by Anders Nilsson's avatar Anders Nilsson

Modified to handle new owl specification from olaan.

parent 999d9323
This diff is collapsed.
......@@ -5,24 +5,41 @@ Specification ::= XmlHeader RdfDeclaration;
XmlHeader ::= Attribute*;
abstract Element ::= Attribute* Element*;
RdfDeclaration : Element;
RdfsSubClassOf : Element;
RdfsDomain : Element;
OwlOntology : Element;
OwlAllValuesFrom : Element;
OwlClass : Element;
OwlDisjointWith : Element;
OwlEquivalentClass : Element;
OwlObjectProperty : Element;
OwlOnProperty : Element;
OwlSomeValuesFrom : Element;
OwlRestriction : Element;
abstract Element;
abstract ComplexElement : Element ::= Attribute* Element*;
RdfDeclaration : ComplexElement;
RdfFirst : ComplexElement;
RdfRest : ComplexElement;
RdfType : ComplexElement;
RdfsSubClassOf : ComplexElement;
RdfsDomain : ComplexElement;
RdfsRange : ComplexElement;
OwlOntology : ComplexElement;
OwlAllValuesFrom : ComplexElement;
OwlClass : ComplexElement;
OwlDataRange : ComplexElement;
OwlDatatypeProperty : ComplexElement;
OwlDisjointWith : ComplexElement;
OwlEquivalentClass : ComplexElement;
OwlFunctionalProperty : ComplexElement;
OwlInverseOf : ComplexElement;
OwlObjectProperty : ComplexElement;
OwlOneOf : ComplexElement;
OwlOnProperty : ComplexElement;
OwlSomeValuesFrom : ComplexElement;
OwlRestriction : ComplexElement;
OwlUnionOf : ComplexElement;
abstract SimpleElement : Element;
StringElement : SimpleElement ::= <IDENTIFIER>;
IntElement : SimpleElement ::= <INTEGER_LITERAL>;
abstract Attribute ::= Value;
Version : Attribute;
RdfAbout : Attribute;
RdfDatatype : Attribute;
RdfId : Attribute;
RdfParseType : Attribute;
RdfResource : Attribute;
XmlBase : Attribute;
Xmlns : Attribute;
......
......@@ -63,20 +63,32 @@ SPECIAL_TOKEN : /* COMMENTS */
| < XMLNS_OWL : "xmlns:owl" >
| < RDF_RDF : "rdf:RDF" >
| < RDF_ABOUT : "rdf:about" >
| < RDF_ID : "rdf:ID" >
| < RDF_RESOURCE : "rdf:resource" >
| < RDFS_DOMAIN : "rdfs:domain" >
| < RDFS_SUBCLASSOF : "rdfs:subClassOf" >
| < OWL_ALLVALUESFROM : "owl:allValuesFrom" >
| < OWL_CLASS : "owl:Class" >
| < OWL_ONTOLOGY : "owl:Ontology" >
| < OWL_DISJOINTWITH : "owl:disjointWith" >
| < OWL_EQUIVALENTCLASS: "owl:equivalentClass" >
| < OWL_RESTRICTION : "owl:Restriction" >
| < OWL_ONPROPERTY : "owl:onProperty" >
| < OWL_OBJECTPROPERTY : "owl:ObjectProperty" >
| < OWL_SOMEVALUESFROM : "owl:someValuesFrom" >
| < VERSION : "version" >
| < RDF_DATATYPE : "rdf:datatype" >
| < RDF_ID : "rdf:ID" >
| < RDF_FIRST : "rdf:first" >
| < RDF_REST : "rdf:rest" >
| < RDF_PARSETYPE : "rdf:parseType" >
| < RDF_RESOURCE : "rdf:resource" >
| < RDF_TYPE : "rdf:type" >
| < RDFS_DOMAIN : "rdfs:domain" >
| < RDFS_RANGE : "rdfs:range" >
| < RDFS_SUBCLASSOF : "rdfs:subClassOf" >
| < OWL_ALLVALUESFROM : "owl:allValuesFrom" >
| < OWL_CLASS : "owl:Class" >
| < OWL_DATARANGE : "owl:DataRange" >
| < OWL_DATATYPEPROPERTY : "owl:DatatypeProperty" >
| < OWL_DISJOINTWITH : "owl:disjointWith" >
| < OWL_EQUIVALENTCLASS : "owl:equivalentClass" >
| < OWL_FUNCTIONALPROPERTY : "owl:FunctionalProperty" >
| < OWL_INVERSEOF : "owl:inverseOf" >
| < OWL_OBJECTPROPERTY : "owl:ObjectProperty" >
| < OWL_ONPROPERTY : "owl:onProperty" >
| < OWL_ONEOF : "owl:oneOf" >
| < OWL_ONTOLOGY : "owl:Ontology" >
| < OWL_RESTRICTION : "owl:Restriction" >
| < OWL_SOMEVALUESFROM : "owl:someValuesFrom" >
| < OWL_UNIONOF : "owl:unionOf" >
| < VERSION : "version" >
}// RESERVED WORDS AND LITERALS
......@@ -275,9 +287,28 @@ void ElementList() #List : {}
void Element() : {}
{
"<" ( OwlElement()
| RdfElement()
)
( "<" ( OwlElement()
| RdfElement()
))
| SimpleElement()
}
void SimpleElement() : {}
{
IntElement()
| StringElement()
}
void IntElement() #IntElement : { Token t; }
{
t = <INTEGER_LITERAL>
{jjtThis.setINTEGER_LITERAL(t.image);}
}
void StringElement() #StringElement : { Token t; }
{
t = <IDENTIFIER>
{jjtThis.setIDENTIFIER(t.image);}
}
void OwlElement() : {}
......@@ -285,12 +316,18 @@ void OwlElement() : {}
OwlOntology()
| OwlAllValuesFrom()
| OwlClass()
| OwlDataRange()
| OwlDatatypeProperty()
| OwlDisjointWith()
| OwlEquivalentClass()
| OwlFunctionalProperty()
| OwlInverseOf()
| OwlObjectProperty()
| OwlOneOf()
| OwlOnProperty()
| OwlSomeValuesFrom()
| OwlRestriction()
| OwlUnionOf()
}
void OwlOntology() #OwlOntology : {}
......@@ -310,6 +347,18 @@ void OwlClass() #OwlClass : {}
(">" ElementList() "</" <OWL_CLASS> ">" | ElementList() "/>")
}
void OwlDataRange() #OwlDataRange : {}
{
<OWL_DATARANGE> AttributeList()
(">" ElementList() "</" <OWL_DATARANGE> ">" | ElementList() "/>")
}
void OwlDatatypeProperty() #OwlDatatypeProperty : {}
{
<OWL_DATATYPEPROPERTY> AttributeList()
(">" ElementList() "</" <OWL_DATATYPEPROPERTY> ">" | ElementList() "/>")
}
void OwlDisjointWith() #OwlDisjointWith : {}
{
<OWL_DISJOINTWITH> AttributeList()
......@@ -322,12 +371,30 @@ void OwlEquivalentClass() #OwlEquivalentClass : {}
(">" ElementList() "</" <OWL_EQUIVALENTCLASS> ">" | ElementList() "/>")
}
void OwlFunctionalProperty() #OwlFunctionalProperty : {}
{
<OWL_FUNCTIONALPROPERTY> AttributeList()
(">" ElementList() "</" <OWL_FUNCTIONALPROPERTY> ">" | ElementList() "/>")
}
void OwlInverseOf () #OwlInverseOf : {}
{
<OWL_INVERSEOF> AttributeList()
(">" ElementList() "</" <OWL_INVERSEOF> ">" | ElementList() "/>")
}
void OwlObjectProperty () #OwlObjectProperty : {}
{
<OWL_OBJECTPROPERTY> AttributeList()
(">" ElementList() "</" <OWL_OBJECTPROPERTY> ">" | ElementList() "/>")
}
void OwlOneOf () #OwlOneOf : {}
{
<OWL_ONEOF> AttributeList()
(">" ElementList() "</" <OWL_ONEOF> ">" | ElementList() "/>")
}
void OwlOnProperty () #OwlOnProperty : {}
{
<OWL_ONPROPERTY> AttributeList()
......@@ -346,16 +413,38 @@ void OwlRestriction () #OwlRestriction : {}
(">" ElementList() "</" <OWL_RESTRICTION> ">" | ElementList() "/>")
}
void OwlUnionOf () #OwlUnionOf : {}
{
<OWL_UNIONOF> AttributeList()
(">" ElementList() "</" <OWL_UNIONOF> ">" | ElementList() "/>")
}
void RdfElement() : {}
{
RdfsSubClassOf()
RdfType()
| RdfFirst()
| RdfRest()
| RdfsSubClassOf()
| RdfsDomain()
| RdfsRange()
}
void RdfsSubClassOf() #RdfsSubClassOf : {}
void RdfType() #RdfType : {}
{
<RDFS_SUBCLASSOF> AttributeList()
(">" ElementList() "</" <RDFS_SUBCLASSOF> ">" | ElementList() "/>")
<RDF_TYPE> AttributeList()
(">" ElementList() "</" <RDF_TYPE> ">" | ElementList() "/>")
}
void RdfFirst() #RdfFirst : {}
{
<RDF_FIRST> AttributeList()
(">" ElementList() "</" <RDF_FIRST> ">" | ElementList() "/>")
}
void RdfRest() #RdfRest : {}
{
<RDF_REST> AttributeList()
(">" ElementList() "</" <RDF_REST> ">" | ElementList() "/>")
}
void RdfsDomain() #RdfsDomain : {}
......@@ -364,6 +453,18 @@ void RdfsDomain() #RdfsDomain : {}
(">" ElementList() "</" <RDFS_DOMAIN> ">" | ElementList() "/>")
}
void RdfsRange() #RdfsRange : {}
{
<RDFS_RANGE> AttributeList()
(">" ElementList() "</" <RDFS_RANGE> ">" | ElementList() "/>")
}
void RdfsSubClassOf() #RdfsSubClassOf : {}
{
<RDFS_SUBCLASSOF> AttributeList()
(">" ElementList() "</" <RDFS_SUBCLASSOF> ">" | ElementList() "/>")
}
void AttributeList() #List : {}
{
(Attribute())*
......@@ -385,7 +486,9 @@ void Version() #Version : {}
void RdfAttribute() : {}
{
RdfAbout()
| RdfDatatype()
| RdfId()
| RdfParseType()
| RdfResource()
}
......@@ -394,12 +497,22 @@ void RdfAbout() #RdfAbout : {}
<RDF_ABOUT> <ASSIGN> Value()
}
void RdfDatatype() #RdfDatatype : {}
{
<RDF_DATATYPE> <ASSIGN> Value()
}
void RdfId() #RdfId : {}
{
<RDF_ID> <ASSIGN> Value()
}
void RdfResource() #RdfId : {}
void RdfParseType() #RdfParseType : {}
{
<RDF_PARSETYPE> <ASSIGN> Value()
}
void RdfResource() #RdfResource : {}
{
<RDF_RESOURCE> <ASSIGN> Value()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment