Commit 2337a8e9 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Synching

parent ece46d6f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -19,12 +19,12 @@ aspect DumpClasses {
	pStream.print(" ::= ");
	Properties props = getProperties();
	for (int i=0; i<props.getNumProperty(); i++) {
	    pStream.print("<");
// 	    pStream.print("<");
	    pStream.print(props.getProperty(i).getId());
	    pStream.print(":");
	    pStream.print(props.getProperty(i).range().type());
	    pStream.print(">");
	    pStream.print(" ");
// 	    pStream.print(":");
// 	    pStream.print(props.getProperty(i).range().type());
// 	    pStream.print(">");
// 	    pStream.print(" ");
	}
	pStream.println(";");
    }
+14 −12
Original line number Diff line number Diff line
@@ -39,26 +39,28 @@ aspect Types {

    syn lazy Properties OwlClassDecl.getProperties() {
	List l = new List();
	getTopElement().collectObjectProperties(l);
	Properties p = new Properties();
	for (int i=0; i<l.getNumChild(); i++) {
	    OwlObjectProperty op = (OwlObjectProperty) l.getChild(i);
	    if (op.domainIncludes(this)) {
		p.addProperty(op);
	    }
	}
	return p;
// 	getTopElement().collectProperties(l);
	collectProperties(l);
	return new Properties(l);
// 	Properties p = new Properties();
// 	for (int i=0; i<l.getNumChild(); i++) {
// 	    OwlProperty op = (OwlProperty) l.getChild(i);
// 	    if (op.domainIncludes(this)) {
// 		p.addProperty(op);
// 	    }
// 	}
// 	return p;
    }
}

aspect Properties {
    void ASTNode.collectObjectProperties(List l) {
    void ASTNode.collectProperties(List l) {
	for (int i=0; i<getNumChild(); i++) {
	    getChild(i).collectObjectProperties(l);
	    getChild(i).collectProperties(l);
	}
    }

    void OwlObjectProperty.collectObjectProperties(List l) {
    void OwlProperty.collectProperties(List l) {
	l.add(this);
    }

+5 −3
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@ OwlDataRange : ComplexElement;
OwlDatatypeProperty : ComplexElement;
OwlDisjointWith : ComplexElement;
OwlEquivalentClass : ComplexElement;
OwlFunctionalProperty : ComplexElement;
OwlFunctionalProperty : OwlProperty;
OwlImports : ComplexElement;
OwlIntersectionOf : ComplexElement;
OwlInverseOf : ComplexElement;
OwlMinCardinality : ComplexElement;
OwlObjectProperty : ComplexElement;
OwlObjectProperty : OwlProperty;
OwlOneOf : ComplexElement;
OwlOnProperty : ComplexElement;
OwlOnProperty : OwlProperty;
OwlSomeValuesFrom : ComplexElement;
OwlRestriction : ComplexElement;
OwlUnionOf : ComplexElement;
@@ -69,3 +69,5 @@ OwlClassDecl : OClass ::= <Id:String> ;
OwlClassUse : OClass ::= <Id:String> ;

Properties ::= Property:Element*;

OwlProperty : ComplexElement;