Commit d3d98efd authored by Anders Nilsson's avatar Anders Nilsson

Added new ontology description, and modified parser to handle the new keywords

parent 1bad383d
This diff is collapsed.
......@@ -11,18 +11,23 @@ RdfDeclaration : ComplexElement;
RdfFirst : ComplexElement;
RdfRest : ComplexElement;
RdfType : ComplexElement;
RdfsSubClassOf : ComplexElement;
RdfsDomain : ComplexElement;
RdfsRange : ComplexElement;
RdfsSubClassOf : ComplexElement;
RdfsSubPropertyOf : ComplexElement;
OwlOntology : ComplexElement;
OwlAllValuesFrom : ComplexElement;
OwlCardinality : ComplexElement;
OwlClass : ComplexElement;
OwlDataRange : ComplexElement;
OwlDatatypeProperty : ComplexElement;
OwlDisjointWith : ComplexElement;
OwlEquivalentClass : ComplexElement;
OwlFunctionalProperty : ComplexElement;
OwlImports : ComplexElement;
OwlIntersectionOf : ComplexElement;
OwlInverseOf : ComplexElement;
OwlMinCardinality : ComplexElement;
OwlObjectProperty : ComplexElement;
OwlOneOf : ComplexElement;
OwlOnProperty : ComplexElement;
......@@ -43,6 +48,9 @@ RdfParseType : Attribute;
RdfResource : Attribute;
XmlBase : Attribute;
Xmlns : Attribute;
XmlnsDaml : Attribute;
XmlnsDc : Attribute;
XmlnsProtege : Attribute;
XmlnsRdf : Attribute;
XmlnsXsd : Attribute;
XmlnsRdfs : Attribute;
......
......@@ -54,33 +54,18 @@ SPECIAL_TOKEN : /* COMMENTS */
<DEFAULT, BOUNDS> TOKEN : /* RESERVED WORDS AND LITERALS */
{
< XML : "xml" >
| < XML_BASE : "xml:base" >
| < XMLNS : "xmlns" >
| < XMLNS_RDF : "xmlns:rdf" >
| < XMLNS_XSD : "xmlns:xsd" >
| < XMLNS_RDFS : "xmlns:rdfs" >
| < XMLNS_OWL : "xmlns:owl" >
| < RDF_RDF : "rdf:RDF" >
| < RDF_ABOUT : "rdf:about" >
| < 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_ALLVALUESFROM : "owl:allValuesFrom" >
| < OWL_CARDINALITY : "owl:cardinality" >
| < 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_IMPORTS : "owl:imports" >
| < OWL_INTERSECTIONOF : "owl:intersectionOf" >
| < OWL_INVERSEOF : "owl:inverseOf" >
| < OWL_MINCARDINALITY : "owl:minCardinality" >
| < OWL_OBJECTPROPERTY : "owl:ObjectProperty" >
| < OWL_ONPROPERTY : "owl:onProperty" >
| < OWL_ONEOF : "owl:oneOf" >
......@@ -88,10 +73,32 @@ SPECIAL_TOKEN : /* COMMENTS */
| < OWL_RESTRICTION : "owl:Restriction" >
| < OWL_SOMEVALUESFROM : "owl:someValuesFrom" >
| < OWL_UNIONOF : "owl:unionOf" >
| < RDF_RDF : "rdf:RDF" >
| < RDF_ABOUT : "rdf:about" >
| < 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" >
| < RDFS_SUBPROPERTYOF : "rdfs:subPropertyOf" >
| < VERSION : "version" >
| < XML : "xml" >
| < XML_BASE : "xml:base" >
| < XMLNS : "xmlns" >
| < XMLNS_DAML : "xmlns:daml" >
| < XMLNS_DC : "xmlns:dc" >
| < XMLNS_PROTEGE : "xmlns:protege" >
| < XMLNS_RDF : "xmlns:rdf" >
| < XMLNS_XSD : "xmlns:xsd" >
| < XMLNS_RDFS : "xmlns:rdfs" >
| < XMLNS_OWL : "xmlns:owl" >
}// RESERVED WORDS AND LITERALS
<DEFAULT, BOUNDS> TOKEN : /* LITERALS */
{
< INTEGER_LITERAL:
......@@ -315,13 +322,17 @@ void OwlElement() : {}
{
OwlOntology()
| OwlAllValuesFrom()
| OwlCardinality()
| OwlClass()
| OwlDataRange()
| OwlDatatypeProperty()
| OwlDisjointWith()
| OwlEquivalentClass()
| OwlFunctionalProperty()
| OwlImports()
| OwlIntersectionOf()
| OwlInverseOf()
| OwlMinCardinality()
| OwlObjectProperty()
| OwlOneOf()
| OwlOnProperty()
......@@ -332,7 +343,8 @@ void OwlElement() : {}
void OwlOntology() #OwlOntology : {}
{
<OWL_ONTOLOGY> AttributeList() ElementList() "/>"
<OWL_ONTOLOGY> AttributeList()
(">" ElementList() "</" <OWL_ONTOLOGY> ">" | ElementList() "/>")
}
void OwlAllValuesFrom() #OwlAllValuesFrom : {}
......@@ -341,6 +353,12 @@ void OwlAllValuesFrom() #OwlAllValuesFrom : {}
(">" ElementList() "</" <OWL_ALLVALUESFROM> ">" | ElementList() "/>")
}
void OwlCardinality() #OwlCardinality : {}
{
<OWL_CARDINALITY> AttributeList()
(">" ElementList() "</" <OWL_CARDINALITY> ">" | ElementList() "/>")
}
void OwlClass() #OwlClass : {}
{
<OWL_CLASS> AttributeList()
......@@ -377,12 +395,30 @@ void OwlFunctionalProperty() #OwlFunctionalProperty : {}
(">" ElementList() "</" <OWL_FUNCTIONALPROPERTY> ">" | ElementList() "/>")
}
void OwlImports () #OwlImports : {}
{
<OWL_IMPORTS> AttributeList()
(">" ElementList() "</" <OWL_IMPORTS> ">" | ElementList() "/>")
}
void OwlIntersectionOf () #OwlIntersectionOf : {}
{
<OWL_INTERSECTIONOF> AttributeList()
(">" ElementList() "</" <OWL_INTERSECTIONOF> ">" | ElementList() "/>")
}
void OwlInverseOf () #OwlInverseOf : {}
{
<OWL_INVERSEOF> AttributeList()
(">" ElementList() "</" <OWL_INVERSEOF> ">" | ElementList() "/>")
}
void OwlMinCardinality () #OwlMinCardinality : {}
{
<OWL_MINCARDINALITY> AttributeList()
(">" ElementList() "</" <OWL_MINCARDINALITY> ">" | ElementList() "/>")
}
void OwlObjectProperty () #OwlObjectProperty : {}
{
<OWL_OBJECTPROPERTY> AttributeList()
......@@ -424,9 +460,10 @@ void RdfElement() : {}
RdfType()
| RdfFirst()
| RdfRest()
| RdfsSubClassOf()
| RdfsDomain()
| RdfsRange()
| RdfsSubClassOf()
| RdfsSubPropertyOf()
}
void RdfType() #RdfType : {}
......@@ -465,6 +502,12 @@ void RdfsSubClassOf() #RdfsSubClassOf : {}
(">" ElementList() "</" <RDFS_SUBCLASSOF> ">" | ElementList() "/>")
}
void RdfsSubPropertyOf() #RdfsSubPropertyOf : {}
{
<RDFS_SUBPROPERTYOF> AttributeList()
(">" ElementList() "</" <RDFS_SUBPROPERTYOF> ">" | ElementList() "/>")
}
void AttributeList() #List : {}
{
(Attribute())*
......@@ -530,10 +573,13 @@ void XmlBase() #XmlBase : {}
void XmlnsAttribute() : {}
{
Xmlns()
| XmlnsDaml()
| XmlnsDc()
| XmlnsOwl()
| XmlnsProtege()
| XmlnsRdf()
| XmlnsXsd()
| XmlnsRdfs()
| XmlnsOwl()
| XmlnsXsd()
}
void Xmlns() #Xmlns : {}
......@@ -541,6 +587,21 @@ void Xmlns() #Xmlns : {}
<XMLNS> <ASSIGN> Value()
}
void XmlnsDaml() #XmlnsDaml : {}
{
<XMLNS_DAML> <ASSIGN> Value()
}
void XmlnsDc() #XmlnsDc : {}
{
<XMLNS_DC> <ASSIGN> Value()
}
void XmlnsProtege() #XmlnsProtege : {}
{
<XMLNS_PROTEGE> <ASSIGN> Value()
}
void XmlnsRdf() #XmlnsRdf : {}
{
<XMLNS_RDF> <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