Loading CompilerGeneration.jrag +15 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,12 @@ aspect AbsGrammarGeneration { pStream.println("FloatElement : SimpleElement ::=;"); pStream.println("ClassUse : Thing ::= /decl:Thing/;"); pStream.println("Attribute ::= Value;"); pStream.println("AbbreviatedIRI : Attribute ::= ;"); pStream.println("Cardinality : Attribute ::= ;"); pStream.println("DatatypeIRI : Attribute ::= ;"); pStream.println("IRI : Attribute ::= ;"); pStream.println("Name : Attribute ::= ;"); pStream.println("OntologyIRI : Attribute ::= ;"); pStream.println("RdfDatatype : Attribute ::= ;"); pStream.println("RdfId : Attribute ::= ;"); pStream.println("Xmlns : Attribute ::= ;"); Loading Loading @@ -92,6 +98,10 @@ aspect AbsGrammarGeneration { } void ClassDeclaration.genAbsGrammar(PrintStream pStream) { if (name().equals("Thing")) { // Thing is handled explicitly return; } pStream.print(name()); pStream.print(" : "+getSuperClass().name()); pStream.print(" ::="); Loading Loading @@ -121,6 +131,11 @@ aspect AbsGrammarGeneration { pStream.print(":Thing*"); } void DataPropertyDomain.genAbsGrammarEntry(PrintStream pStream) { pStream.print("<"+dataProperty().name()+">"); // pStream.print(":String*"); } void Restrictions.genAbsGrammar(PrintStream pStream) { for (int i=0; i<getNumOwlRestriction(); i++) { pStream.print(" "); Loading Names.jrag +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ aspect Names { eq Clazz.name() = iri().trim(); eq NamedIndividual.name() = iri().trim(); eq ObjectProperty.name() = iri().trim(); eq DataProperty.name() = iri().trim(); static String ASTNode.gName = "owl"; Loading Types.jrag +23 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ aspect Types { // return new Properties(l); Properties p = new Properties(); for (int i=0; i<l.getNumChild(); i++) { ObjectPropertyDomain op = (ObjectPropertyDomain) l.getChild(i); OwlProperty op = (OwlProperty) l.getChild(i); if (op.domainIncludes(this)) { p.addProperty(op); } else { Loading Loading @@ -330,6 +330,16 @@ aspect Properties { return false; } boolean DataPropertyDomain.domainIncludes(Declaration clazz) { while (!clazz.name().equals("Thing")) { if (clazz().name().equals(clazz.name())) { return true; } clazz = clazz.getSuperClass(); } return false; } syn lazy RdfsRange Element.range() = null; eq OwlObjectProperty.range() { Loading Loading @@ -367,7 +377,19 @@ aspect Properties { return null; } syn DataProperty DataPropertyDomain.dataProperty() { for (Element e : getElements()) { if (e.isDataProperty()) { return (DataProperty) e; } } System.err.println("DataPropertyDomain.dataProperty(): not found"); return null; } syn boolean Element.isObjectProperty() = false; eq ObjectProperty.isObjectProperty() = true; syn boolean Element.isDataProperty() = false; eq DataProperty.isDataProperty() = true; } owl.ast +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ AnnotationProperty : ComplexElement; Clazz : ComplexElement; ClassAssertion : ComplexElement; DataProperty : ComplexElement; DataPropertyDomain : ComplexElement; DataPropertyDomain : OwlProperty; DataPropertyRange : ComplexElement; Datatype : ComplexElement; Declaration : ComplexElement; Loading owl.jjt +3 −2 Original line number Diff line number Diff line Loading @@ -292,7 +292,8 @@ SPECIAL_TOKEN : /* COMMENTS */ "]", ".", "&", "@" "@", ";" ] > | Loading Loading @@ -325,7 +326,7 @@ SPECIAL_TOKEN : /* COMMENTS */ | < RBRACE : "}" > // | < LBRACKET : "[" > // | < RBRACKET : "]" > | < SEMICOLON : ";" > // | < SEMICOLON : ";" > | < QUOTE : "\"" > // | < COMMA : "," > // | < DOT : "." > Loading Loading
CompilerGeneration.jrag +15 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,12 @@ aspect AbsGrammarGeneration { pStream.println("FloatElement : SimpleElement ::=;"); pStream.println("ClassUse : Thing ::= /decl:Thing/;"); pStream.println("Attribute ::= Value;"); pStream.println("AbbreviatedIRI : Attribute ::= ;"); pStream.println("Cardinality : Attribute ::= ;"); pStream.println("DatatypeIRI : Attribute ::= ;"); pStream.println("IRI : Attribute ::= ;"); pStream.println("Name : Attribute ::= ;"); pStream.println("OntologyIRI : Attribute ::= ;"); pStream.println("RdfDatatype : Attribute ::= ;"); pStream.println("RdfId : Attribute ::= ;"); pStream.println("Xmlns : Attribute ::= ;"); Loading Loading @@ -92,6 +98,10 @@ aspect AbsGrammarGeneration { } void ClassDeclaration.genAbsGrammar(PrintStream pStream) { if (name().equals("Thing")) { // Thing is handled explicitly return; } pStream.print(name()); pStream.print(" : "+getSuperClass().name()); pStream.print(" ::="); Loading Loading @@ -121,6 +131,11 @@ aspect AbsGrammarGeneration { pStream.print(":Thing*"); } void DataPropertyDomain.genAbsGrammarEntry(PrintStream pStream) { pStream.print("<"+dataProperty().name()+">"); // pStream.print(":String*"); } void Restrictions.genAbsGrammar(PrintStream pStream) { for (int i=0; i<getNumOwlRestriction(); i++) { pStream.print(" "); Loading
Names.jrag +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ aspect Names { eq Clazz.name() = iri().trim(); eq NamedIndividual.name() = iri().trim(); eq ObjectProperty.name() = iri().trim(); eq DataProperty.name() = iri().trim(); static String ASTNode.gName = "owl"; Loading
Types.jrag +23 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ aspect Types { // return new Properties(l); Properties p = new Properties(); for (int i=0; i<l.getNumChild(); i++) { ObjectPropertyDomain op = (ObjectPropertyDomain) l.getChild(i); OwlProperty op = (OwlProperty) l.getChild(i); if (op.domainIncludes(this)) { p.addProperty(op); } else { Loading Loading @@ -330,6 +330,16 @@ aspect Properties { return false; } boolean DataPropertyDomain.domainIncludes(Declaration clazz) { while (!clazz.name().equals("Thing")) { if (clazz().name().equals(clazz.name())) { return true; } clazz = clazz.getSuperClass(); } return false; } syn lazy RdfsRange Element.range() = null; eq OwlObjectProperty.range() { Loading Loading @@ -367,7 +377,19 @@ aspect Properties { return null; } syn DataProperty DataPropertyDomain.dataProperty() { for (Element e : getElements()) { if (e.isDataProperty()) { return (DataProperty) e; } } System.err.println("DataPropertyDomain.dataProperty(): not found"); return null; } syn boolean Element.isObjectProperty() = false; eq ObjectProperty.isObjectProperty() = true; syn boolean Element.isDataProperty() = false; eq DataProperty.isDataProperty() = true; }
owl.ast +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ AnnotationProperty : ComplexElement; Clazz : ComplexElement; ClassAssertion : ComplexElement; DataProperty : ComplexElement; DataPropertyDomain : ComplexElement; DataPropertyDomain : OwlProperty; DataPropertyRange : ComplexElement; Datatype : ComplexElement; Declaration : ComplexElement; Loading
owl.jjt +3 −2 Original line number Diff line number Diff line Loading @@ -292,7 +292,8 @@ SPECIAL_TOKEN : /* COMMENTS */ "]", ".", "&", "@" "@", ";" ] > | Loading Loading @@ -325,7 +326,7 @@ SPECIAL_TOKEN : /* COMMENTS */ | < RBRACE : "}" > // | < LBRACKET : "[" > // | < RBRACKET : "]" > | < SEMICOLON : ";" > // | < SEMICOLON : ";" > | < QUOTE : "\"" > // | < COMMA : "," > // | < DOT : "." > Loading