diff --git a/DumpClasses.jrag b/DumpClasses.jrag index 9c7fdf7391802f626b85cbe2d01d44cadd5dcd5e..efb26c0653e2c29b359ac463189f234611d810ac 100644 --- a/DumpClasses.jrag +++ b/DumpClasses.jrag @@ -15,6 +15,9 @@ aspect DumpClasses { void OwlClassDecl.dumpClasses(PrintStream pStream) { pStream.print(getId()); - pStream.println(" : "+getSuperClass().getId()); + pStream.print(" : "+getSuperClass().getId()); + pStream.print(" ::= "); + + pStream.println(";"); } } \ No newline at end of file diff --git a/Types.jrag b/Types.jrag index 9902091794a4823f93710797e6761620097e19aa..618608f96470b8d9e983eab0e10ec9fec75343a0 100644 --- a/Types.jrag +++ b/Types.jrag @@ -36,4 +36,38 @@ aspect Types { // that the right thing to do though. return null; } + + syn lazy Properties OwlClassDecl.getFunctionalProperties() { + List l = new List(); + getTopElement().collectFunctionalProperties(l); + Properties p = new Properties(); + for (int i=0; i<l.getNumChild(); i++) { + OwlFunctionalProperty op = (OwlFunctionalProperty) l.getChild(i); + if (op.domainIncludes(this)) { + p.addElement(op); + } + } + return p; + } +} + +aspect Properties { + void ASTNode.collectFunctionalProperties(List l) { + for (int i=0; i<getNumChild(); i++) { + getChild(i).collectFunctionalProperties(l); + } + } + + void OwlFunctionalProperty.collectFunctionalProperties(List l) { + l.add(this); + } + + boolean OwlFunctionalProperty.domainIncludes(Class clazz) { + for (int i=0; i<getNumElement(); i++) { + if (getElement(i) instanceof RdfsDomain) { +// ((RdfsDomain) getElement(i)). + } + } + return false; + } } \ No newline at end of file diff --git a/owl.ast b/owl.ast index 5f58266f9626aceb64bbe898031ff6c25065e935..0c1696bd628f3ff202a35f00c614976c54dd47fa 100644 --- a/owl.ast +++ b/owl.ast @@ -55,3 +55,5 @@ Value ::= <STRING_LITERAL>; abstract Class : ComplexElement; OwlClassDecl : Class ::= <Id:String> ; OwlClassUse : Class ::= <Id:String> ; + +Properties ::= Element*; \ No newline at end of file