diff --git a/.bzrignore b/.bzrignore index 55322fae4dc0a038c470c3b39e8137c3de89782d..f67683abcd6c05aa2ccc8b282fb14ba470784027 100644 --- a/.bzrignore +++ b/.bzrignore @@ -4,3 +4,4 @@ AST *.class semantic.cache plugins +testontologies/ontologyV06_Jambalaya.properties diff --git a/DumpClasses.jrag b/DumpClasses.jrag index bdde28119a82bdb6556add72369d9c879fc0eb4d..c51ba010e82908c3494775017a104e1f888ebeea 100644 --- a/DumpClasses.jrag +++ b/DumpClasses.jrag @@ -16,16 +16,21 @@ aspect DumpClasses { void OwlClassDecl.dumpClasses(PrintStream pStream) { pStream.print(getId()); pStream.print(" : "+getSuperClass().getId()); - pStream.print(" ::= "); - Properties props = getProperties(); - for (int i=0; i<props.getNumProperty(); i++) { + pStream.print(" ::="); + Restrictions restrs = getRestrictions(); + for (int i=0; i<restrs.getNumOwlRestriction(); i++) { + pStream.print(" "+"restr"); + } + +// Properties props = getProperties(); +// for (int i=0; i<props.getNumProperty(); i++) { // pStream.print("<"); - pStream.print(props.getProperty(i).getId()); +// pStream.print(" "+props.getProperty(i).getId()); // pStream.print(":"); // pStream.print(props.getProperty(i).range().type()); // pStream.print(">"); // pStream.print(" "); - } +// } pStream.println(";"); } } diff --git a/Types.jrag b/Types.jrag index 8778a43a1d9799b437e6350059056a65b57b55df..d209002d04f90e3ecba3cbd4ef605ceb86e84059 100644 --- a/Types.jrag +++ b/Types.jrag @@ -53,6 +53,30 @@ aspect Types { } } +aspect Restrictions { + + Restrictions OwlClassDecl.restrictions; + + syn lazy Restrictions OwlClassDecl.getRestrictions() { + if (restrictions == null) { + List l = new List(); + collectRestrictions(l); + restrictions = new Restrictions(l); + } + return restrictions; + } + + void ASTNode.collectRestrictions(List l) { + for (int i=0; i<getNumChild(); i++) { + getChild(i).collectRestrictions(l); + } + } + + void OwlRestriction.collectRestrictions(List l) { + l.add(this); + } +} + aspect Properties { void ASTNode.collectProperties(List l) { for (int i=0; i<getNumChild(); i++) { diff --git a/owl.ast b/owl.ast index 4b38bf321ebb9e5934090b5928832482b16e7858..b9b120e66ec8b33bca9067acb9e45f12c8d8174d 100644 --- a/owl.ast +++ b/owl.ast @@ -69,5 +69,6 @@ OwlClassDecl : OClass ::= <Id:String> ; OwlClassUse : OClass ::= <Id:String> ; Properties ::= Property:Element*; +Restrictions ::= OwlRestriction*; OwlProperty : ComplexElement;