Commit d1ac614c authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Synching

parent dce01c7f
......@@ -315,17 +315,17 @@ aspect GenRewrites {
pStream.println();
// Rearrange device nodes on the AST to get away from the
// current diagonal style from Protege
// pStream.println(ind(1)+"rewrite "+name()+" {");
// pStream.println(ind(2)+"when (!isTopElement())");
// pStream.println(ind(2)+"to ClassUse {");
// pStream.println(ind(3)+"ClassUse use = new ClassUse();");
// pStream.println(ind(3)+"use.setOwlIdentifier(new OwlIdentifier(\""+name()+"\"));");
// pStream.println(ind(3)+"use.setAttributeList(new List().add(new RdfResource(getAttribute(0).getValue())));");
// pStream.println(ind(3)+"use.setElementList(new List());");
// pStream.println(ind(3)+"getRdfDecl().addElement(this);");
// pStream.println(ind(3)+"return use;");
// pStream.println(ind(2)+"}");
// pStream.println(ind(1)+"}");
pStream.println(ind(1)+"rewrite "+name()+" {");
pStream.println(ind(2)+"when (!isTopElement())");
pStream.println(ind(2)+"to ClassUse {");
pStream.println(ind(3)+"ClassUse use = new ClassUse();");
pStream.println(ind(3)+"use.setOwlIdentifier(new OwlIdentifier(\""+name()+"\"));");
pStream.println(ind(3)+"use.setAttributeList(new List().add(new RdfResource(getAttribute(0).getValue())));");
pStream.println(ind(3)+"use.setElementList(new List());");
pStream.println(ind(3)+"getRdfDecl().addElement(this);");
pStream.println(ind(3)+"return use;");
pStream.println(ind(2)+"}");
pStream.println(ind(1)+"}");
}
}
......
......@@ -48,6 +48,23 @@ aspect OntologyGeneration {
// }
public void ClassUse.genOntology(String ind, PrintStream pStream) {
pStream.print(ind+"< (CU) "+name());
for (int i=0; i<getNumAttribute(); i++) {
pStream.print(" ");
getAttribute(i).genOntology(pStream);
}
if (getNumElement() > 0) {
pStream.println(">");
for (int i=0; i<getNumElement(); i++) {
getElement(i).genOntology(ind+" ", pStream);
}
pStream.println(ind+"</"+name()+">");
} else {
pStream.println("/>");
}
}
public void Start.genOntology(String ind, PrintStream pStream) {
pStream.println("<?xml version=\"1.0\"?>");
for (int i=0; i<getNumElement(); i++) {
......
Supports Markdown
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