Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Nilsson
OwlCompiler
Commits
d1ac614c
Commit
d1ac614c
authored
Jan 26, 2007
by
Anders Nilsson
Browse files
Synching
parent
dce01c7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
CompilerGeneration.jrag
View file @
d1ac614c
...
...
@@ -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)+"}");
}
}
...
...
siaras/OntologyGeneration.jrag
View file @
d1ac614c
...
...
@@ -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++) {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment